index.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. include_once 'Sample_Header.php';
  3. $requirements = array(
  4. 'php' => array('PHP 5.3.0', version_compare(phpversion(), '5.3.0', '>=')),
  5. 'xml' => array('PHP extension XML', extension_loaded('xml')),
  6. 'zip' => array('PHP extension ZipArchive (optional)', extension_loaded('zip')),
  7. 'gd' => array('PHP extension GD (optional)', extension_loaded('gd')),
  8. 'xmlw' => array('PHP extension XMLWriter (optional)', extension_loaded('xmlwriter')),
  9. 'xsl' => array('PHP extension XSL (optional)', extension_loaded('xsl')),
  10. );
  11. if (!CLI) {
  12. ?>
  13. <div class="jumbotron">
  14. <p>Welcome to PHPPresentation, a library written in pure PHP that provides a set of classes to write to and read from different document file formats, i.e. Office Open XML (.pptx) and Open Document Format (.odp).</p>
  15. <p>&nbsp;</p>
  16. <p>
  17. <a class="btn btn-lg btn-primary" href="https://github.com/PHPOffice/PHPPresentation" role="button"><i class="fa fa-github fa-lg" title="GitHub"></i> Fork us on Github!</a>
  18. <a class="btn btn-lg btn-primary" href="http://phppresentation.readthedocs.org/en/develop/" role="button"><i class="fa fa-book fa-lg" title="Docs"></i> Read the Docs</a>
  19. </p>
  20. </div>
  21. <?php
  22. }
  23. if (!CLI) {
  24. echo "<h3>Requirement check:</h3>";
  25. echo "<ul>";
  26. foreach ($requirements as $key => $value) {
  27. list($label, $result) = $value;
  28. $status = $result ? 'passed' : 'failed';
  29. echo "<li>{$label} ... <span class='{$status}'>{$status}</span></li>";
  30. }
  31. echo "</ul>";
  32. include_once 'Sample_Footer.php';
  33. } else {
  34. echo 'Requirement check:' . PHP_EOL;
  35. foreach ($requirements as $key => $value) {
  36. list($label, $result) = $value;
  37. $status = $result ? '32m passed' : '31m failed';
  38. echo "{$label} ... \033[{$status}\033[0m" . PHP_EOL;
  39. }
  40. }