當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。