Zend Framework

Autoloader doesn not make use of PHP5.3 closures as callbacks

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.10.6
  • Component/s: Zend_Loader
  • Labels:
    None

Description

Zend_Loader_Autoloader::pushAutoloader() and sisters don't actually make use of anonymous functions.
They accept them, but the code trying to execute the callback simply ignores closures.

Use case :

require_once 'Zend/Loader/Autoloader.php';
$autoload = Zend_Loader_Autoloader::getInstance();
$autoload->pushAutoloader(function ($class)
{ require str_replace('_','-',$class) . '.php'; });

$f = new Foo_Bar; // class not found (and should be)

  1. autoloader.diff
    21/Jun/10 8:35 AM
    1 kB
    julien PAULI
  2. ZF10024test.tar.gz
    21/Jun/10 10:03 AM
    0.5 kB
    julien PAULI

Activity

Hide
julien PAULI added a comment -

Attached a patch

Show
julien PAULI added a comment - Attached a patch
Hide
julien PAULI added a comment -

Attached a testcase

Show
julien PAULI added a comment - Attached a testcase
Hide
Matthew Weier O'Phinney added a comment -

Patch applied (with edits) to trunk and 1.10 release branch.

Show
Matthew Weier O'Phinney added a comment - Patch applied (with edits) to trunk and 1.10 release branch.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: