| 1 |
<?php |
| 2 |
|
| 3 |
require_once 'Header.php'; |
| 4 |
|
| 5 |
$requirements = [ |
| 6 |
'PHP 5.6.0' => version_compare(PHP_VERSION, '5.6.0', '>='), |
| 7 |
'PHP extension XML' => extension_loaded('xml'), |
| 8 |
'PHP extension xmlwriter' => extension_loaded('xmlwriter'), |
| 9 |
'PHP extension mbstring' => extension_loaded('mbstring'), |
| 10 |
'PHP extension ZipArchive' => extension_loaded('zip'), |
| 11 |
'PHP extension GD (optional)' => extension_loaded('gd'), |
| 12 |
'PHP extension dom (optional)' => extension_loaded('dom'), |
| 13 |
]; |
| 14 |
|
| 15 |
if (!$helper->isCli()) { |
| 16 |
?> |
| 17 |
<div class="jumbotron"> |
| 18 |
<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> |
| 19 |
<p> </p> |
| 20 |
<p> |
| 21 |
<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> |
| 22 |
<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> |
| 23 |
</p> |
| 24 |
</div> |
| 25 |
<?php |
| 26 |
echo '<h3>Requirement check</h3>'; |
| 27 |
echo '<ul>'; |
| 28 |
foreach ($requirements as $label => $result) { |
| 29 |
$status = $result ? 'passed' : 'failed'; |
| 30 |
echo "<li>{$label} ... <span class='{$status}'>{$status}</span></li>"; |
| 31 |
} |
| 32 |
echo '</ul>'; |
| 33 |
} else { |
| 34 |
echo 'Requirement check:' . PHP_EOL; |
| 35 |
foreach ($requirements as $label => $result) { |
| 36 |
$status = $result ? '32m passed' : '31m failed'; |
| 37 |
echo "{$label} ... \033[{$status}\033[0m" . PHP_EOL; |
| 38 |
} |
| 39 |
} |
| 40 |
|