Beispiel #1
0
<?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";
    }
}
Beispiel #2
0
        } else {
            echo $translator->trans('process.step.check.phpchanges');
        }
        ?>
                            </li>
                        <?php 
    }
    ?>
                    </ul>
                </div>
            <?php 
}
?>

            <?php 
$requirements = array('mandatory' => $collection->getMandatoryRequirements(), 'php' => $collection->getPhpIniRequirements(), 'chamilo' => $collection->getChamiloRequirements(), 'cli' => $collection->getCliRequirements(), 'optional' => $collection->getRecommendations());
foreach ($requirements as $type => $requirement) {
    ?>
                <table class="table table-striped">
                    <col width="75%" valign="top">
                    <col width="25%" valign="top">
                    <thead>
                    <tr>
                        <th><?php 
    echo $translator->trans('process.step.check.table.' . $type);
    ?>
</th>
                        <th><?php 
    echo $translator->trans('process.step.check.table.status');
    ?>
</th>
 /**
  * @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;
 }