Esempio n. 1
0
        $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">
            <?php 
        } elseif (!$requirement->isOptional()) {
Esempio n. 2
0
 /**
  * @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;
 }