Zend Framework

Zend_Application_Bootstrap_BootstrapAbstract - resource Methods arent marked as "run"

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.9.3
  • Fix Version/s: 1.9.4
  • Component/s: Zend_Application
  • Labels:
    None

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.

Activity

Hide
Dolf Schimmel (Freeaqingme) added a comment -

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

Show
Dolf Schimmel (Freeaqingme) added a comment - Could you please provide a unit test or other code that proves this issue? With both $resource and $resourceName all unittests pass.
Hide
Mario Knippfeld added a comment -

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.

Show
Mario Knippfeld added a comment - 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.
Hide
julien PAULI added a comment -

Confirmed for me.
Fix is located at r18454

Show
julien PAULI added a comment - Confirmed for me. Fix is located at r18454

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: