Check that all needed PHP extensions are loaded before install

This commit is contained in:
Dmitriy Simushev 2014-11-27 12:58:13 +00:00
parent 80077be185
commit 7ac85ac412

View File

@ -123,6 +123,11 @@ class Installer
array(Utils::formatVersionId($this->getPhpVersionId()))
);
if (!$this->checkPhpExtensions()) {
return false;
}
$this->log[] = getlocal('All necessary PHP extensions are loaded');
if (!$this->checkFsPermissions()) {
return false;
}
@ -476,6 +481,27 @@ class Installer
return true;
}
/**
* Checks that all necessary PHP extensions are loaded.
*
* @return boolean True if all necessary extensions are loaded and false
* otherwise.
*/
protected function checkPhpExtensions()
{
$extensions = array('PDO', 'pdo_mysql', 'gd', 'iconv');
foreach ($extensions as $ext) {
if (!extension_loaded($ext)) {
$this->errors[] = getlocal('PHP {0} extension is not loaded', array($ext));
return false;
}
}
return true;
}
/**
* Checks if files and directories permissions are correct.
*