setDescription('Check the configuration'); return $this; } public function execute(InputInterface $input, OutputInterface $output) { if (!function_exists('_')) { $output->writeln('YOU MUST ENABLE GETTEXT SUPPORT TO USE PHRASEANET'); $output->writeln('Canceled'); return; } if (setup::is_installed()) { $registry = registry::get_instance(); $output->writeln(_('*** CHECK BINARY CONFIGURATION ***')); $this->processConstraints(setup::check_binaries($registry), $output); $output->writeln(""); } else { $registry = new Setup_Registry(); } $output->writeln(_('*** FILESYSTEM CONFIGURATION ***')); $this->processConstraints(setup::check_writability($registry), $output); $output->writeln(""); $output->writeln(_('*** CHECK CACHE OPCODE ***')); $this->processConstraints(setup::check_cache_opcode(), $output); $output->writeln(""); $output->writeln(_('*** CHECK CACHE SERVER ***')); $this->processConstraints(setup::check_cache_server(), $output); $output->writeln(""); $output->writeln(_('*** CHECK PHP CONFIGURATION ***')); $this->processConstraints(setup::check_php_configuration(), $output); $output->writeln(""); $output->writeln(_('*** CHECK PHP EXTENSIONS ***')); $this->processConstraints(setup::check_php_extension(), $output); $output->writeln(""); $output->writeln(_('*** CHECK PHRASEA ***')); $this->processConstraints(setup::check_phrasea(), $output); $output->writeln(""); $output->writeln(_('*** CHECK SYSTEM LOCALES ***')); $this->processConstraints(setup::check_system_locales(), $output); $output->writeln(""); $output->write('Finished !', true); return; } protected function processConstraints(Setup_ConstraintsIterator $constraints, OutputInterface &$output) { foreach ($constraints as $constraint) { $this->processConstraint($constraint, $output); } } protected function processConstraint(Setup_Constraint $constraint, OutputInterface &$output) { if ($constraint->is_ok()) $output->writeln("\t\t" . $constraint->get_message() . ''); elseif ($constraint->is_blocker()) $output->writeln("\t!!!\t" . $constraint->get_message() . ''); else $output->writeln("\t/!\\\t" . $constraint->get_message() . ''); return; } }