Friday 15 August 2008 7:03:21 am
I was trying to use some services from the Zend frame work and ran into autoload conflicts. To resolve it I changed ezPublish to register is autoloader with spl_autoload_register in /autoload.php. I also had to apply the fix stated in http://issues.ez.no/10728 Now I have no problems with the autoloader of both frameworks. I would suggest using spl_autoload_register instead of __autoload to become the default for interoperability.
function __ezPublish_spl_autoload( $className )
{
static $ezpClasses = null;
if ( is_null( $ezpClasses ) )
{
$ezpKernelClasses = require 'autoload/ezp_kernel.php';
$ezpExtensionClasses = require 'autoload/ezp_extension.php';
$ezpClasses = array_merge( $ezpKernelClasses, $ezpExtensionClasses );
}
if ( array_key_exists( $className, $ezpClasses ) )
{
require( $ezpClasses[$className] );
}
elseif ( EZCBASE_ENABLED )
{
ezcBase::autoload( $className );
}
}
spl_autoload_register('__ezPublish_spl_autoload');
|