From b7cd8c3e525134447df885a6a324b38f56667ddd Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 9 Jan 2016 10:03:08 -0500 Subject: Improve check setup for required extensions --- app/check_setup.php | 23 ++++++++++++++--------- composer.json | 9 ++++++++- doc/requirements.markdown | 2 ++ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/check_setup.php b/app/check_setup.php index ec389834..d6fbd4dd 100644 --- a/app/check_setup.php +++ b/app/check_setup.php @@ -19,19 +19,24 @@ if (version_compare(PHP_VERSION, '5.4.0', '<')) { } } -// Check extension: PDO -if (! extension_loaded('pdo_sqlite') && ! extension_loaded('pdo_mysql') && ! extension_loaded('pdo_pgsql')) { - throw new Exception('PHP extension required: "pdo_sqlite" or "pdo_mysql" or "pdo_pgsql"'); +// Check PDO extensions +if (DB_DRIVER === 'sqlite' && ! extension_loaded('pdo_sqlite')) { + throw new Exception('PHP extension required: "pdo_sqlite"'); } -// Check extension: mbstring -if (! extension_loaded('mbstring')) { - throw new Exception('PHP extension required: "mbstring"'); +if (DB_DRIVER === 'mysql' && ! extension_loaded('pdo_mysql')) { + throw new Exception('PHP extension required: "pdo_mysql"'); } -// Check extension: gd -if (! extension_loaded('gd')) { - throw new Exception('PHP extension required: "gd"'); +if (DB_DRIVER === 'postgres' && ! extension_loaded('pdo_pgsql')) { + throw new Exception('PHP extension required: "pdo_pgsql"'); +} + +// 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() diff --git a/composer.json b/composer.json index faf75da9..a557b199 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,15 @@ }, "require" : { "php" : ">=5.3", - "ext-mbstring" : "*", "ext-gd" : "*", + "ext-mbstring" : "*", + "ext-hash" : "*", + "ext-openssl" : "*", + "ext-json" : "*", + "ext-hash" : "*", + "ext-ctype" : "*", + "ext-filter" : "*", + "ext-session" : "*", "christian-riesen/otp" : "1.4", "eluceo/ical": "0.8.0", "erusev/parsedown" : "1.6.0", diff --git a/doc/requirements.markdown b/doc/requirements.markdown index 2c99d4f2..cf2c7c8a 100644 --- a/doc/requirements.markdown +++ b/doc/requirements.markdown @@ -68,6 +68,8 @@ Kanboard is pre-configured to work with Apache (URL rewriting). | openssl | | | json | | | hash | | +| ctype | | +| session | | | ldap | Only for LDAP authentication | | Zend OPcache | Recommended | -- cgit v1.2.3