Custom autoloaders are registered too late
Currently custom autoloaders are registered by some PHP code contained in the ComponentsConfiguration.php file. This file is included while the Package Manager configures and registers the components from the Classes directory. After that step, the component types are registered.
Due to this order, it might be that an interface of a package is required which is not yet loaded. If that interface can only be loaded by the custom autoloader, but that autloader is not yet registered (because the components of that package are not registered) PHP throws a fatal error.
The solution is to move autoloader registration to an earlier stage, before any component is registered or configured.
#1 Updated by Robert Lemke over 12 years ago
- Status changed from New to Closed
- Sprint set to fixed
- Core: Added support for "PackageConfiguration.php". Autoloaders should now be registered in the PackageConfiguration.php instead of the ComponentsConfiguration.php.
- PHPUnit: Renamed ComponentsConfiguration.php to PackageConfiguration.php
- phpCR: Renamed ComponentsConfiguration.php to PackageConfiguration.php and fixed the path name
- Core: Fixed #41: Custom autoloaders are registered too late