diff options
author | till <till@php.net> | 2008-02-17 18:31:06 +0000 |
---|---|---|
committer | till <till@php.net> | 2008-02-17 18:31:06 +0000 |
commit | 24e1f19fc01645d6d848866f94c95fcd13c09079 (patch) | |
tree | ca727dc9e6ca105c77cccbf95d415a6f2714854c | |
parent | 3bf0b0dcaddc1adc7971d0bbb8c96614555f0a70 (diff) |
* silenced dl() again (DONT CHANGE THIS!)
* added a check for needed PHP extensions
-rw-r--r-- | check.php-dist | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/check.php-dist b/check.php-dist index dac2ae022..91c4b4b6c 100644 --- a/check.php-dist +++ b/check.php-dist @@ -83,6 +83,9 @@ $supported_drivers = array('MDB2#mysql' => 'MDB2/Driver/mysql.php', $supported_dbs = array('MySQL' => 'mysql', 'MySQLi' => 'mysqli', 'PostgreSQL' => 'pgsql', 'SQLite (v2)' => 'sqlite'); +$php_ext = array('Session' => 'session', 'FileInfo' => 'fileinfo', + 'Regex (perl)' => 'pcre', 'Sockets' => 'sockets', 'Multibyte' => 'mbstring'); + $path = dirname(__FILE__) . '/'; $check = basename(__FILE__); @@ -151,7 +154,28 @@ foreach ($supported_dbs AS $database => $ext) { } else { $_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX; echo CHECK_NA; - if (dl($_ext)) { + if (@dl($_ext)) { + echo ' (<i>Could</i> be loaded. Please add in php.ini, if you plan on using it.)'; + } else { + echo ' (<b>Not</b> installed.)'; + } + } + echo '<br />'; +} + +echo '<h3>Checking PHP extensions</h3>'; +echo '<p>Not all of those extensions are <b>needed</b>, but it does not <i>hurt</i> to have them.</p>'; +echo '<p>The best is to see only <span class="success">green</span> in this section! :-)</p>'; + +$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; +foreach ($php_ext AS $name => $ext) { + echo "$name: "; + if (extension_loaded($ext)) { + echo CHECK_OK; + } else { + $_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX; + echo CHECK_NA; + if (@dl($_ext)) { echo ' (<i>Could</i> be loaded. Please add in php.ini, if you plan on using it.)'; } else { echo ' (<b>Not</b> installed.)'; @@ -433,4 +457,4 @@ if ($rctest_config['default_host'] == '') { } ?> </body> -</html>
\ No newline at end of file +</html> |