I don't think it's required, but recommended. I do follow section but not with all attributes. My ini file looks like this:
timezone = Asia/Tel_Aviv ; Production site configuration data [production] webhost = http://devserver.com/application/public/ database.adapter = pdo_mysql database.params.host = localhost database.params.username = root database.params.password = database.params.dbname = shepherd application.language = en [dev] database.adapter = Pdo_Sqlite database.params.dbname = ../data/dev.db On Wed, Mar 4, 2009 at 11:16 AM, Robert Castley <robert.cast...@macro4.com>wrote: > > I maybe wrong but as Zend Ini uses parse_ini_file you need to follow the > structure of sections > > http://uk2.php.net/parse_ini_file > > - Robert > > ------------------------------ > *From:* vadim gavrilov [mailto:vadim...@gmail.com] > *Sent:* 04 March 2009 09:10 > *To:* Robert Castley > > *Subject:* Re: [fw-general] Loading a config.ini file > > Yes i do but the timezone is not inside one of them, But i got the idea > of how to use it. > > Thanks. > > On Wed, Mar 4, 2009 at 11:08 AM, Robert Castley <robert.cast...@macro4.com > > wrote: > >> Do you have sections in your config file? >> >> e.g. >> >> [general] >> timeZone = .... >> >> If so you will need to add the section name when you want the value e.g. >> >> Zend_Registry::get('config')->general->timeZone >> >> - Robert >> >> ------------------------------ >> *From:* vadim gavrilov [mailto:vadim...@gmail.com] >> *Sent:* 04 March 2009 09:06 >> *To:* Robert Castley >> *Cc:* Gregory Eve; Zend Framework - General >> >> *Subject:* Re: [fw-general] Loading a config.ini file >> >> Thanks, I did this: >> >> $config = new Zend_Config_Ini(APPLICATION_PATH . '/config.ini'); >> Zend_Registry::set('config', $config); >> >> And then i could access >> >> Zend_Registry::get('config')->timezone >> >> On Wed, Mar 4, 2009 at 11:03 AM, Robert Castley < >> robert.cast...@macro4.com> wrote: >> >>> Hi, >>> >>> Try this .... this also allows for you to have a development version of >>> the .ini file as well so you don't have to touch the production version: >>> >>> $localConfigName = APPLICATION_PATH . '/config/dev.ini'; >>> >>> $config = new Zend_Config_Ini(APPLICATION_PATH . '/config/app.ini', null, >>> true); >>> >>> if (is_file($localConfigName)) { >>> $localConfig = new Zend_Config_Ini($localConfigName, null, true); >>> $config->merge($localConfig); >>> } >>> >>> $config->setReadOnly(); >>> >>> /** >>> * Define PHP ini settings >>> * These can be removed for a release version! >>> */ >>> ini_set('log_errors', (bool) $config->general->debug); >>> ini_set('display_errors', (bool) $config->general->debug); >>> >>> $registry = Zend_Registry::getInstance(); >>> $registry->config = $config; >>> >>> You can then easily get access to the config by using: >>> >>> >>> Zend_Registry::get('config')->general->myVar >>> >>> - Robert >>> >>> ------------------------------ >>> *From:* vadim gavrilov [mailto:vadim...@gmail.com] >>> *Sent:* 04 March 2009 08:57 >>> *To:* Gregory Eve >>> *Cc:* Zend Framework - General >>> *Subject:* Re: [fw-general] Loading a config.ini file >>> >>> Something like this? >>> >>> $config = new Zend_Config_Ini(APPLICATION_PATH . '/config.ini'); >>> $registry = new Zend_Registry(array('config' => $config)); >>> >>> and then: >>> >>> $registry = Zend_Registry::getInstance(); >>> >>> var_dump( $registry['config'] ); >>> outputs nothing. >>> >>> On Wed, Mar 4, 2009 at 10:51 AM, Gregory Eve < >>> gregory....@mimesis-republic.com> wrote: >>> >>>> Hi, >>>> >>>> you need to put your Zend_Config object in the Zend_Registry to access >>>> to it in your entire application. >>>> >>>> >>>> Grégory EVE >>>> developer engineer >>>> PlayBack Team >>>> >>>> Mimesis Republic >>>> 80, rue des Haies >>>> 75020 Paris >>>> >>> >>> >>> >>> -- >>> Vincent Gabriel. >>> Lead Developer, Senior Support. >>> Zend Certified Engineer. >>> >>> >>> >>> >>> >>> ________________________________________________________________________ >>> This email has been scanned for all known viruses by the MessageLabs >>> Email Security Service and the Macro 4 plc internal virus protection system. >>> ________________________________________________________________________ >>> >>> ________________________________________________________________________ >>> This email has been scanned for all known viruses by the MessageLabs >>> Email Security Service and the Macro 4 plc internal virus protection system. >>> ________________________________________________________________________ >>> >> >> >> >> -- >> Vincent Gabriel. >> Lead Developer, Senior Support. >> Zend Certified Engineer. >> >> >> >> >> >> ________________________________________________________________________ >> This email has been scanned for all known viruses by the MessageLabs Email >> Security Service and the Macro 4 plc internal virus protection system. >> ________________________________________________________________________ >> >> ________________________________________________________________________ >> This email has been scanned for all known viruses by the MessageLabs Email >> Security Service and the Macro 4 plc internal virus protection system. >> ________________________________________________________________________ >> > > > > -- > Vincent Gabriel. > Lead Developer, Senior Support. > Zend Certified Engineer. > > > > > > ________________________________________________________________________ > This email has been scanned for all known viruses by the MessageLabs Email > Security Service and the Macro 4 plc internal virus protection system. > ________________________________________________________________________ > > ________________________________________________________________________ > This email has been scanned for all known viruses by the MessageLabs Email > Security Service and the Macro 4 plc internal virus protection system. > ________________________________________________________________________ > -- Vincent Gabriel. Lead Developer, Senior Support. Zend Certified Engineer.