incubator-zeta-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Pic <james...@gmail.com>
Subject Re: [zeta-dev] Configuration component proposal with override mechanism
Date Wed, 11 Aug 2010 17:18:02 GMT
Licensed under WTFPL. Enjoy ;)
> Hi,
>
> Good job !
>
> @jerome.r : of course we do need that. However, why not extend the current
> Configuration ? Honestly I thought that Configuration did the same that
> what's in eZP. Disappointed.
>
> @jame.p : Is there a license on this piece of code ?
>
> I can also see another use : for example, when you install a product,
> instead of replacing standard empty settings, you just have to override it
/
> make it inherit...
>
> Max
>
>
>
> 2010/8/11 James Pic <jamespic@gmail.com>
>
>> On Wed, Aug 11, 2010 at 11:02 AM, Jerome Renard <jerome.renard@gmail.com>
>> wrote:
>> > James,
>> >
>> > On Wed, Aug 11, 2010 at 10:50 AM, James Pic <jamespic@gmail.com> wrote:
>> >
>> >> On Wed, Aug 11, 2010 at 10:40 AM, Jerome Renard <
>> jerome.renard@gmail.com>
>> >> wrote:
>> >> > Hi James,
>> >> >
>> >> > On Wed, Aug 11, 2010 at 10:33 AM, James Pic <jamespic@gmail.com>
>> wrote:
>> >> >
>> >> >> Congrats for writing yet another implementation of configuration
>> >> override
>> >> >> ;)
>> >> >>
>> >> >
>> >> > Lol I was not aware you did that ;)
>> >> >
>> >>
>> >> I know ;)
>> >>
>> >> Actually that happens quite frequently :P
>> >>
>> >> Another cool thing would be to allow multiline values, although that
>> >> could cause some minor BC breaks :S
>> >>
>> >> >
>> >> >>
>> >> >> Another cool feature is configuration section inheritance, maybe
you
>> >> >> want to implement that as well. It's actually pretty simple, i'll
>> post
>> >> >> my implementation if you want.
>> >> >>
>> >> >
>> >> > Configuration directive inheritance is already implement AFAIR :)
>> >> > But reading your implement can be interesting anways, maybe there is
>> >> > a lot of good stuff in there.
>> >> >
>> >>
>> >> It's pretty trivial (sources attached), consider this example section:
>> >>
>> >>
>> > I did not get anything attached.
>> >
>> >
>> >> [sec]
>> >> bar=X
>> >> foo=Y
>> >>
>> >> Inheritance allows to write:
>> >>
>> >> [sec2..sec]
>> >> foo=Z
>> >>
>> >> Instead of:
>> >>
>> >> [sec2]
>> >> bar=X
>> >> foo=Z
>> >>
>> >>
>> > In the component I proposed it does not work that way actually.
>> >
>> > AFAIR everything inherits from the "prod" context, and you can override
>> > configuration values for staging and dev if you want.
>> > If you add configuration directive in a particular block it will be
taken
>> > into account as well.
>> > Have a look at the test suite to see all use cases :)
>>
>> Yes, that we have as well, although our implementation is more "dumb"
>> and self contained in one class.
>>
>> In my case i use the section level configuration to reuse the same
>> controler/action with /slightly/ different configurations to produce
>> more pages with less work, or even with forms configurations.
>>
>> There goes the sources: http://gist.github.com/518721
>>
>> --
>> http://jamespic.com/contact
>> Customer is king - Le client est roi - El cliente es rey.
>>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message