You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-dev@incubator.apache.org by James Pic <ja...@gmail.com> on 2010/08/11 08:33:54 UTC
Re: [zeta-dev] Configuration component proposal with override
mechanism
Congrats for writing yet another implementation of configuration override ;)
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.
Regards
James
--
http://jamespic.com/contact
Customer is king - Le client est roi - El cliente es rey.
Re: [zeta-dev] Configuration component proposal with override
mechanism
Posted by Maxime Thomas <ma...@gmail.com>.
:-D
2010/8/11 James Pic <ja...@gmail.com>
> 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 <ja...@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 <ja...@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 <ja...@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.
> >>
>
Re: [zeta-dev] Configuration component proposal with override
mechanism
Posted by James Pic <ja...@gmail.com>.
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 <ja...@gmail.com>
>
>> On Wed, Aug 11, 2010 at 11:02 AM, Jerome Renard <je...@gmail.com>
>> wrote:
>> > James,
>> >
>> > On Wed, Aug 11, 2010 at 10:50 AM, James Pic <ja...@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 <ja...@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.
>>
Re: [zeta-dev] Configuration component proposal with override
mechanism
Posted by Maxime Thomas <ma...@gmail.com>.
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 <ja...@gmail.com>
> On Wed, Aug 11, 2010 at 11:02 AM, Jerome Renard <je...@gmail.com>
> wrote:
> > James,
> >
> > On Wed, Aug 11, 2010 at 10:50 AM, James Pic <ja...@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 <ja...@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.
>
Re: [zeta-dev] Configuration component proposal with override
mechanism
Posted by James Pic <ja...@gmail.com>.
On Wed, Aug 11, 2010 at 11:02 AM, Jerome Renard <je...@gmail.com> wrote:
> James,
>
> On Wed, Aug 11, 2010 at 10:50 AM, James Pic <ja...@gmail.com> wrote:
>
>> On Wed, Aug 11, 2010 at 10:40 AM, Jerome Renard <je...@gmail.com>
>> wrote:
>> > Hi James,
>> >
>> > On Wed, Aug 11, 2010 at 10:33 AM, James Pic <ja...@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.
Re: [zeta-dev] Configuration component proposal with override
mechanism
Posted by Jerome Renard <je...@gmail.com>.
James,
On Wed, Aug 11, 2010 at 10:50 AM, James Pic <ja...@gmail.com> wrote:
> On Wed, Aug 11, 2010 at 10:40 AM, Jerome Renard <je...@gmail.com>
> wrote:
> > Hi James,
> >
> > On Wed, Aug 11, 2010 at 10:33 AM, James Pic <ja...@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 :)
Cheers,
--
Jérôme Renard
http://39web.fr | http://jrenard.info
Re: [zeta-dev] Configuration component proposal with override
mechanism
Posted by James Pic <ja...@gmail.com>.
On Wed, Aug 11, 2010 at 10:40 AM, Jerome Renard <je...@gmail.com> wrote:
> Hi James,
>
> On Wed, Aug 11, 2010 at 10:33 AM, James Pic <ja...@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:
[sec]
bar=X
foo=Y
Inheritance allows to write:
[sec2..sec]
foo=Z
Instead of:
[sec2]
bar=X
foo=Z
--
http://jamespic.com/contact
Customer is king - Le client est roi - El cliente es rey.
Re: [zeta-dev] Configuration component proposal with override
mechanism
Posted by Jerome Renard <je...@gmail.com>.
Hi James,
On Wed, Aug 11, 2010 at 10:33 AM, James Pic <ja...@gmail.com> wrote:
> Congrats for writing yet another implementation of configuration override
> ;)
>
Lol I was not aware you did that ;)
>
> 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.
Cheers,
--
Jérôme Renard
http://39web.fr | http://jrenard.info