コード例 #1
0
 public function __construct(TranslatorInterface $translator, $root)
 {
     parent::__construct($translator->trans('sylius.filesystem', array(), 'requirements'));
     $exists = $translator->trans('sylius.filesystem.exists', array(), 'requirements');
     $notExists = $translator->trans('sylius.filesystem.not_exists', array(), 'requirements');
     $writable = $translator->trans('sylius.filesystem.writable', array(), 'requirements');
     $notWritable = $translator->trans('sylius.filesystem.not_writable', array(), 'requirements');
     $this->add(new Requirement($translator->trans('sylius.filesystem.vendors', array(), 'requirements'), $status = is_dir($root . '/../vendor'), $exists, $status ? $exists : $notExists))->add(new Requirement($translator->trans('sylius.filesystem.cache', array(), 'requirements'), $status = is_writable($root . '/cache'), $translator->trans('sylius.filesystem.writable', array(), 'requirements'), $status ? $translator->trans('sylius.filesystem.writable', array(), 'requirements') : $translator->trans('sylius.filesystem.not_writable', array(), 'requirements'), true, $translator->trans('sylius.filesystem.cache.help', array('%path%' => $root . '/cache'), 'requirements')))->add(new Requirement($translator->trans('sylius.filesystem.logs', array(), 'requirements'), $status = is_writable($root . '/logs'), $writable, $status ? $writable : $notWritable, true, $translator->trans('sylius.filesystem.logs.help', array('%path%' => $root . '/logs'), 'requirements')))->add(new Requirement($translator->trans('sylius.filesystem.parameters', array(), 'requirements'), $status = is_writable($root . '/config/parameters.yml'), $writable, $status ? $writable : $notWritable, true, $translator->trans('sylius.filesystem.parameters.help', array('%path%' => $root . '/config/parameters.yml'), 'requirements')));
 }
コード例 #2
0
 public function __construct(TranslatorInterface $translator)
 {
     parent::__construct($translator->trans('sylius.settings', array(), 'requirements'));
     $on = $translator->trans('sylius.settings.on', array(), 'requirements');
     $off = $translator->trans('sylius.settings.off', array(), 'requirements');
     $this->add(new Requirement($translator->trans('sylius.settings.version', array(), 'requirements'), version_compare(phpversion(), self::REQUIRED_PHP_VERSION, '>='), '>=' . self::REQUIRED_PHP_VERSION, phpversion()))->add(new Requirement($translator->trans('sylius.settings.version_recommanded', array(), 'requirements'), version_compare(phpversion(), '5.3.8', '>='), '>=5.3.8', phpversion(), false));
     if (version_compare(phpversion(), self::REQUIRED_PHP_VERSION, '>=')) {
         $this->add(new Requirement($translator->trans('sylius.settings.timezone_deprecated', array(), 'requirements'), in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers()), $translator->trans('sylius.settings.non_deprecated', array(), 'requirements'), date_default_timezone_get(), true, $translator->trans('sylius.settings.timezone_deprecated.help', array('%timezone%' => date_default_timezone_get()), 'requirements')));
     }
     $this->add(new Requirement($translator->trans('sylius.settings.detect_unicode', array(), 'requirements'), !$this->isOn('detect_unicode'), $on, ini_get('detect_unicode'), false))->add(new Requirement($translator->trans('sylius.settings.detect_unicode', array(), 'requirements'), !$this->isOn('detect_unicode'), $on, ini_get('detect_unicode'), false))->add(new Requirement($translator->trans('sylius.settings.short_open_tag', array(), 'requirements'), !$this->isOn('short_open_tag'), $off, ini_get('short_open_tag'), false))->add(new Requirement($translator->trans('sylius.settings.magic_quotes_gpc', array(), 'requirements'), !$this->isOn('magic_quotes_gpc'), $off, ini_get('magic_quotes_gpc'), false))->add(new Requirement($translator->trans('sylius.settings.register_globals', array(), 'requirements'), !$this->isOn('register_globals'), $off, ini_get('register_globals'), false))->add(new Requirement($translator->trans('sylius.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('sylius.extensions', array(), 'requirements'));
     $on = $translator->trans('sylius.extensions.on', array(), 'requirements');
     $off = $translator->trans('sylius.extensions.off', array(), 'requirements');
     $pcreVersion = defined('PCRE_VERSION') ? (double) PCRE_VERSION : null;
     $this->add(new Requirement($translator->trans('sylius.extensions.json_encode', array(), 'requirements'), $status = function_exists('json_encode'), $on, $status ? $on : $off, true, $translator->trans('sylius.extensions.help', array('%extension%' => 'JSON'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.session_start', array(), 'requirements'), $status = function_exists('session_start'), $on, $status ? $on : $off, true, $translator->trans('sylius.extensions.help', array('%extension%' => 'session'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.ctype', array(), 'requirements'), $status = function_exists('ctype_alpha'), $on, $status ? $on : $off, true, $translator->trans('sylius.extensions.help', array('%extension%' => 'ctype'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.token_get_all', array(), 'requirements'), $status = function_exists('token_get_all'), $on, $status ? $on : $off, true, $translator->trans('sylius.extensions.help', array('%extension%' => 'JSON'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.simplexml_import_dom', array(), 'requirements'), $status = function_exists('simplexml_import_dom'), $on, $status ? $on : $off, true, $translator->trans('sylius.extensions.help', array('%extension%' => 'SimpleXML'), 'requirements')))->add(new Requirement($translator->trans('sylius.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('sylius.extensions.help', array('%extension%' => 'APC (>=3.0.17)'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.pcre', array(), 'requirements'), null !== $pcreVersion && $pcreVersion > 8.0, '>=8.0', $pcreVersion, true, $translator->trans('sylius.extensions.help', array('%extension%' => 'PCRE (>=8.0)'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.php_xml', array(), 'requirements'), $status = class_exists('DomDocument'), $on, $status ? $on : $off, false, $translator->trans('sylius.extensions.help', array('%extension%' => 'PHP-XML'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.mbstring', array(), 'requirements'), $status = function_exists('mb_strlen'), $on, $status ? $on : $off, false, $translator->trans('sylius.extensions.help', array('%extension%' => 'mbstring'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.iconv', array(), 'requirements'), $status = function_exists('iconv'), $on, $status ? $on : $off, false, $translator->trans('sylius.extensions.help', array('%extension%' => 'iconv'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.intl', array(), 'requirements'), $status = class_exists('Locale'), $on, $status ? $on : $off, false, $translator->trans('sylius.extensions.help', array('%extension%' => 'intl'), 'requirements')));
     if (class_exists('Locale')) {
         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('sylius.extensions.icu', array(), 'requirements'), version_compare($version, '4.0', '>='), '4.0', $version, false, $translator->trans('sylius.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('sylius.extensions.accelerator', array(), 'requirements'), $status, $on, $status ? $on : $off, false, $translator->trans('sylius.extensions.accelerator.help', array(), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.pdo', array(), 'requirements'), $status = class_exists('PDO'), $on, $status ? $on : $off, false, $translator->trans('sylius.extensions.help', array('%extension%' => 'PDO'), 'requirements')))->add(new Requirement($translator->trans('sylius.extensions.gd', array(), 'requirements'), $status = defined('GD_VERSION'), $on, $status ? $on : $off, false, $translator->trans('sylius.extensions.help', array('%extension%' => 'gd'), 'requirements')));
 }