logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Zend_Config multiple sources: msg#00047

Subject: Zend_Config multiple sources
Hi,

I would like to be able to take configuration data form multiple source and
combine them in to one single config object. I have read through the zend
docs and the incubator docs and have not seen a way to do this with the
current Zend_config implementation.

Example Use case:

One product to be used by many clients, parts of configuration needs to be
easly client configurable and the other parts of the config should be setup
on there behalf.

So the client configurable would be stored in a db table which would have an
interface for the client to change the values, and a Zend_Config class
'Zend_Config_DB' would be made to load these values.

The other configuration would come from a xml file.

Proposed Changes:

As I see it this would require a structure change, as the storage types
would have to be separated from the Zend_Config object.

Zend_Config
 |
 |--- Zend_Config_Storage
 |     |
 |     |--- Zend_Config_Storage_Interface
 |     |--- Zend_Config_Storage_Array
 |     |--- Zend_Config_Storage_XML
 |     |--- Zend_Config_Storage_INI
 |     |--- Zend_Config_Storage_DB

//The interface for a storage object
interface Zend_Config_Storage_Interface 
{
   //load the data, taken the setp of loading the data out of the
constructor
   public function load( $sections=null );

   //return boolean
   public function hasSections( $sections );
}

//New methods
class ZendConfig 
{
   //Add a storage object
   public function addStorage( Zend_Config_Storage_Interface &$storage)
   {
      //save the storage object for use for later
   }

   //Call this just in time e.g. before a __get __set __isset
   public function _load()
   {
      //Load only once, call all 'load' on storage objects
   }
}

The benefit of this structure is that it would allow the use of different
config sources included the use of the more than one source of the same
type.
-- 
View this message in context: 
http://www.nabble.com/Zend_Config-multiple-sources-tf3034358s16154.html#a8431354
Sent from the Zend Core mailing list archive at Nabble.com.




Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe