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


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://phpunit.de/manual/current/…

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.


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.

@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.

Fixed in trunk and 1.11 release branch.

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)


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.