| | 272 | `->initialize()` methods |
|---|
| | 273 | ------------------------ |
|---|
| | 274 | |
|---|
| | 275 | Most symfony core classes are initialized thanks to a `->initialize()` method. As of symfony 1.1, |
|---|
| | 276 | this method is automatically called by `__construct()`, so, there is no need to call it by yourself. |
|---|
| | 277 | |
|---|
| | 278 | Configuration files loading |
|---|
| | 279 | --------------------------- |
|---|
| | 280 | |
|---|
| | 281 | Some core classes can be configured with a `.yml` file: |
|---|
| | 282 | |
|---|
| | 283 | || '''Class''' || '''Configuration file''' || |
|---|
| | 284 | || || || |
|---|
| | 285 | || `sfAction` || `security.yml` || |
|---|
| | 286 | || `sfAutoload` || `autoload.yml` || |
|---|
| | 287 | || `sfConfigCache` || `config_handlers.yml` || |
|---|
| | 288 | || `sfContext` || `factories.yml` || |
|---|
| | 289 | || `sfController` || `generator.yml` and `module.yml` || |
|---|
| | 290 | || `sfDatabaseManager` || `databases.yml` || |
|---|
| | 291 | || `sfFilterChain` || `filters.yml` || |
|---|
| | 292 | || `sfI18N` || `i18n.yml` || |
|---|
| | 293 | || `sfPatternRouting` || `routing.yml` || |
|---|
| | 294 | || `sfPHPView` || `view.yml` || |
|---|
| | 295 | || `sfViewCacheManager` || `cache.yml` || |
|---|
| | 296 | |
|---|
| | 297 | In symfony 1.1, the loading of the configuration file for ''independant'' sub-frameworks has been |
|---|
| | 298 | moved to a `loadConfiguration()` method to ease decoupling and reuse them without needing the whole framework: |
|---|
| | 299 | |
|---|
| | 300 | * `sfDatabaseManager` |
|---|
| | 301 | * `sfI18N` |
|---|
| | 302 | * `sfPatternRouting` |
|---|
| | 303 | |
|---|
| | 304 | So, for example, if you need a database manager in your batch script, you will have to change from: |
|---|
| | 305 | |
|---|
| | 306 | [php] |
|---|
| | 307 | $databaseManager = new sfDatabaseManager(); |
|---|
| | 308 | $databaseManager->initialize(); |
|---|
| | 309 | |
|---|
| | 310 | to: |
|---|
| | 311 | |
|---|
| | 312 | [php] |
|---|
| | 313 | $databaseManager = new sfDatabaseManager(); |
|---|
| | 314 | $databaseManager->loadConfiguration(); |
|---|
| | 315 | |
|---|
| | 316 | The `initialize()` call is not needed anymore (see the point above). |
|---|