From e5091219f10549f1aee4baac6646e763b9f66809 Mon Sep 17 00:00:00 2001 From: thomascube Date: Mon, 18 Feb 2008 22:25:51 +0000 Subject: [PATCH] Add urls for PHP modules and PEAR packages; also check for iconv and openssl --- check.php-dist | 60 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/check.php-dist b/check.php-dist index 91c4b4b6c..f308cc3da 100644 --- a/check.php-dist +++ b/check.php-dist @@ -83,13 +83,35 @@ $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'); +$required_php_exts = array('Session' => 'session', 'PCRE' => 'pcre', 'Sockets' => 'sockets'); + +$optional_php_exts = array('FileInfo' => 'fileinfo', 'Libiconv' => 'iconv', 'Multibyte' => 'mbstring', 'OpenSSL' => 'openssl'); + +$source_urls = array( + 'Socket' => 'http://www.php.net/manual/en/ref.sockets.php', + 'Session' => 'http://www.php.net/manual/en/ref.session.php', + 'PCRE' => 'http://www.php.net/manual/en/ref.pcre.php', + 'FileInfo' => 'http://www.php.net/manual/en/ref.fileinfo.php', + 'Libiconv' => 'http://www.php.net/manual/en/ref.iconv.php', + 'Multibyte' => 'http://www.php.net/manual/en/ref.mbstring.php', + 'OpenSSL' => 'http://www.php.net/manual/en/ref.openssl.php', + 'PEAR' => 'http://pear.php.net', + 'MDB2' => 'http://pear.php.net/package/MDB2', + 'Net_SMTP' => 'http://pear.php.net/package/Net_SMTP', + 'Mail_mime' => 'http://pear.php.net/package/Mail_mime' +); $path = dirname(__FILE__) . '/'; $check = basename(__FILE__); require_once 'include/bugs.inc'; + +function show_hint($key) { + global $source_urls; + if ($source_urls[$key]) + echo '(See ' . $source_urls[$key] . ')'; +} + ?> @@ -124,6 +146,10 @@ h4 { color: #f60; font-weight: bold; } + +.indent { + padding-left: 0.8em; +} /* ]]> */ RoundCube :: check @@ -144,7 +170,7 @@ if ($rctest_config['from'] == '_yourfrom_') { } echo '

Checking available databases

'; -echo '

Checks if the extension is loaded.

'; +echo '

Checks if the extension is loaded. At least one of them is required.

'; $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; foreach ($supported_dbs AS $database => $ext) { @@ -164,11 +190,28 @@ foreach ($supported_dbs AS $database => $ext) { } echo '

Checking PHP extensions

'; -echo '

Not all of those extensions are needed, but it does not hurt to have them.

'; -echo '

The best is to see only green in this section! :-)

'; +echo '

The following modules/extensions are required to run RoundCube

'; $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; -foreach ($php_ext AS $name => $ext) { +foreach ($required_php_exts 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 ' (Could be loaded. Please add in php.ini.)'; + } else { + show_hint($name); + } + } + echo '
'; +} + +echo '

These extensions are optional but recommended to get the best performance.

'; + +foreach ($optional_php_exts AS $name => $ext) { echo "$name: "; if (extension_loaded($ext)) { echo CHECK_OK; @@ -178,7 +221,7 @@ foreach ($php_ext AS $name => $ext) { if (@dl($_ext)) { echo ' (Could be loaded. Please add in php.ini, if you plan on using it.)'; } else { - echo ' (Not installed.)'; + show_hint($name); } } echo '
'; @@ -193,7 +236,8 @@ foreach ($required_libs as $classname => $file) { if (class_exists($classname)) { echo CHECK_OK; } else { - echo CHECK_NOK . "; Failed to load $file"; + echo CHECK_NOK . " (Failed to load $file.)"; + show_hint($classname); } echo "
"; }