if ('\\' == DIRECTORY_SEPARATOR) { echo "* (especially on the Windows platform)\n"; } echo "* To be on the safe side, please also launch the requirements check\n"; echo "* from your web server using the web/config.php script.\n"; echo_title('Mandatory requirements'); $checkPassed = true; foreach ($diamanteDeskRequirements->getRequirements() as $req) { /** @var $req Requirement */ echo_requirement($req); if (!$req->isFulfilled()) { $checkPassed = false; } } echo_title('Optional recommendations'); foreach ($diamanteDeskRequirements->getRecommendations() as $req) { echo_requirement($req); } exit($checkPassed ? 0 : 1); /** * Prints a Requirement instance */ function echo_requirement(Requirement $requirement) { $result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR'); echo ' ' . str_pad($result, 9); echo $requirement->getTestMessage() . "\n"; if (!$requirement->isFulfilled()) { echo sprintf(" %s\n\n", $requirement->getHelpText()); } }
} else { echo $translator->trans('process.step.check.phpchanges'); } ?> </li> <?php } ?> </ul> </div> <?php } ?> <?php $requirements = array('mandatory' => $collection->getMandatoryRequirements(), 'php' => $collection->getPhpIniRequirements(), 'oro' => $collection->getOroRequirements(), 'diamante' => $collection->getDiamanteDeskRequirements(), 'cli' => $collection->getCliRequirements(), 'optional' => $collection->getRecommendations()); foreach ($requirements as $type => $requirement) { ?> <table class="table"> <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.check'); ?> </th>
/** * @param OutputInterface $output * * @return $this * @throws \RuntimeException */ protected function checkRequirementsStep(OutputInterface $output) { $output->writeln('<info>Requirements check:</info>'); if (!class_exists('DiamanteDeskRequirements')) { require_once $this->getContainer()->getParameter('kernel.root_dir') . DIRECTORY_SEPARATOR . 'DiamanteDeskRequirements.php'; } $collection = new \DiamanteDeskRequirements(); $this->renderTable($collection->getMandatoryRequirements(), 'Mandatory requirements', $output); $this->renderTable($collection->getPhpIniRequirements(), 'PHP settings', $output); $this->renderTable($collection->getOroRequirements(), 'Oro specific requirements', $output); $this->renderTable($collection->getDiamanteDeskRequirements(), 'DiamanteDesk 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; }