By the way, I agree with the additional root elements but having XML and INI merged is possible since merge is a Zend_Config functionality.
--
Loïc Frering
128, rue Marius Berliet
69008 Lyon
0 954 954 786
06 48 08 67 79
loic.frering@gmail.com
On Mon, Jan 11, 2010 at 6:27 PM, Hector Virgen <djvirgen@gmail.com> wrote:
I'm with you on multiple configs. However I'd prefer my configs to be independent instead of merged.For example, for navigation I prefer an XML config while for application.ini I prefer INI. I also don't want to add additional root elements (<resources><navigation>...) to my nav xml.I ended up creating my own navigation resource that accepted a config file and config section to use. This worked out well for me.Also, if you make a lot of routes, it would be nice to use a routes.ini (or routes.xml) instead of placing them all in application.ini.If the existing resources had support to load their options via an external config this would be great :)
--
Hector
On Mon, Jan 11, 2010 at 9:21 AM, Loïc Frering <loic.frering@gmail.com> wrote:Ok, that was the solutions I considered as this functionality does not seem to be implemented. I wanted to be sure I didn't missed something.Here is the solution I choose : extending Zend_Application to support an array of config file paths in constructor or a directory of config files using the merge method of Zend_Config as mentioned by Andreas.I think it could be interesting to create a Jira entry as this functionality could be really useful.Thanks for your responses.Loïc.
On Mon, Jan 11, 2010 at 4:33 PM, Jurian Sluiman <subscribe@juriansluiman.nl> wrote:
As far as I know there are three options you have:
1) Create your own navigation resource, overloading the zend navigation
resource. It supports an additional parameter (e.g. configPath) and is able to
load that config as its own Zend_Config instance
2) Extend Zend_Application to be able to pass an array of config files
3) Merge configs manually.
I use the third option for my multiple website application. Each website
(index.php) has it's own config file which is merged with the application's
config file. The merged instance is passed to the Zend_Application constructor.
--
Jurian Sluiman
CTO Soflomo V.O.F.
http://soflomo.com
On Monday 11 Jan 2010 16:19:13 Loïc Frering wrote:
> Hi,
>
> I would like to separate my application configuration into multiple ini
> files. It seems that it is not possible for now as Zend_Applicator only
> accepts a string path to a config file, a Zend_Config object or an array of
> options.
>
> Is this limitation known ? Maybe I missed something... I'd particularly
> like to separate my navigation resource configuration which is quite
> verbose from the rest of the configuration.
>
> If this functionality seems pertinent, I could create an Jira entry for
> that
>
> :)
>
> Regards.
--
Loïc Frering
128, rue Marius Berliet
69008 Lyon
0 954 954 786
06 48 08 67 79
loic.frering@gmail.com
没有评论:
发表评论