Register autoload as the first in the list

Yii framework v1.1 has it's own autoloader and its autoloader throws
an error, when it can't find class. When this library initializes, it
register its own autoloader, but places it at the end of autoload
queue. So when I use library with Yii 1.1, I just face an error:
`include(PHPExcel_Shared_String.php): failed to open stream: No such file or directory`
because Yii's autoloader runs first and tries to include class file
directly.

Registering our autoloader first avoid this.
This commit is contained in:
Adrien Crivelli 2016-08-30 00:51:51 +09:00
parent dbef91004d
commit c3bb4245b3
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class Autoloader
spl_autoload_register('__autoload'); spl_autoload_register('__autoload');
} }
// Register ourselves with SPL // Register ourselves with SPL
return spl_autoload_register([\PhpSpreadsheet\Autoloader::class, 'load']); return spl_autoload_register([\PhpSpreadsheet\Autoloader::class, 'load'], true, true);
} }
/** /**