Procházet zdrojové kódy

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.
Daniel Rudolf před 8 roky
rodič
revize
f0b42cf364
2 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 2 0
      composer.json
  2. 7 1
      index.php.dist

+ 2 - 0
composer.json

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

+ 7 - 1
index.php.dist

@@ -1,9 +1,15 @@
 <?php // @codingStandardsIgnoreFile
 
-// check PHP version
+// check PHP platform requirements
 if (PHP_VERSION_ID < 50306) {
     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
 require_once(__DIR__ . '/vendor/autoload.php');