<?php require_once dirname(__FILE__) . '/ChamiloRequirements.php'; require_once dirname(__FILE__) . '/../vendor/autoload.php'; $requirements = new ChamiloRequirements(); $requirementNeeded = true; foreach ($requirements->getChamiloRequirements() as $requirement) { /** @var Requirement $requirement */ if (!$requirement->isFulfilled()) { echo $requirement->getTestMessage() . "\n"; } }
exit; require_once __DIR__ . '/../app/AppKernel.php'; $kernel = new AppKernel('dev', false); $kernel->loadClassCache(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response); exit; } } /** * @todo Identify correct locale (headers?) */ $locale = 'en'; $collection = new ChamiloRequirements(); $translator = new Translator($locale); $majorProblems = $collection->getFailedRequirements(); $minorProblems = $collection->getFailedRecommendations(); $translator->addLoader('yml', new YamlFileLoader()); $translator->addResource('yml', __DIR__ . '/../src/Chamilo/InstallerBundle/Resources/translations/messages.' . $locale . '.yml', $locale); function iterateRequirements(array $collection, $translator) { foreach ($collection as $requirement) { ?> <tr> <td class="dark"> <?php if ($requirement->isFulfilled()) { ?> <span class="icon-yes">
/** * @param InputInterface $input * @param OutputInterface $output * @return $this */ protected function checkStep(InputInterface $input, OutputInterface $output) { $output->writeln('<info>Checking system requirements.</info>'); require_once $this->getContainer()->getParameter('kernel.root_dir') . DIRECTORY_SEPARATOR . 'ChamiloRequirements.php'; $collection = new \ChamiloRequirements(); $this->renderTable($collection->getMandatoryRequirements(), 'Mandatory requirements', $output); $this->renderTable($collection->getPhpIniRequirements(), 'PHP settings', $output); $this->renderTable($collection->getChamiloRequirements(), 'Chamilo specific requirements', $output); $this->renderTable($collection->getRecommendations(), 'Optional recommendations', $output); if (count($collection->getFailedRequirements())) { throw new \RuntimeException('Some system requirements are not fulfilled. Please check output messages and fix them.'); } $output->writeln(''); return $this; }