本文整理汇总了PHP中sfProjectConfiguration::hasActive方法的典型用法代码示例。如果您正苦于以下问题:PHP sfProjectConfiguration::hasActive方法的具体用法?PHP sfProjectConfiguration::hasActive怎么用?PHP sfProjectConfiguration::hasActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfProjectConfiguration
的用法示例。
在下文中一共展示了sfProjectConfiguration::hasActive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
/**
* Check if custom sfConfig params are loaded. If not, load them.
* @param PropelPDO $con
*/
public static function check($con = null)
{
if (!self::is_set() && self::is_ready()) {
if (!$con && !sfProjectConfiguration::hasActive()) {
throw new Exception('The Project configuration is not loaded.');
} elseif (!$con) {
$configuration = sfProjectConfiguration::getActive();
$databaseManager = new sfDatabaseManager($configuration);
$con = $databaseManager->getDatabase(sfConfig::get('sf_orm'))->getConnection();
$init = $databaseManager->initialize($configuration);
}
try {
$config = sfPlopConfigPeer::retrieveAll($con);
foreach ($config as $obj) {
sfConfig::set(self::prefix() . $obj->getName(), sfPlopConfigPeer::load($obj->getValue()));
}
sfConfig::set(self::prefix(''), true);
} catch (Exception $e) {
return false;
}
}
}
示例2: postSave
/**
* Post save to attempt to clear the menu cache.
*
* If using different cache driver between multiple applications, this
* will only clear the cache for the current application.
*
* @return void
*/
public function postSave($event)
{
if (sfProjectConfiguration::hasActive()) {
sfProjectConfiguration::getActive()->getPluginConfiguration('ioDoctrineMenuPlugin')->getMenuManager()->clearCache($this);
}
}