コード例 #1
0
 public function __construct(TranslatorInterface $translator, $root, $cacheDir, $logDir)
 {
     parent::__construct($translator->trans('dos.filesystem.header', array(), 'requirements'));
     $exists = $translator->trans('dos.filesystem.exists', array(), 'requirements');
     $notExists = $translator->trans('dos.filesystem.not_exists', array(), 'requirements');
     $writable = $translator->trans('dos.filesystem.writable', array(), 'requirements');
     $notWritable = $translator->trans('dos.filesystem.not_writable', array(), 'requirements');
     $this->add(new Requirement($translator->trans('dos.filesystem.vendors', array(), 'requirements'), $status = is_dir($root . '/../vendor'), $exists, $status ? $exists : $notExists))->add(new Requirement($translator->trans('dos.filesystem.cache.header', array(), 'requirements'), $status = is_writable($cacheDir), $translator->trans('dos.filesystem.writable', array(), 'requirements'), $status ? $translator->trans('dos.filesystem.writable', array(), 'requirements') : $translator->trans('dos.filesystem.not_writable', array(), 'requirements'), true, $translator->trans('dos.filesystem.cache.help', array('%path%' => $cacheDir), 'requirements')))->add(new Requirement($translator->trans('dos.filesystem.logs.header', array(), 'requirements'), $status = is_writable($logDir), $writable, $status ? $writable : $notWritable, true, $translator->trans('dos.filesystem.logs.help', array('%path%' => $logDir), 'requirements')))->add(new Requirement($translator->trans('dos.filesystem.parameters.header', array(), 'requirements'), $status = is_writable($root . '/config/parameters.yml'), $writable, $status ? $writable : $notWritable, true, $translator->trans('dos.filesystem.parameters.help', array('%path%' => $root . '/config/parameters.yml'), 'requirements')));
 }
コード例 #2
0
 public function __construct(TranslatorInterface $translator)
 {
     parent::__construct($translator->trans('dos.settings.header', array(), 'requirements'));
     $on = $translator->trans('dos.settings.on', array(), 'requirements');
     $off = $translator->trans('dos.settings.off', array(), 'requirements');
     $this->add(new Requirement($translator->trans('dos.settings.version', array(), 'requirements'), version_compare(phpversion(), self::REQUIRED_PHP_VERSION, '>='), '>=' . self::REQUIRED_PHP_VERSION, phpversion()))->add(new Requirement($translator->trans('dos.settings.version_recommanded', array(), 'requirements'), version_compare(phpversion(), '5.3.8', '>='), '>=5.3.8', phpversion(), false))->add(new Requirement($translator->trans('dos.settings.timezone', array(), 'requirements'), $this->isOn('date.timezone'), $translator->trans('dos.settings.any', array(), 'requirements'), ini_get('date.timezone')));
     if (version_compare(phpversion(), self::REQUIRED_PHP_VERSION, '>=')) {
         $this->add(new Requirement($translator->trans('dos.settings.timezone_deprecated.header', array(), 'requirements'), in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers()), $translator->trans('dos.settings.non_deprecated', array(), 'requirements'), date_default_timezone_get(), true, $translator->trans('dos.settings.timezone_deprecated.help', array('%timezone%' => date_default_timezone_get()), 'requirements')));
     }
     $this->add(new Requirement($translator->trans('dos.settings.detect_unicode', array(), 'requirements'), !$this->isOn('detect_unicode'), $on, ini_get('detect_unicode'), false))->add(new Requirement($translator->trans('dos.settings.short_open_tag', array(), 'requirements'), !$this->isOn('short_open_tag'), $off, ini_get('short_open_tag'), false))->add(new Requirement($translator->trans('dos.settings.magic_quotes_gpc', array(), 'requirements'), !$this->isOn('magic_quotes_gpc'), $off, ini_get('magic_quotes_gpc'), false))->add(new Requirement($translator->trans('dos.settings.register_globals', array(), 'requirements'), !$this->isOn('register_globals'), $off, ini_get('register_globals'), false))->add(new Requirement($translator->trans('dos.settings.session.auto_start', array(), 'requirements'), !$this->isOn('session.auto_start'), $off, ini_get('session.auto_start'), false));
 }
