Welcome Guest, Not a member yet? Register   Sign In
Migrations autoload namespaces
#2

Not looking for sub-namespaces is intentional, and a performance feature. We don't look for anything more than we need to.

Since your case is a special case, and you've already figured out how to handle it, a better solution is to extend the core Autoloader class. You only need to include any modified methods that you need to override in it.

However, since Autoloader is one of only a couple of classes loaded directly by the bootstrap file, you'll have to include your file first in public/index.php so it can be found later.

Then, copy the autoloader method from system/Config/Services.php and place it into app/Config/Services.php. Then edit that method to load your class instead of the one in system. Now, whenever the system loads the autoloader it should load yours instead.

Seeing this does make me realize we could use a better solution for getting custom files into play first, though this problem only affects 3 files, I believe. Something I'll need to think on.
Reply


Messages In This Thread
Migrations autoload namespaces - by onizuka8 - 06-03-2019, 07:07 AM
RE: Migrations autoload namespaces - by kilishan - 06-04-2019, 06:03 AM
RE: Migrations autoload namespaces - by onizuka8 - 06-05-2019, 01:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB