diff options
author | Elan Ruusamäe | 2014-05-14 16:26:32 (GMT) |
---|---|---|
committer | Elan Ruusamäe | 2014-05-14 16:26:32 (GMT) |
commit | 4cf8a2f74892c75ceb847683157a88a3e9c114b6 (patch) | |
tree | 5b3f132c167b876dffe418f5a43b32748e412015 /ext-check.patch | |
parent | 7a1353301dad78b3925d94f3e795109826b2f303 (diff) | |
download | php-pear-PEAR-4cf8a2f74892c75ceb847683157a88a3e9c114b6.zip php-pear-PEAR-4cf8a2f74892c75ceb847683157a88a3e9c114b6.tar.gz |
check required php extensions early, before PEAR monstrocity gives uninformative errors
Diffstat (limited to 'ext-check.patch')
-rw-r--r-- | ext-check.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext-check.patch b/ext-check.patch new file mode 100644 index 0000000..440c847 --- /dev/null +++ b/ext-check.patch @@ -0,0 +1,19 @@ +--- PEAR-1.9.4/usr/share/pear/pearcmd.php~ 2014-05-14 19:21:49.000000000 +0300 ++++ PEAR-1.9.4/usr/share/pear/pearcmd.php 2014-05-14 19:21:53.064418441 +0300 +@@ -45,6 +45,16 @@ + + $pear_package_version = "1.9.4"; + ++// before trying anything deep, ensure base extensions are present ++// this avoids debugging problems with bogus error messages, which really are ++// caused by missing extension ++foreach (array('pcre', 'zlib', 'xml2') as $ext) { ++ if (!extension_loaded($ext)) { ++ error_log("$argv[0] requires PHP extension $ext."); ++ exit(1); ++ } ++} ++ + require_once 'PEAR.php'; + require_once 'PEAR/Frontend.php'; + require_once 'PEAR/Config.php'; |