Issues

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

Issue Type: Improvement Created: 2011-01-04T00:30:29.000+0000 Last Updated: 2011-04-22T20:15:22.000+0000 Status: Resolved Fix version(s): - 1.11.5 (07/Apr/11)

  • Next Major Release ()

Reporter: Wil Moore III (wilmoore) (wilmoore) Assignee: Wil Moore III (wilmoore) (wilmoore) Tags: - Zend_Application

Related issues: - ZF-11317

Attachments: - ZF-10898-Application.patch

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://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.

Comments

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2011-01-24T11:49:32.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2011-01-24T12:20:45.000+0000

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

Posted by Wil Moore III (wilmoore) (wilmoore) on 2011-04-06T00:34:42.000+0000

Fixed in trunk and 1.11 release branch.

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2011-04-22T20:04:45.000+0000

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)

Posted by Wil Moore III (wilmoore) (wilmoore) on 2011-04-22T20:15:22.000+0000

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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts