Changeset 8291
- Timestamp:
- 04/04/08 16:41:43 (3 months ago)
- Files:
-
- doc/branches/1.1/book/06-Inside-the-Controller-Layer.txt (modified) (1 diff)
- doc/branches/1.1/book/18-Performance.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.1/book/06-Inside-the-Controller-Layer.txt
r8289 r8291 96 96 [php] 97 97 <?php 98 99 define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/..')); 100 define('SF_APP', 'frontend'); 101 define('SF_ENVIRONMENT', 'prod'); 102 define('SF_DEBUG', false); 103 104 require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); 98 require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php'); 99 $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true); 100 sfContext::createInstance($configuration); 105 101 106 102 // add code here 107 103 108 You can see that the only missing line is the call to the `dispatch()` method of the sfController object, which can be used only with a web server, not in a batch process. Defining an application and an environment gives you access to a specific configuration. Including the application `config.php` initiates the context and the autoloading.104 You can see that the only missing line is the call to the `dispatch()` method of the sfController object, which can be used only with a web server, not in a batch process. Defining an application and an environment gives you access to a specific configuration. Including the project configuration class initiates the context and the autoloading. Creating a context instance based on an application configuration class initializes all the symfony core objects and populates the `sfConfig` registry with the values from a given application and environment. 109 105 110 106 Actions doc/branches/1.1/book/18-Performance.txt
r8283 r8291 430 430 431 431 [php] 432 <?php 433 434 define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/..')); 435 define('SF_APP', 'frontend'); 436 define('SF_ENVIRONMENT', 'staging'); 437 define('SF_DEBUG', false); 438 439 require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); 432 require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php'); 433 $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'staging', false); 434 sfContext::createInstance($configuration); 440 435 441 436 // Array of URLs to browse