本文整理汇总了PHP中ProjectConfiguration::getEventDispatcher方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectConfiguration::getEventDispatcher方法的具体用法?PHP ProjectConfiguration::getEventDispatcher怎么用?PHP ProjectConfiguration::getEventDispatcher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectConfiguration
的用法示例。
在下文中一共展示了ProjectConfiguration::getEventDispatcher方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(ProjectConfiguration $projectConfiguration)
{
/*
* We disable Symfony autoload again feature because it is too slow in dev mode
* If you introduce a new class when using sympal you just must clear your
* cache manually
*/
sfAutoloadAgain::getInstance()->unregister();
$this->_projectConfiguration = $projectConfiguration;
$this->_dispatcher = $projectConfiguration->getEventDispatcher();
$this->_configureDoctrine();
// Listen to the sympal.load event to perform some context-dependent tasks
$this->_dispatcher->connect('sympal.load', array($this, 'bootstrapFromContext'));
$this->_dispatcher->connect('sympal.cache.prime', array($this, 'listenSympalCachePrime'));
}
示例2: __construct
public function __construct(ProjectConfiguration $projectConfiguration)
{
// We disable Symfony autoload again feature because it is too slow in dev mode
// If you introduce a new class when using sympal you just must clear your
// cache manually
sfAutoloadAgain::getInstance()->unregister();
$this->_projectConfiguration = $projectConfiguration;
$this->_dispatcher = $projectConfiguration->getEventDispatcher();
$this->_doctrineManager = Doctrine_Manager::getInstance();
$this->_initializeSymfonyConfig();
$this->_markClassesAsSafe();
$this->_configureSuperCache();
$this->_configureDoctrine();
new sfSympalContextLoadFactoriesListener($this->_dispatcher, $this);
new sfSympalTaskClearCacheListener($this->_dispatcher, $this);
}
示例3: realpath
*
* Copyright (c) 2007 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content in this file are licensed
* under the MIT open source license.
*
* For the full copyright and license information, please view the LICENSE.yahoo
* file that was distributed with this source code.
*/
$sf_symfony_lib_dir = '/Users/dustin/projects/symfony/branch/1.1/lib';
$sf_root_dir = realpath(dirname(__FILE__) . '/../../fixtures/project');
require_once $sf_root_dir . '/config/ProjectConfiguration.class.php';
$configuration = new ProjectConfiguration($sf_root_dir);
// load lime
require_once $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
$t = new lime_test(28, new lime_output_color());
$d = new ysfConfigDimension($configuration->getEventDispatcher(), new sfNoCache(), array('set_default' => true));
foreach (array('initialize', 'loadConfiguration', 'clean', 'check', 'set', 'get', 'getCascade', 'getName', 'getAllowed', 'getDefault', 'getCache') as $method) {
$t->can_ok($d, $method, sprintf('"%s" is a method of ysfConfigDimension', $method));
}
$t->diag('::initialize()');
$t->isa_ok($d->getCache(), true, 'dimension cache is a valid cache adapter');
$t->diag('::loadConfiguration()');
$t->is($d->getOption('set_default'), true, 'dimension configuration is loaded after initialization');
$t->is($d->get(), array('culture' => 'en', 'host' => 'sp1'), 'dimension is valid after initialization');
$t->is($d->getDefault(), array('culture' => 'en', 'host' => 'sp1'), 'default is valid after initialization');
$t->is($d->getAllowed(), array('culture' => array('en', 'fr', 'it', 'de'), 'skin' => array('corp', 'mybrand'), 'host' => array('sp1', 're4')), 'allowed is valid after initialization');
$t->is($d->getCascade(), array('en_sp1', 'en', 'sp1'), 'cascade is valid after initialization');
$t->diag('::clean()');
$t->is($d->clean(array('culture' => 'en', 'skin' => null, 'host' => null)), array('culture' => 'en'), 'removes keys with null values');
$t->is($d->clean(array('culture' => 'en', 'skin' => 'corp', 'host' => 'sp1')), array('culture' => 'en', 'skin' => 'corp', 'host' => 'sp1'), 'strtolower all values');
$t->diag('::check()');