Development

Changeset 7696

You must first sign up to be able to contribute.

Changeset 7696

Show
Ignore:
Timestamp:
02/29/08 21:36:29 (8 months ago)
Author:
fabien
Message:

refactored sfApplicationConfiguration to allow hooks at the beginning and at the end of the initialization process

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/config/sfApplicationConfiguration.class.php

    r7694 r7696  
    3434  public function __construct($environment, $debug, $rootDir = null) 
    3535  { 
    36     $this->initialize($environment, $debug); 
    37  
    38     parent::__construct($rootDir); 
    39  
    40     $this->configure(); 
    41  
    42     if (sfConfig::get('sf_check_lock')) 
    43     { 
    44       $this->checkLock(); 
    45     } 
    46  
    47     if (sfConfig::get('sf_check_symfony_version')) 
    48     { 
    49       $this->checkSymfonyVersion(); 
    50     } 
    51   } 
    52  
    53   /** 
    54    * Initializes the current configuration. 
    55    * 
    56    * @param string  The environment name 
    57    * @param Boolean true to enable debug mode 
    58    */ 
    59   public function initialize($environment, $debug) 
    60   { 
    6136    $this->environment = $environment; 
    6237    $this->debug       = (boolean) $debug; 
    6338    $this->application = str_replace('Configuration', '', get_class($this)); 
     39 
     40    parent::__construct($rootDir); 
     41 
     42    $this->configure(); 
     43 
     44    $this->initConfiguration(); 
     45 
     46    if (sfConfig::get('sf_check_lock')) 
     47    { 
     48      $this->checkLock(); 
     49    } 
     50 
     51    if (sfConfig::get('sf_check_symfony_version')) 
     52    { 
     53      $this->checkSymfonyVersion(); 
     54    } 
     55 
     56    $this->initialize(); 
    6457  } 
    6558 
     
    7063   */ 
    7164  public function configure() 
     65  { 
     66  } 
     67 
     68  /** 
     69   * Initialized the current configuration. 
     70   * 
     71   * Override this method if you want to customize your application initialization. 
     72   */ 
     73  public function initialize() 
    7274  { 
    7375  } 
     
    9597  public function initConfiguration() 
    9698  { 
    97     parent::initConfiguration(); 
    98  
    9999    // in debug mode, start global timer 
    100100    if ($this->isDebug()) 
  • branches/1.1/lib/config/sfProjectConfiguration.class.php

    r7691 r7696  
    5252    $this->dispatcher = new sfEventDispatcher(); 
    5353 
    54     $this->initConfiguration(); 
    55  
    56     $this->setup(); 
    57   } 
    58  
    59   /** 
    60    * Setups the current configuration. 
    61    * 
    62    * Override this method if you want to customize your project configuration. 
    63    */ 
    64   public function setup() 
    65   { 
    66   } 
    67  
    68   public function initConfiguration() 
    69   { 
    7054    ini_set('magic_quotes_runtime', 'off'); 
    7155    ini_set('register_globals', 'off'); 
     
    7458 
    7559    $this->setRootDir($this->rootDir); 
     60 
     61    $this->setup(); 
     62  } 
     63 
     64  /** 
     65   * Setups the current configuration. 
     66   * 
     67   * Override this method if you want to customize your project configuration. 
     68   */ 
     69  public function setup() 
     70  { 
    7671  } 
    7772