Add explicit dependencies to the PHP extensions "dom" and "mbstring"

Pico doesn't require the PHP extensions itself, but erusev/parsedown-extra does. The explicit composer.json requirements are necessary until erusev/parsedown-extra#85 gets merged. Both extensions aren't part of Ubuntu's default LAMP setup anymore.
This commit is contained in:
Daniel Rudolf 2017-05-26 21:43:48 +02:00
parent 3d16c8df16
commit f0b42cf364
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538
2 changed files with 9 additions and 1 deletions

View file

@ -24,6 +24,8 @@
}, },
"require": { "require": {
"php": ">=5.3.6", "php": ">=5.3.6",
"ext-dom": "*",
"ext-mbstring": "*",
"twig/twig": "^1.18", "twig/twig": "^1.18",
"erusev/parsedown-extra": "^0.7", "erusev/parsedown-extra": "^0.7",
"symfony/yaml" : "^2.3" "symfony/yaml" : "^2.3"

View file

@ -1,9 +1,15 @@
<?php // @codingStandardsIgnoreFile <?php // @codingStandardsIgnoreFile
// check PHP version // check PHP platform requirements
if (PHP_VERSION_ID < 50306) { if (PHP_VERSION_ID < 50306) {
die('Pico requires PHP 5.3.6 or above to run'); die('Pico requires PHP 5.3.6 or above to run');
} }
if (!extension_loaded('dom')) {
die('Pico requires the PHP extension "dom" to run');
}
if (!extension_loaded('mbstring')) {
die('Pico requires the PHP extension "mbstring" to run');
}
// load dependencies // load dependencies
require_once(__DIR__ . '/vendor/autoload.php'); require_once(__DIR__ . '/vendor/autoload.php');