2008年11月5日星期三

Re: [fw-core] Zend_Config_Ini with variable expansion

-- wizhippo <wizhippo@gmail.com> wrote
(on Wednesday, 05 November 2008, 07:16 AM -0800):
> I have liked other platforms were in the ini file you can do something like
>
> [globla]
> rootDir=/tmp
> configDir=${rootDir}/etc
>
> and have the ${variable} expanded.
>
> so my solution was to extend Zend_Config_Ini to support this.
> I also added the ability to pass an array to Zend_Config_Ini just like ot
> can to Zend_Config so the application can pass initial parameters that may
> be needed in the ini file to be used to expand variables.

<snip - implementation>

> then in my ini file i can do stuff like
>
> [global]
> a = 1
> b = 2
>
> c.a = 1
> c.b = 1
>
> d.a = ${a}/foo
> d.b = ${c.a}/bar
>
> Should this be something I submit to the proposals or it's not interseting
> enough?

Yes, please submit a proposal; I think many people would like to see
this. Currently, you *can* use constants as part of the INI value, but
that's it; variable support would be very useful.

That said... if you *do* submit a proposal, I'd like to see similar
functionality for Zend_Config_Xml. :)

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: