Changeset 8290
- Timestamp:
- 04/04/08 16:38:37 (1 year ago)
- Files:
-
- branches/1.1/lib/config/sfApplicationConfiguration.class.php (modified) (2 diffs)
- branches/1.1/lib/config/sfProjectConfiguration.class.php (modified) (5 diffs)
- branches/1.1/lib/plugins/sfPropelPlugin/test/bootstrap/functional.php (modified) (4 diffs)
- branches/1.1/lib/task/sfBaseTask.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/config/sfApplicationConfiguration.class.php
r8274 r8290 28 28 * Constructor. 29 29 * 30 * @param string The environment name 31 * @param Boolean true to enable debug mode 32 * @param string The project root directory 33 */ 34 public function __construct($environment, $debug, $rootDir = null) 30 * @param string The environment name 31 * @param Boolean true to enable debug mode 32 * @param string The project root directory 33 * @param sfEventDispatcher An event dispatcher 34 */ 35 public function __construct($environment, $debug, $rootDir = null, sfEventDispatcher $dispatcher = null) 35 36 { 36 37 $this->environment = $environment; … … 38 39 $this->application = str_replace('Configuration', '', get_class($this)); 39 40 40 parent::__construct($rootDir );41 parent::__construct($rootDir, $dispatcher); 41 42 42 43 $this->configure(); branches/1.1/lib/config/sfProjectConfiguration.class.php
r7962 r8290 29 29 * Constructor. 30 30 */ 31 public function __construct($rootDir = null )31 public function __construct($rootDir = null, sfEventDispatcher $dispatcher = null) 32 32 { 33 33 sfProjectConfiguration::$active = $this; 34 35 34 $this->rootDir = is_null($rootDir) ? self::guessRootDir() : realpath($rootDir); 36 35 … … 41 40 sfCoreAutoload::register(); 42 41 43 $this->dispatcher = new sfEventDispatcher();42 $this->dispatcher = is_null($dispatcher) ? new sfEventDispatcher() : $dispatcher; 44 43 45 44 ini_set('magic_quotes_runtime', 'off'); … … 264 263 * Returns a sfApplicationConfiguration configuration for a given application. 265 264 * 266 * @param string An application name 267 * @param string The environment name 268 * @param Boolean true to enable debug mode 269 * @param string The project root directory 265 * @param string An application name 266 * @param string The environment name 267 * @param Boolean true to enable debug mode 268 * @param string The project root directory 269 * @param sfEventDispatcher An event dispatcher 270 270 * 271 271 * @return sfApplicationConfiguration A sfApplicationConfiguration instance 272 272 */ 273 static public function getApplicationConfiguration($application, $environment, $debug, $rootDir = null )273 static public function getApplicationConfiguration($application, $environment, $debug, $rootDir = null, sfEventDispatcher $dispatcher = null) 274 274 { 275 275 $class = $application.'Configuration'; … … 278 278 { 279 279 // force initialization of sf_apps_dir config setting 280 new ProjectConfiguration( );280 new ProjectConfiguration(null, $dispatcher); 281 281 } 282 282 … … 288 288 } 289 289 290 return new $class($environment, $debug, $rootDir );290 return new $class($environment, $debug, $rootDir, $dispatcher); 291 291 } 292 292 } branches/1.1/lib/plugins/sfPropelPlugin/test/bootstrap/functional.php
r7962 r8290 23 23 $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true); 24 24 sfContext::createInstance($configuration); 25 $dispatcher = $configuration->getEventDispatcher(); 25 26 26 27 // remove all cache … … 40 41 { 41 42 chdir(sfConfig::get('sf_root_dir')); 42 $task = new sfPropelBuildModelTask( new sfEventDispatcher(), new sfFormatter());43 $task = new sfPropelBuildModelTask($dispatcher, new sfFormatter()); 43 44 ob_start(); 44 45 $task->run(); … … 50 51 { 51 52 chdir(sfConfig::get('sf_root_dir')); 52 $task = new sfPropelBuildSqlTask( new sfEventDispatcher(), new sfFormatter());53 $task = new sfPropelBuildSqlTask($dispatcher, new sfFormatter()); 53 54 ob_start(); 54 55 $task->run(); … … 60 61 { 61 62 chdir(sfConfig::get('sf_root_dir')); 62 $task = new sfPropelBuildFormsTask( new sfEventDispatcher(), new sfFormatter());63 $task = new sfPropelBuildFormsTask($dispatcher, new sfFormatter()); 63 64 $task->run(); 64 65 } branches/1.1/lib/task/sfBaseTask.class.php
r7962 r8290 37 37 38 38 require_once sfConfig::get('sf_config_dir').'/ProjectConfiguration.class.php'; 39 $this->configuration = ProjectConfiguration::getApplicationConfiguration($application, 'test', true );39 $this->configuration = ProjectConfiguration::getApplicationConfiguration($application, 'test', true, null, $this->dispatcher); 40 40 } 41 41 else … … 44 44 { 45 45 require_once sfConfig::get('sf_config_dir').'/ProjectConfiguration.class.php'; 46 $this->configuration = new ProjectConfiguration( );46 $this->configuration = new ProjectConfiguration(null, $this->dispatcher); 47 47 } 48 48 else 49 49 { 50 $this->configuration = new sfProjectConfiguration(getcwd() );50 $this->configuration = new sfProjectConfiguration(getcwd(), $this->dispatcher); 51 51 } 52 52 }

