Improve check setup for required extensions

This commit is contained in:
Frederic Guillot 2016-01-09 10:03:08 -05:00
parent ef1618b0df
commit b7cd8c3e52
3 changed files with 24 additions and 10 deletions

View File

@ -19,19 +19,24 @@ if (version_compare(PHP_VERSION, '5.4.0', '<')) {
} }
} }
// Check extension: PDO // Check PDO extensions
if (! extension_loaded('pdo_sqlite') && ! extension_loaded('pdo_mysql') && ! extension_loaded('pdo_pgsql')) { if (DB_DRIVER === 'sqlite' && ! extension_loaded('pdo_sqlite')) {
throw new Exception('PHP extension required: "pdo_sqlite" or "pdo_mysql" or "pdo_pgsql"'); throw new Exception('PHP extension required: "pdo_sqlite"');
} }
// Check extension: mbstring if (DB_DRIVER === 'mysql' && ! extension_loaded('pdo_mysql')) {
if (! extension_loaded('mbstring')) { throw new Exception('PHP extension required: "pdo_mysql"');
throw new Exception('PHP extension required: "mbstring"');
} }
// Check extension: gd if (DB_DRIVER === 'postgres' && ! extension_loaded('pdo_pgsql')) {
if (! extension_loaded('gd')) { throw new Exception('PHP extension required: "pdo_pgsql"');
throw new Exception('PHP extension required: "gd"'); }
// Check other extensions
foreach (array('gd', 'mbstring', 'hash', 'openssl', 'json', 'hash', 'ctype', 'filter', 'session') as $ext) {
if (! extension_loaded($ext)) {
throw new Exception('PHP extension required: "'.$ext.'"');
}
} }
// Fix wrong value for arg_separator.output, used by the function http_build_query() // Fix wrong value for arg_separator.output, used by the function http_build_query()

View File

@ -15,8 +15,15 @@
}, },
"require" : { "require" : {
"php" : ">=5.3", "php" : ">=5.3",
"ext-mbstring" : "*",
"ext-gd" : "*", "ext-gd" : "*",
"ext-mbstring" : "*",
"ext-hash" : "*",
"ext-openssl" : "*",
"ext-json" : "*",
"ext-hash" : "*",
"ext-ctype" : "*",
"ext-filter" : "*",
"ext-session" : "*",
"christian-riesen/otp" : "1.4", "christian-riesen/otp" : "1.4",
"eluceo/ical": "0.8.0", "eluceo/ical": "0.8.0",
"erusev/parsedown" : "1.6.0", "erusev/parsedown" : "1.6.0",

View File

@ -68,6 +68,8 @@ Kanboard is pre-configured to work with Apache (URL rewriting).
| openssl | | | openssl | |
| json | | | json | |
| hash | | | hash | |
| ctype | |
| session | |
| ldap | Only for LDAP authentication | | ldap | Only for LDAP authentication |
| Zend OPcache | Recommended | | Zend OPcache | Recommended |