Hi,
custom config handlers are not parsed automatically.
You have to include this config somewhere first.
I just tested it and added this in an action:
---
public function preExecute()
{
include(sfContext::getInstance()->getConfigCache()-
>checkConfig('config/my.yml'));
}
---
Afterwards your custom configs are available. Maybe you should move
this code in an custom filter, to have it available in every action.
- Frank
Am 29.05.2009 um 12:16 schrieb [email protected]:
>
> Hi
>
> Our project has some machine specific configuration that should not be
> kept in the app.yml (since we want to keep the app.yml under svn
> control), but in a second config file, let's call it my.yml.
> The values from my.yml should be available via sfConfig - just like
> values in app.yml. my.yml will be ignored by svn, so we are able to
> keep different settings per machine.
>
> The paragraph "Using Existing Configuration Handlers" at [1] seem to
> perfectly match our desired scenario. So I created a file apps/
> frontend/config/config_handlers.yml with the following content:
>
> config/my.yml:
> class: sfDefineEnvironmentConfigHandler
> param:
> prefix: my_
>
> And the config file apps/frontend/config/my.yml with the following
> content:
>
> all:
> my_value: abc
>
>
> The config_handlers.yml seems to be correct, since this entry is
> created in the cache/frontend/dev/config/
> config_config_handlers.yml.php:
>
> $this->handlers['config/my.yml'] = new
> sfDefineEnvironmentConfigHandler
> (array (
> 'prefix' => 'my_',
> ));
>
>
> Now the problem is, the my.yml file seems to be ignored. No
> config_my.yml.php is created, much less are the values from my.yml
> accessible via sfConfig.
>
> PHP Version is 5.2.9
> Symfony is Version 1.2.7
>
>
> Any help would be appreciated
> Thanks in advance
> Elmar Athmer
>
>
>
> [1]
> http://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Configuration-Files#chapter_19_sub_adding_your_own_handler
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---