index.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. require_once 'Header.php';
  3. $requirements = [
  4. 'PHP 7.1.0' => version_compare(PHP_VERSION, '7.1.0', '>='),
  5. 'PHP extension XML' => extension_loaded('xml'),
  6. 'PHP extension xmlwriter' => extension_loaded('xmlwriter'),
  7. 'PHP extension mbstring' => extension_loaded('mbstring'),
  8. 'PHP extension ZipArchive' => extension_loaded('zip'),
  9. 'PHP extension GD (optional)' => extension_loaded('gd'),
  10. 'PHP extension dom (optional)' => extension_loaded('dom'),
  11. ];
  12. if (!$helper->isCli()) {
  13. ?>
  14. <div class="jumbotron">
  15. <p>Welcome to PHPSpreadsheet, a library written in pure PHP and providing a set of classes that allow you to read from and to write to different spreadsheet file formats, like Excel and LibreOffice Calc.</p>
  16. <p>&nbsp;</p>
  17. <p>
  18. <a class="btn btn-lg btn-primary" href="https://github.com/PHPOffice/PHPSpreadsheet" role="button"><i class="fa fa-github fa-lg" title="GitHub"></i> Fork us on Github!</a>
  19. <a class="btn btn-lg btn-primary" href="https://phpspreadsheet.readthedocs.io" role="button"><i class="fa fa-book fa-lg" title="Docs"></i> Read the Docs</a>
  20. </p>
  21. </div>
  22. <?php
  23. echo '<h3>Requirement check</h3>';
  24. echo '<ul>';
  25. foreach ($requirements as $label => $result) {
  26. $status = $result ? 'passed' : 'failed';
  27. echo "<li>{$label} ... <span class='{$status}'>{$status}</span></li>";
  28. }
  29. echo '</ul>';
  30. } else {
  31. echo 'Requirement check:' . PHP_EOL;
  32. foreach ($requirements as $label => $result) {
  33. $status = $result ? '32m passed' : '31m failed';
  34. echo "{$label} ... \033[{$status}\033[0m" . PHP_EOL;
  35. }
  36. }