public static function Register() {
/* if (function_exists('__autoload')) {
// Register any existing autoloader function with SPL, so we don't get any clashes
spl_autoload_register('__autoload');
}
// Register ourselves with SPL
return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'));
}
與以現有框架的自動加載有沖突了。為了解決這個問題,只可以改其中一個,我選擇了phpexcel,因為框架的其他項目都用本身的自動加載,不能為了一個功能改動框架本身。 從網上找到了方法,就是刪到原來的,用這個新的就可以解決了。
public static function Register() {
/* if (function_exists('__autoload')) {
// Register any existing autoloader function with SPL, so we don't get any clashes
spl_autoload_register('__autoload');
}
// Register ourselves with SPL
return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'));*/
$functions = spl_autoload_functions();
foreach ( $functions as $function)
spl_autoload_unregister($function);
$functions = array_merge(array(array('PHPExcel_Autoloader','Load')),$functions);
foreach ( $functions as $function)
$x = spl_autoload_register($function);
return $x;
}