Zend Framework

Items configured from Zend_Application::setOptions() via a config entry do not have their keys cast to lower case

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.1
  • Fix Version/s: 1.9.2
  • Component/s: Zend_Application
  • Labels:
    None

Description

The ability to have one application.ini file source another one via the config directive is working fine with proper merging now as of Zend Framework 1.8.1.

However, config file referenced via the config directive do not have their array keys cast to lower case, which is the first thing setOptions does with the config file that contains the config directive (I know this sounds confusing, but I have a patch against the subversion repository that fixes this). If you have the following scenario:

ini #1

config = "ini #2"
includePaths.path1 = "some/path"

ini #2

includePaths.path2= "another/path"

One would expect the resulting array to be something like:

array(
    'config' => 'ini #2',
    'includepaths' => array(
        'path1' => 'some/path',
        'path2' => 'another/path'
    )
)

In actuality, however, what you end up with is:

array(
    'config' => 'ini #2',
    'includepaths' => array(
        'path1' => 'some/path',
    ),
    'includePaths' => array(
        'path2' => 'another/path'
    )
)

I have a simple fix for this issue that I will post to this issue once I figure out the best way to attach patches to an issue (this is the first issue that I've filed in the Zend Framework Issue Tracker, and I'm not too familiar with the JIRA Issue Tracker software).

Issue Links

Activity

Hide
Stephen Leavitt added a comment -

Updated description formatting after getting more familiar with JIRA Text Formatting options.

Show
Stephen Leavitt added a comment - Updated description formatting after getting more familiar with JIRA Text Formatting options.
Hide
Stephen Leavitt added a comment -
Show
Stephen Leavitt added a comment - This patch is against http://framework.zend.com/svn/framework/standard/tags/release-1.8.1/library/Zend, revision 15595.
Hide
Stephen Leavitt added a comment -

Linking ZF-6459 as a related issue. ZF-6459 fixed the deep merging issue to make it possible to use the config option, but without the keys from the referenced config file cast to lower case, in order for the deep merge to work, the top-level keys in a referenced config file must all be in lower case.

Show
Stephen Leavitt added a comment - Linking ZF-6459 as a related issue. ZF-6459 fixed the deep merging issue to make it possible to use the config option, but without the keys from the referenced config file cast to lower case, in order for the deep merge to work, the top-level keys in a referenced config file must all be in lower case.
Hide
Satoru Yoshida added a comment -

set component and Tags.

Show
Satoru Yoshida added a comment - set component and Tags.
Hide
Matthew Weier O'Phinney added a comment -

Fixed in trunk and 1.9 release branch. Basically, the options are no longer being stored with flattened keys, but we are still allowing lookups using flattened keys – but passing case sensitive keys will also now work.

Show
Matthew Weier O'Phinney added a comment - Fixed in trunk and 1.9 release branch. Basically, the options are no longer being stored with flattened keys, but we are still allowing lookups using flattened keys – but passing case sensitive keys will also now work.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: