Zend Framework

PATCH: Allow loading application.ini.dist (application.*.dist) similar to phpunit.xml.dist

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.11.4
  • Fix Version/s: 1.11.5, Next Major Release
  • Component/s: Zend_Application
  • Labels:
    None

Description

PHPUnit allows the ability to load a phpunit.xml.dist file in place of the phpunit.xml file if the phpunit.xml file does not exist.
http://www.phpunit.de/manual/current/en/textui.html

In keeping with that convention, my applications ship with an application.xml.dist or application.ini.dist. Unfortunately, when Zend_Application#_loadConfig() is given a string of "application.ini.dist", the "dist" is the only part of the suffix evaluated...the .ini part is ignored. This causes an exception:

Zend_Application_Exception('Invalid configuration file provided; unknown config type');

I propose a patch to honor *.dist files and if accepted, I'd like to push it through.

  1. ZF-10898-Application.patch
    04/Jan/11 12:37 AM
    0.8 kB
    Wil Moore III (wilmoore)
  2. ZF-10898-ApplicationTest.patch
    04/Jan/11 12:37 AM
    1 kB
    Wil Moore III (wilmoore)

Issue Links

Activity

Hide
Dolf Schimmel (Freeaqingme) added a comment -

For the record, I'm against this "functionality". The reason for this is that phpunit is shipped with a basic configuration file to run a vanilla setup. Since with ZF it's mandatory to write your own config file, there's no reason why you wouldn't call it application.ini (or whatever) right-away yourself.

Show
Dolf Schimmel (Freeaqingme) added a comment - For the record, I'm against this "functionality". The reason for this is that phpunit is shipped with a basic configuration file to run a vanilla setup. Since with ZF it's mandatory to write your own config file, there's no reason why you wouldn't call it application.ini (or whatever) right-away yourself.
Hide
Matthew Weier O'Phinney added a comment -

@Dolf: a prime use case for having a ".dist" file is for version control purposes. The basic settings intended for production are put in that file, and checked in; individual developers copy this to "application.ini", and make changes specific to their own environment – and exclude the "application.ini" file from versioning by their VCS. It's a very sane practice, and one we've been using with the ZF site for some years.

Wil, I think we should move forward on this.

Show
Matthew Weier O'Phinney added a comment - @Dolf: a prime use case for having a ".dist" file is for version control purposes. The basic settings intended for production are put in that file, and checked in; individual developers copy this to "application.ini", and make changes specific to their own environment – and exclude the "application.ini" file from versioning by their VCS. It's a very sane practice, and one we've been using with the ZF site for some years. Wil, I think we should move forward on this.
Hide
Wil Moore III (wilmoore) added a comment -

Fixed in trunk and 1.11 release branch.

Show
Wil Moore III (wilmoore) added a comment - Fixed in trunk and 1.11 release branch.
Hide
Dolf Schimmel (Freeaqingme) added a comment -

Wil, in what revisions did you implement this? I think it's breaking my application...

Since this is new functionality and not a bug, I also fail to see why it was implemented in a mini version. Sorry if I'm a gamespoiler here 8)

Show
Dolf Schimmel (Freeaqingme) added a comment - Wil, in what revisions did you implement this? I think it's breaking my application... Since this is new functionality and not a bug, I also fail to see why it was implemented in a mini version. Sorry if I'm a gamespoiler here 8)
Hide
Wil Moore III (wilmoore) added a comment -

Dolf,

It was implemented into 1.11.5.

I also fail to see why it was implemented in a mini version. Sorry if I'm a gamespoiler here

No worries. Valid point. I saw it as a minor enhancement rather than a new feature, but I suppose it could be interpreted differently.

I think it's breaking my application

That's not good. Can you tell me what issue(s) you are having with this so I can check it out? Thanks.

Show
Wil Moore III (wilmoore) added a comment - Dolf, It was implemented into 1.11.5. I also fail to see why it was implemented in a mini version. Sorry if I'm a gamespoiler here No worries. Valid point. I saw it as a minor enhancement rather than a new feature, but I suppose it could be interpreted differently. I think it's breaking my application That's not good. Can you tell me what issue(s) you are having with this so I can check it out? Thanks.

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: