logo       

[symfony-users] Re: How do I create a plugin specific configuration file?: msg#00877

symfony-users

Subject: [symfony-users] Re: How do I create a plugin specific configuration file?

1 - define a config_handlers.yml on the plugin config dir with something like:

config/json_services.yml:
  class:    sfDefineEnvironmentConfigHandler
  param:
    prefix: json_services_

This will register sfDefineEnvironmentConfigHandler as the handler for the json_services.yml files. It also define the prefix to be prepended to the vars. If any such yml is found the corresponding php will be generated, but the values wont be appended to the sfConfig array.

2 So you have to include it using:

include($this->getConfigCache()->checkConfig('config/json_services.yml'));

on the plugin´s config.php file.

And that is it! it will work with any json_services.yml defined. Very nice.

2009/7/30 Bruno Reis <bruno.p.reis@xxxxxxxxx>
Thanks Daniel,

but, if I do that, the config will be packed with the plugin, commited to svn, etc.. I need application specific code in a way I do not need to touch the plugin files. I found something on the end of: http://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Configuration-Files. If I have success I will post it here.

2009/7/30 Richtermeister <nexyz9@xxxxxxxxx>


Hey Bruno,

just include a /yourplugin/config/app.yml file that contains your
settings.
This file will be included in the configuration automatically.

Daniel


On Jul 30, 10:16 am, Bruno Reis <bruno.p.r...@xxxxxxxxx> wrote:
> Thanks Eno, but that does not shows what I am looking for. It explains the
> configurations and yaml reading process, but I need to register a custom
> handler to use in a plugin.
>
> 2009/7/30 Eno <symb...@xxxxxxxxx>
>
>
>
> > On Thu, 30 Jul 2009, Bruno Reis wrote:
>
> > > I have a plugin that needs to be configurated with a yml config file. How
> > do
> > > I register this configuration file so that I can read the values with
> > > sfConfig::get?
> > > And what is the appropriate place to put this file? config/pluginName ?
>
> >http://www.symfony-project.org/book/1_2/05-Configuring-Symfony#chapte...
>
> > > Is there a way to auto-generate this file on plugin instalation?
>
> > Maybe you can override the plugin:publish-assets task?
>
> > --




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "symfony users" group.
To post to this group, send email to symfony-users@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to symfony-users+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Google Custom Search

News | Mail Home | sitemap | FAQ | advertise