コード例 #3
0
 public function __construct(TranslatorInterface $translator)
 {
     parent::__construct($translator->trans('dos.extensions.header', array(), 'requirements'));
     $on = $translator->trans('dos.extensions.on', array(), 'requirements');
     $off = $translator->trans('dos.extensions.off', array(), 'requirements');
     $pcreVersion = defined('PCRE_VERSION') ? (double) PCRE_VERSION : null;
     $this->add(new Requirement($translator->trans('dos.extensions.json_encode', array(), 'requirements'), $status = function_exists('json_encode'), $on, $status ? $on : $off, true, $translator->trans('dos.extensions.help', array('%extension%' => 'JSON'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.session_start', array(), 'requirements'), $status = function_exists('session_start'), $on, $status ? $on : $off, true, $translator->trans('dos.extensions.help', array('%extension%' => 'session'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.ctype', array(), 'requirements'), $status = function_exists('ctype_alpha'), $on, $status ? $on : $off, true, $translator->trans('dos.extensions.help', array('%extension%' => 'ctype'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.token_get_all', array(), 'requirements'), $status = function_exists('token_get_all'), $on, $status ? $on : $off, true, $translator->trans('dos.extensions.help', array('%extension%' => 'JSON'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.simplexml_import_dom', array(), 'requirements'), $status = function_exists('simplexml_import_dom'), $on, $status ? $on : $off, true, $translator->trans('dos.extensions.help', array('%extension%' => 'SimpleXML'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.apc', array(), 'requirements'), !(function_exists('apc_store') && ini_get('apc.enabled')) || version_compare(phpversion('apc'), '3.0.17', '>='), '>=3.0.17', phpversion('apc'), true, $translator->trans('dos.extensions.help', array('%extension%' => 'APC (>=3.0.17)'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.pcre', array(), 'requirements'), null !== $pcreVersion && $pcreVersion > 8.0, '>=8.0', $pcreVersion, true, $translator->trans('dos.extensions.help', array('%extension%' => 'PCRE (>=8.0)'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.php_xml', array(), 'requirements'), $status = class_exists('DomDocument'), $on, $status ? $on : $off, false, $translator->trans('dos.extensions.help', array('%extension%' => 'PHP-XML'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.mbstring', array(), 'requirements'), $status = function_exists('mb_strlen'), $on, $status ? $on : $off, false, $translator->trans('dos.extensions.help', array('%extension%' => 'mbstring'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.iconv', array(), 'requirements'), $status = function_exists('iconv'), $on, $status ? $on : $off, false, $translator->trans('dos.extensions.help', array('%extension%' => 'iconv'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.exif', array(), 'requirements'), $status = function_exists('exif_read_data'), $on, $status ? $on : $off, true, $translator->trans('dos.extensions.help', array('%extension%' => 'exif'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.intl', array(), 'requirements'), $status = extension_loaded('intl'), $on, $status ? $on : $off, false, $translator->trans('dos.extensions.help', array('%extension%' => 'intl'), 'requirements')));
     if (extension_loaded('intl')) {
         if (defined('INTL_ICU_VERSION')) {
             $version = INTL_ICU_VERSION;
         } else {
             $reflector = new ReflectionExtension('intl');
             ob_start();
             $reflector->info();
             $output = strip_tags(ob_get_clean());
             preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches);
             $version = $matches[1];
         }
         $this->add(new Requirement($translator->trans('dos.extensions.icu', array(), 'requirements'), version_compare($version, '4.0', '>='), '4.0', $version, false, $translator->trans('dos.extensions.help', array('%extension%' => 'ICU (>=4.0)'), 'requirements')));
     }
     $status = function_exists('apc_store') && ini_get('apc.enabled') || function_exists('eaccelerator_put') && ini_get('eaccelerator.enable') || function_exists('xcache_set');
     $this->add(new Requirement($translator->trans('dos.extensions.accelerator.header', array(), 'requirements'), $status, $on, $status ? $on : $off, false, $translator->trans('dos.extensions.accelerator.help', array(), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.pdo', array(), 'requirements'), $status = class_exists('PDO'), $on, $status ? $on : $off, false, $translator->trans('dos.extensions.help', array('%extension%' => 'PDO'), 'requirements')))->add(new Requirement($translator->trans('dos.extensions.gd', array(), 'requirements'), $status = defined('GD_VERSION'), $on, $status ? $on : $off, false, $translator->trans('dos.extensions.help', array('%extension%' => 'gd'), 'requirements')));
 }