No Description

index.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. include_once 'Sample_Header.php';
  3. use PhpOffice\PhpWord\Settings;
  4. $requirements = array(
  5. 'php' => array('PHP 5.3.3', version_compare(PHP_VERSION, '5.3.3', '>=')),
  6. 'xml' => array('PHP extension XML', extension_loaded('xml')),
  7. 'temp' => array('Temp folder "<code>' . Settings::getTempDir() . '</code>" is writable', is_writable(Settings::getTempDir())),
  8. 'zip' => array('PHP extension ZipArchive (optional)', extension_loaded('zip')),
  9. 'gd' => array('PHP extension GD (optional)', extension_loaded('gd')),
  10. 'xmlw' => array('PHP extension XMLWriter (optional)', extension_loaded('xmlwriter')),
  11. 'xsl' => array('PHP extension XSL (optional)', extension_loaded('xsl')),
  12. );
  13. if (!CLI) {
  14. ?>
  15. <div class="jumbotron">
  16. <p>Welcome to PHPWord, 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 (.docx), Open Document Format (.odt), and Rich Text Format (.rtf).</p>
  17. <p>&nbsp;</p>
  18. <p>
  19. <a class="btn btn-lg btn-primary" href="https://github.com/PHPOffice/PHPWord" role="button"><i class="fa fa-github fa-lg" title="GitHub"></i> Fork us on Github!</a>
  20. <a class="btn btn-lg btn-primary" href="http://phpword.readthedocs.org/" role="button"><i class="fa fa-book fa-lg" title="Docs"></i> Read the Docs</a>
  21. </p>
  22. </div>
  23. <?php
  24. }
  25. if (!CLI) {
  26. echo "<h3>Requirement check:</h3>";
  27. echo "<ul>";
  28. foreach ($requirements as $key => $value) {
  29. list($label, $result) = $value;
  30. $status = $result ? 'passed' : 'failed';
  31. echo "<li>{$label} ... <span class='{$status}'>{$status}</span></li>";
  32. }
  33. echo "</ul>";
  34. include_once 'Sample_Footer.php';
  35. } else {
  36. echo 'Requirement check:' . PHP_EOL;
  37. foreach ($requirements as $key => $value) {
  38. list($label, $result) = $value;
  39. $label = strip_tags($label);
  40. $status = $result ? '32m passed' : '31m failed';
  41. echo "{$label} ... \033[{$status}\033[0m" . PHP_EOL;
  42. }
  43. }