当前位置: 首页>>代码示例>>PHP>>正文


PHP ProjectConfiguration::getEventDispatcher方法代码示例

本文整理汇总了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'));
 }
开发者ID:sympal,项目名称:sympal,代码行数:15,代码来源:sfSympalConfiguration.class.php

示例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);
 }
开发者ID:slemoigne,项目名称:sympal,代码行数:16,代码来源:sfSympalConfiguration.class.php

示例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()');
开发者ID:remialvado,项目名称:ysfDimensionPlugin,代码行数:31,代码来源:ysfConfigDimensionTest.php


注:本文中的ProjectConfiguration::getEventDispatcher方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。