The automatic loading of phpexcel conflicts with other frameworks. The automatic loading of phpexcel conflicts with other frameworks and always wants to use PHPEXCEL. this project has encountered. However, the pitfalls have also come out. In phpexcel's Autoloader. php, the automatic loading of publicstaticfunctionRe phpexcel conflicts with other frameworks.
I always wanted to use PHPEXCEL. this project has been encountered. However, the pitfalls have also come out. In Autoloader. php of 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')); }
This is in conflict with the automatic loading of existing frameworks. To solve this problem, only one of them can be changed. I chose phpexcel because other projects in the framework are automatically loaded and cannot change the framework for one function.
The method found on the internet is to delete it to the original one and use this new one to solve the problem.
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;}
Ghost always wanted to use PHPEXCEL. this project encountered. However, the pitfalls have also come out. In Autoloader. php of phpexcel, public static function Re...