Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Configuration in 3.0
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mark_story  
View profile  
 More options Aug 22 2012, 4:18 pm
From: mark_story <mark.st...@gmail.com>
Date: Wed, 22 Aug 2012 13:18:38 -0700 (PDT)
Local: Wed, Aug 22 2012 4:18 pm
Subject: Configuration in 3.0

A while back I started a prototype to re-work cakephp application
bootstrapping.  I had a few goals in mind:

* Remove the magic and still use conventions.
* Integrate composer, and update autoloading.
* Unify configuration and have *one* way to configure everything.

The last point raised a bit of contention as josé and I initially
disagreed.  I've come think that josé was right though, but wanted to see
if anyone had suggestions on how things could be made even better.  So far
I have two possible ways configuration could be handled at:

https://github.com/markstory/cakephp/wiki/Unify-configuration

I've also got the in-progress branch here
https://github.com/markstory/cakephp/compare/3.0...3.0-bootstrap

-Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Juan Basso  
View profile   Translate to Translated (View Original)
 More options Aug 23 2012, 9:03 pm
From: Juan Basso <jrba...@gmail.com>
Date: Thu, 23 Aug 2012 21:03:36 -0400
Local: Thurs, Aug 23 2012 9:03 pm
Subject: Re: Configuration in 3.0

Why not both? The class will be responsible to parse the configuration and
use the configuration, the Configure can be a "temporary" place to store
the configuration. So, when the class need the configuration and it is not
set, the class tries to load from Configure.

That way people can configure the class directly or thru Configure. Also,
make the classes more independent.

Speaking in PHP, will can have a trait doing something like that:
function config($config = 'default') {
  if (!isset(static::$_config[$config])) {
    static::create($config, Configure::read('ClassName.' . $config));
  }
  return isset(static::$_config[$config]) ? static::$_config[$config] ?
null;

}

It means that if you want to create directly to the class or use Configure,
it will be a developer decision. By default I guess we should go with
Configure.

Juan Basso


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mark_story  
View profile   Translate to Translated (View Original)
 More options Aug 23 2012, 10:40 pm
From: mark_story <mark.st...@gmail.com>
Date: Thu, 23 Aug 2012 19:40:17 -0700 (PDT)
Local: Thurs, Aug 23 2012 10:40 pm
Subject: Re: Configuration in 3.0

My argument against both is it feels like an un-opinionated way to do
things.  Generally CakePHP has opinions on how your code should be
structured, how you should name classes, tables and columns.  It feels like
this should be another one of those things the framework has an opinion
on.  Providing two ways to do the same thing feels wrong to me.  It means
double the documentation, double the learning, and makes integrating
plugins more painful, as some will use one way, and others the other way.  
Only having one way gives people direction and hopefully steers them down
the one true path.

-Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ADmad  
View profile  
 More options Aug 29 2012, 3:28 pm
From: ADmad <admad.co...@gmail.com>
Date: Wed, 29 Aug 2012 12:28:05 -0700 (PDT)
Local: Wed, Aug 29 2012 3:28 pm
Subject: Re: Configuration in 3.0

I too am not a fan of having 2 ways to achieve the same thing.

Yet I am unable to pick a clear personal preference from the two proposals
provided. On a related note I feel cake is missing an Environment class of
some kind. An easy way to configure email, db etc. based on your different
environments dev, staging, production etc. For this a unified configurator
as described in Proposal 2 would surely make things simpler.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mark_story  
View profile  
 More options Aug 31 2012, 5:20 am
From: mark_story <mark.st...@gmail.com>
Date: Fri, 31 Aug 2012 02:20:52 -0700 (PDT)
Local: Fri, Aug 31 2012 5:20 am
Subject: Re: Configuration in 3.0

I had a decent talk with both José's last night about this and I think we
both agreed that proposal 2 has the best chance of being good in the long
term.

* It gives one simple API for all configuration.
* There is one convention for everything. Keeping true to the conventions
over configuration.
* Its easy for plugin authors to use, and easy for app's to configure
plugins from.
* It offers the simplest path for loading configuration from static files,
or non-static sources e.g feature switches loaded from Redis.

It has a few architectural drawback:

* Dependency information is *pulled* out of Configure and
constructed/handled in each adapter based class.  Interestingly enough this
is similar to how all existing adapter classes work.  We never pass
instances in when creating cache/logging setups.  But instead pass
classnames + constructor parameters.
* The various adapter based classes will continue to need a drop() style
method to remove the existing adapter instance when configuration is
changed.

With enough of a decision reached, I'm going to continue working on the
configuration changes post cakefest.

-Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mark_story  
View profile  
 More options Sep 19 2012, 9:57 pm
From: mark_story <mark.st...@gmail.com>
Date: Wed, 19 Sep 2012 18:57:04 -0700 (PDT)
Local: Wed, Sep 19 2012 9:57 pm
Subject: Re: Configuration in 3.0

I've got many of the configuration related changes complete, and a pull
request open for further discussion.

https://github.com/cakephp/cakephp/pull/860

-Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William Golden  
View profile  
 More options Sep 19 2012, 10:40 pm
From: William Golden <egdelw...@gmail.com>
Date: Wed, 19 Sep 2012 21:40:03 -0500
Local: Wed, Sep 19 2012 10:40 pm
Subject: Re: Configuration in 3.0

Looks great Mark. Thanks for your hard work on this.

William Golden
http://codebomber.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »