protected function ensureRequiredEnvironment()
{
if (version_compare(phpversion(), self::MINIMUM_PHP_VERSION, '<')) {
echo 'Flow requires PHP version ' . self::MINIMUM_PHP_VERSION . ' or higher but your installed version is currently ' . phpversion() . '. (Error #1172215790)' . PHP_EOL;
exit(1);
}
if (!extension_loaded('mbstring')) {
echo 'Flow requires the PHP extension "mbstring" (Error #1207148809)' . PHP_EOL;
exit(1);
}
if (DIRECTORY_SEPARATOR !== '/' && PHP_WINDOWS_VERSION_MAJOR < 6) {
echo 'Flow does not support Windows versions older than Windows Vista or Windows Server 2008 (Error #1312463704)' . PHP_EOL;
exit(1);
}
if (!extension_loaded('Reflection')) {
echo 'The PHP extension "Reflection" is required by Flow.' . PHP_EOL;
exit(1);
}
$method = new \ReflectionMethod(__CLASS__, __FUNCTION__);
if ($method->getDocComment() === false || $method->getDocComment() === '') {
echo 'Reflection of doc comments is not supported by your PHP setup. Please check if you have installed an accelerator which removes doc comments.' . PHP_EOL;
exit(1);
}
set_time_limit(0);
if (ini_get('date.timezone') === '') {
ini_set('date.timezone', 'UTC');
}
if (!is_dir(FLOW_PATH_DATA) && !is_link(FLOW_PATH_DATA)) {
if (!@mkdir(FLOW_PATH_DATA)) {
echo 'Flow could not create the directory "' . FLOW_PATH_DATA . '". Please check the file permissions manually or run "sudo ./flow flow:core:setfilepermissions" to fix the problem. (Error #1347526552)';
exit(1);
}
}
if (!is_dir(FLOW_PATH_DATA . 'Persistent') && !is_link(FLOW_PATH_DATA . 'Persistent')) {
if (!@mkdir(FLOW_PATH_DATA . 'Persistent')) {
echo 'Flow could not create the directory "' . FLOW_PATH_DATA . 'Persistent". Please check the file permissions manually or run "sudo ./flow flow:core:setfilepermissions" to fix the problem. (Error #1347526553)';
exit(1);
}
}
if (!is_dir(FLOW_PATH_TEMPORARY) && !is_link(FLOW_PATH_TEMPORARY)) {
// We can't use Files::createDirectoryRecursively() because mkdir() without shutup operator will lead to a PHP warning
$oldMask = umask(00);
if (!@mkdir(FLOW_PATH_TEMPORARY, 0777, true)) {
echo 'Flow could not create the directory "' . FLOW_PATH_TEMPORARY . '". Please check the file permissions manually or run "sudo ./flow flow:core:setfilepermissions" to fix the problem. (Error #1441354578)';
exit(1);
}
umask($oldMask);
}
}