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:
parent
dbef91004d
commit
c3bb4245b3
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue