本文整理匯總了PHP中sfProjectConfiguration::active方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfProjectConfiguration::active方法的具體用法?PHP sfProjectConfiguration::active怎麽用?PHP sfProjectConfiguration::active使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sfProjectConfiguration
的用法示例。
在下文中一共展示了sfProjectConfiguration::active方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor.
*
* @param string $rootDir The project root directory
* @param sfEventDispatcher $dispatcher The event dispatcher
*/
public function __construct($rootDir = null, sfEventDispatcher $dispatcher = null)
{
if (null === self::$active || $this instanceof sfApplicationConfiguration)
{
self::$active = $this;
}
$this->rootDir = null === $rootDir ? self::guessRootDir() : realpath($rootDir);
$this->symfonyLibDir = realpath(dirname(__FILE__).'/..');
$this->dispatcher = null === $dispatcher ? new sfEventDispatcher() : $dispatcher;
ini_set('magic_quotes_runtime', 'off');
sfConfig::set('sf_symfony_lib_dir', $this->symfonyLibDir);
$this->setRootDir($this->rootDir);
// provide forms the dispatcher
sfFormSymfony::setEventDispatcher($this->dispatcher);
$this->setup();
$this->loadPlugins();
$this->setupPlugins();
}
示例2: __construct
/**
* Constructor.
*
* @param string $rootDir The project root directory
* @param sfEventDispatcher $dispatcher The event dispatcher
*/
public function __construct($rootDir = null, sfEventDispatcher $dispatcher = null)
{
if (is_null(sfProjectConfiguration::$active) || $this instanceof sfApplicationConfiguration) {
sfProjectConfiguration::$active = $this;
}
$this->rootDir = is_null($rootDir) ? self::guessRootDir() : realpath($rootDir);
$this->symfonyLibDir = realpath(dirname(__FILE__) . '/..');
$this->dispatcher = is_null($dispatcher) ? new sfEventDispatcher() : $dispatcher;
ini_set('magic_quotes_runtime', 'off');
sfConfig::set('sf_symfony_lib_dir', $this->symfonyLibDir);
$this->setRootDir($this->rootDir);
$this->setup();
$this->loadPlugins();
}
示例3: __construct
/**
* Constructor.
*
* @param string $rootDir The project root directory
* @param sfEventDispatcher $dispatcher The event dispatcher
*/
public function __construct($rootDir = null, sfEventDispatcher $dispatcher = null)
{
if (is_null(sfProjectConfiguration::$active) || $this instanceof sfApplicationConfiguration) {
sfProjectConfiguration::$active = $this;
}
$this->rootDir = is_null($rootDir) ? self::guessRootDir() : realpath($rootDir);
$this->symfonyLibDir = realpath(dirname(__FILE__) . '/..');
// initializes autoloading for symfony core classes
require_once $this->symfonyLibDir . '/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();
$this->dispatcher = is_null($dispatcher) ? new sfEventDispatcher() : $dispatcher;
ini_set('magic_quotes_runtime', 'off');
ini_set('register_globals', 'off');
sfConfig::set('sf_symfony_lib_dir', $this->symfonyLibDir);
$this->setRootDir($this->rootDir);
$this->setup();
}