Development

Changeset 19470

You must first sign up to be able to contribute.

Changeset 19470

Show
Ignore:
Timestamp:
06/23/09 10:44:02 (8 months ago)
Author:
fabien
Message:

[1.3] fixed sfAutoloadAgain due to PHP 5.3.0 changes in the spl_autoload_functions() function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.3/lib/autoload/sfAutoloadAgain.class.php

    r16536 r19470  
    5757  { 
    5858    $autoloads = spl_autoload_functions(); 
    59     $position  = array_search(array(__CLASS__, 'autoload'), $autoloads, true); 
     59 
     60    // as of PHP 5.3.0, spl_autoload_functions() returns the object as the first element of the array instead of the class name 
     61    if (version_compare(PHP_VERSION, '5.3.0RC1', '>=')) 
     62    { 
     63      foreach ($autoloads as $position => $autoload) 
     64      { 
     65        if ($this === $autoload[0]) 
     66        { 
     67          break; 
     68        } 
     69      } 
     70    } 
     71    else 
     72    { 
     73      $position  = array_search(array(__CLASS__, 'autoload'), $autoloads, true); 
     74    } 
    6075 
    6176    if (isset($autoloads[$position + 1])) 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.