Issues

ZF-6893: Cannot use Zend_Application_Resource_FrontController to set baseurl for a subset of environments

Issue Type: Bug Created: 2009-06-03T04:15:51.000+0000 Last Updated: 2009-08-21T13:57:59.000+0000 Status: Resolved Fix version(s): - 1.9.2 (25/Aug/09)

Reporter: Roger Hunwicks (rhunwicks) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Application

Related issues: Attachments:

Description

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:

<pre class="literal">
[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

<pre class="highlight">
                case 'baseurl':
                    $front->setBaseUrl($value);
                    break;

with

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

Comments

Posted by Matthew Weier O'Phinney (matthew) on 2009-08-21T13:57:59.000+0000

Fixed in trunk and 1.9 release branch

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