本文整理汇总了PHP中SymfonyRequirements::getRecommendations方法的典型用法代码示例。如果您正苦于以下问题:PHP SymfonyRequirements::getRecommendations方法的具体用法?PHP SymfonyRequirements::getRecommendations怎么用?PHP SymfonyRequirements::getRecommendations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymfonyRequirements
的用法示例。
在下文中一共展示了SymfonyRequirements::getRecommendations方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAction
public function checkAction()
{
$data['page'] = 'check';
require_once __DIR__ . '/../../../../app/SymfonyRequirements.php';
$symfonyRequirements = new \SymfonyRequirements();
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
$data['result'] = '
<div class="alert alert-warning"><ul>
' . ($iniPath ? sprintf("<li>Configuration file used by PHP: %s</li>", $iniPath) : "<li>WARNING: No configuration file (php.ini) used by PHP!</li>") . '<li>The PHP CLI can use a different php.ini file</li>
<li>than the one used with your web server.</li>';
if ('\\' == DIRECTORY_SEPARATOR) {
$data['result'] .= '<li>(especially on the Windows platform)</li>';
}
$data['result'] .= '<li>To be on the safe side, please also launch the requirements check</li>
<li>from your web server using the web/config.php script.</li>
</ul></div>';
$data['result'] .= '<div class="table-responsive"><table id="checkTable" class="table table-striped">';
$checkPassed = true;
foreach ($symfonyRequirements->getRequirements() as $req) {
/** @var $req Requirement */
$data['result'] .= $this->echo_requirement($req);
if (!$req->isFulfilled()) {
$checkPassed = false;
}
}
foreach ($symfonyRequirements->getRecommendations() as $req) {
$data['result'] .= $this->echo_requirement($req);
}
$data['result'] .= '</table></div>';
return $this->render('OjsInstallerBundle:Default:check.html.twig', array('data' => $data));
}
示例2: getRecommendations
/**
* {@inheritdoc}
*/
public function getRecommendations()
{
$recommendations = parent::getRecommendations();
foreach ($recommendations as $key => $recommendation) {
$testMessage = $recommendation->getTestMessage();
if (preg_match_all(self::EXCLUDE_RECOMMENDED_MASK, $testMessage, $matches)) {
unset($recommendations[$key]);
}
}
return $recommendations;
}
示例3: requirementsAction
/**
* Check System Requirements
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function requirementsAction()
{
// include symfony requirements class
require_once dirname(__FILE__) . '/../../../../app/SymfonyRequirements.php';
$symfonyRequirements = new \SymfonyRequirements();
// add additional requirement for mcrypt
$symfonyRequirements->addRequirement(extension_loaded('mcrypt'), "Check if mcrypt ist loaded for RSA encryption", "Please enable mcrypt-Extension. See <a href='http://php.net/manual/de/mcrypt.setup.php'>http://php.net/manual/de/mcrypt.setup.php</a>");
// fetch all data
$aRequirements = $symfonyRequirements->getRequirements();
$aRecommendations = $symfonyRequirements->getRecommendations();
$aFailedRequirements = $symfonyRequirements->getFailedRequirements();
$aFailedRecommendations = $symfonyRequirements->getFailedRecommendations();
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
// render template
return $this->render('SlashworksBackendBundle:Install:requirements.html.twig', array("iniPath" => $iniPath, "requirements" => $aRequirements, "recommendations" => $aRecommendations, "failedrequirements" => $aFailedRequirements, "failedrecommendations" => $aFailedRecommendations));
}
示例4: aboutAction
/**
* Display form for license activation
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function aboutAction()
{
$oLicense = LicenseQuery::create()->findOne();
// include symfony requirements class
require_once dirname(__FILE__) . '/../../../../app/SymfonyRequirements.php';
$symfonyRequirements = new \SymfonyRequirements();
// add additional requirement for mcrypt
$symfonyRequirements->addRequirement(extension_loaded('mcrypt'), "Check if mcrypt ist loaded for RSA encryption", "Please enable mcrypt-Extension. See <a href='http://php.net/manual/de/mcrypt.setup.php'>http://php.net/manual/de/mcrypt.setup.php</a>");
// fetch all data
$aRequirements = $symfonyRequirements->getRequirements();
$aRecommendations = $symfonyRequirements->getRecommendations();
$aFailedRequirements = $symfonyRequirements->getFailedRequirements();
$aFailedRecommendations = $symfonyRequirements->getFailedRecommendations();
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
$sVersion = file_get_contents(dirname(__FILE__) . '/../../../../version.txt');
return $this->render('SlashworksAppBundle:About:about.html.twig', array("license" => $oLicense, "version" => $sVersion, "iniPath" => $iniPath, "requirements" => $aRequirements, "recommendations" => $aRecommendations, "failedrequirements" => $aFailedRequirements, "failedrecommendations" => $aFailedRecommendations));
}
示例5: file
echo_style('warning', ' WARNING: No configuration file (php.ini) used by PHP!');
}
echo PHP_EOL . PHP_EOL;
echo '> Checking Symfony requirements:' . PHP_EOL . ' ';
$messages = array();
foreach ($symfonyRequirements->getRequirements() as $req) {
/** @var $req Requirement */
if ($helpText = get_error_message($req, $lineSize)) {
echo_style('red', 'E');
$messages['error'][] = $helpText;
} else {
echo_style('green', '.');
}
}
$checkPassed = empty($messages['error']);
foreach ($symfonyRequirements->getRecommendations() as $req) {
if ($helpText = get_error_message($req, $lineSize)) {
echo_style('yellow', 'W');
$messages['warning'][] = $helpText;
} else {
echo_style('green', '.');
}
}
if ($checkPassed) {
echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects');
} else {
echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects');
echo_title('Fix the following mandatory requirements', 'red');
foreach ($messages['error'] as $helpText) {
echo ' * ' . $helpText . PHP_EOL;
}
示例6: recommendationsAction
/**
* Check if system complies
*
* @return Response A Response instance
*/
public function recommendationsAction()
{
$symfonyRequirements = new \SymfonyRequirements();
$recommendations = $symfonyRequirements->getRecommendations();
return $this->render("JumphInstallerBundle:Install:recommendations.html.twig", array('recommendations' => $recommendations));
}
示例7: function
}
}, Silex\Application::EARLY_EVENT);
$app->get('/', function (Silex\Application $app) use($symfonyRequirements, $requirements) {
$app['bootstrap_service']->makeDirectoriesWritable();
$directories = $app['bootstrap_service']->checkDirectories();
if ($directories !== true) {
return $app['twig']->render('botstrap_errors.twig', array('directories' => $directories));
}
$checkPassed = true;
foreach ($requirements as $req) {
if (!$req->isFulfilled()) {
$checkPassed = false;
}
}
$warning = false;
foreach ($symfonyRequirements->getRecommendations() as $req) {
if (!$req->isFulfilled()) {
if ($req->isOptional()) {
$warning = true;
}
}
}
return $app['twig']->render('index.twig', array('requirements' => $requirements, 'recommendations' => $symfonyRequirements->getRecommendations(), 'checkPassed' => $checkPassed, 'NewscoopVersion' => new \CampVersion(), 'warning' => $warning));
})->assert('_method', 'GET')->bind('index');
$app->get('/license', function (Request $request) use($app) {
$form = $app['form.factory']->createNamedBuilder('license', 'form', array())->setAction($app['url_generator']->generate('license'))->add('accept_terms', 'checkbox', array('label' => 'I accept the license terms', 'required' => true, 'constraints' => array(new Assert\NotBlank()), 'error_bubbling' => true))->add('submit', 'submit', array('label' => "Next"))->getForm();
if ('POST' == $request->getMethod()) {
$form->bind($request);
if ($form->isValid()) {
return $app->redirect($app['url_generator']->generate('prepare'));
} else {