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


PHP sfProjectConfiguration::getEventDispatcher方法代码示例

本文整理汇总了PHP中sfProjectConfiguration::getEventDispatcher方法的典型用法代码示例。如果您正苦于以下问题:PHP sfProjectConfiguration::getEventDispatcher方法的具体用法?PHP sfProjectConfiguration::getEventDispatcher怎么用?PHP sfProjectConfiguration::getEventDispatcher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sfProjectConfiguration的用法示例。


在下文中一共展示了sfProjectConfiguration::getEventDispatcher方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor.
  * 
  * @param sfProjectConfiguration $configuration The project configuration
  * @param string                 $rootDir       The plugin root directory
  * @param string                 $name          The plugin name
  */
 public function __construct(sfProjectConfiguration $configuration, $rootDir = null, $name = null)
 {
     $this->configuration = $configuration;
     $this->dispatcher = $configuration->getEventDispatcher();
     $this->rootDir = null === $rootDir ? $this->guessRootDir() : realpath($rootDir);
     $this->name = null === $name ? $this->guessName() : $name;
     $this->setup();
     $this->configure();
     if (!$this->configuration instanceof sfApplicationConfiguration) {
         $this->initializeAutoload();
         $this->initialize();
     }
 }
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:20,代码来源:sfPluginConfiguration.class.php

示例2: initialize

 /**
  * @param sfProjectConfiguration $configuration
  * 
  * @return fpErrorNotifier
  */
 public static function initialize(sfProjectConfiguration $configuration)
 {
     if (empty(self::$instance)) {
         $configFiles = $configuration->getConfigPaths('config/notify.yml');
         $config = sfDefineEnvironmentConfigHandler::getConfiguration($configFiles);
         foreach ($config as $name => $value) {
             sfConfig::set("sf_notify_{$name}", $value);
         }
         self::$instance = new self($configuration->getEventDispatcher());
         self::getInstance()->handler()->initialize();
     }
     return self::$instance;
 }
开发者ID:66Ton99,项目名称:fpErrorNotifierPlugin,代码行数:18,代码来源:fpErrorNotifier.php

示例3: setup

{
    public function setup()
    {
        $this->enablePlugins('sfAutoloadPlugin');
    }
}
// ->guessRootDir() ->guessName()
$t->diag('->guessRootDir() ->guessName()');
$configuration = new sfProjectConfiguration($rootDir);
$pluginConfig = new sfAutoloadPluginConfiguration($configuration);
$t->is($pluginConfig->getRootDir(), $pluginRoot, '->guessRootDir() guesses plugin root directory');
$t->is($pluginConfig->getName(), 'sfAutoloadPlugin', '->guessName() guesses plugin name');
// ->filterTestFiles()
$t->diag('->filterTestFiles()');
// test:all
$task = new sfTestAllTask($configuration->getEventDispatcher(), new sfFormatter());
$event = new sfEvent($task, 'task.test.filter_test_files', array('arguments' => array(), 'options' => array()));
$files = $pluginConfig->filterTestFiles($event, array());
$t->is(count($files), 6, '->filterTestFiles() adds all plugin tests');
// test:functional
$task = new sfTestFunctionalTask($configuration->getEventDispatcher(), new sfFormatter());
$event = new sfEvent($task, 'task.test.filter_test_files', array('arguments' => array('controller' => array()), 'options' => array()));
$files = $pluginConfig->filterTestFiles($event, array());
$t->is(count($files), 3, '->filterTestFiles() adds functional plugin tests');
$task = new sfTestFunctionalTask($configuration->getEventDispatcher(), new sfFormatter());
$event = new sfEvent($task, 'task.test.filter_test_files', array('arguments' => array('controller' => array('BarFunctional')), 'options' => array()));
$files = $pluginConfig->filterTestFiles($event, array());
$t->is(count($files), 1, '->filterTestFiles() adds functional plugin tests when a controller is specified');
$task = new sfTestFunctionalTask($configuration->getEventDispatcher(), new sfFormatter());
$event = new sfEvent($task, 'task.test.filter_test_files', array('arguments' => array('controller' => array('nested/NestedFunctional')), 'options' => array()));
$files = $pluginConfig->filterTestFiles($event, array());
开发者ID:sensorsix,项目名称:app,代码行数:31,代码来源:sfPluginConfigurationTest.php

示例4: __construct

 /**
  * Constructor.
  * 
  * @see sfTask
  */
 public function __construct(sfProjectConfiguration $configuration, sfFormatter $formatter)
 {
     parent::__construct($configuration->getEventDispatcher(), $formatter);
     $this->configuration = $configuration;
     $this->pluginConfiguration = $configuration->getPluginConfiguration('sfTaskExtraPlugin');
 }
开发者ID:jmiridis,项目名称:atcsf1,代码行数:11,代码来源:sfTaskExtraAddon.class.php

示例5: __construct

 /**
  *
  * @param sfProjectConfiguration $cfg
  */
 public function __construct(sfProjectConfiguration $cfg)
 {
     $this->dispatcher = $cfg->getEventDispatcher();
     $this->configuration = $cfg;
 }
开发者ID:hglattergotz,项目名称:sfTSchedDoctrinePlugin,代码行数:9,代码来源:TaskSchedulerApi.class.php


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