本文整理汇总了PHP中SymfonyRequirements::addRequirement方法的典型用法代码示例。如果您正苦于以下问题:PHP SymfonyRequirements::addRequirement方法的具体用法?PHP SymfonyRequirements::addRequirement怎么用?PHP SymfonyRequirements::addRequirement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymfonyRequirements
的用法示例。
在下文中一共展示了SymfonyRequirements::addRequirement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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));
}
示例2: 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));
}