Issue Details (XML | Word | Printable)

Key: ZF-6893
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matthew Weier O'Phinney
Reporter: Roger Hunwicks
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Cannot use Zend_Application_Resource_FrontController to set baseurl for a subset of environments

Created: 03/Jun/09 04:15 AM   Updated: 21/Aug/09 01:57 PM   Resolved: 21/Aug/09 01:57 PM
Component/s: Zend_Application
Affects Version/s: 1.8.2
Fix Version/s: 1.9.2

Time Tracking:
Not Specified


 Description  « Hide

The baseurl for the Front Controller cannot be set using an ini file and Zend_Application_Resource_FrontController unless a baseurl is specified for all environments.

For example, we need to set the baseurl for our production environment, but not for our (multiple) development environments:

[production]
resources.frontController.baseurl = "/appname"

[development : production]
resources.frontController.baseurl = null

This works for production, but in development Zend_Application_Resource_FrontController::init() calls $front->setBaseUrl with an empty string (because Zend_Config_Ini relies on parse_ini_file which returns null and false as ""). All the checks in Zend_Controller_Front are for an actual null value and so they assume that we want a baseurl of "" rather than having no baseurl set.

I cannot think of a circumstance where we would really want baseurl="", so I suggest that we change Zend_Application_Resource_FrontController::init() to replace

case 'baseurl':
                    $front->setBaseUrl($value);
                    break;

with

case 'baseurl':
                    if ($value !== "") {
                        $front->setBaseUrl($value);
                    }
                    break;


Matthew Weier O'Phinney added a comment - 21/Aug/09 01:57 PM

Fixed in trunk and 1.9 release branch