Issues

ZF-7955: Zend_Application_Bootstrap_BootstrapAbstract - resource Methods arent marked as "run"

Issue Type: Bug Created: 2009-09-25T01:33:51.000+0000 Last Updated: 2009-10-01T10:31:21.000+0000 Status: Resolved Fix version(s): - 1.9.4 (13/Oct/09)

Reporter: Mario Knippfeld (gutzuwissen) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Application

Related issues: Attachments:

Description

Zend_Application_Bootstrap_BootstrapAbstract, Line 664: it should be

$this->_markRun($resourceName);

and not

$this->_markRun($resource);

So the resource methods arent marked as "run" correctly and are called several times if dependencies are set in other resource methods.

Comments

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-09-27T09:17:14.000+0000

Could you please provide a unit test or other code that proves this issue? With both $resource and $resourceName all unittests pass.

Posted by Mario Knippfeld (gutzuwissen) on 2009-09-28T02:55:22.000+0000

Hi,

its a little bit tricky :)

Just use the following Bootstrap class and you will see that the FunctionTest will be called 3 times:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

protected $_counter = 1;


protected function _initFunctionTesta()
{
    $this->bootstrap('FunctionTest');
}

protected function _initFunctionTestb()
{
    $this->bootstrap('FunctionTest');
}

protected function _initFunctionTest()
{
    echo 'CALL Nr. '.$this->_counter.'<br />';
    $this->_counter += 1;

}    

}

====== if i would use the bootstrap method with lower case (e.g. $this->bootstrap('functiontest'); ) all is working fine. the problem is that in line 664: $resource is used and not $resourceName, which is filtered by a strtolower.

Posted by julien PAULI (doctorrock83) on 2009-10-01T10:31:17.000+0000

Confirmed for me. Fix is located at r18454

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