Autoloader.php
system/Autoloader/Autoloader.php
1 class
19 methods
class Autoloader
An autoloader that uses both PSR4 autoloading, and traditional classmaps. Given a foo-bar package of classes in the file system at the following paths: ``` path/to/packages/foo-bar src Baz.php # Foo\Bar\Baz Qux Quux.php # Foo\Bar\Qux\Quux ``` you can add the path to the configuration array that is passed in the constructor. The Config array consists of 2 primary keys, both of which are associative arrays: 'psr4', and 'classmap'. ``` $Config = [ 'psr4' => [ 'Foo\Bar' => '/path/to/packages/foo-bar' ], 'classmap' => [ 'MyClass' => '/path/to/class/file.php' ] ]; ``` Example: ``` <?php our configuration array $Config = [ ... ]; $loader = new \CodeIgniter\Autoloader\Autoloader($Config); register the autoloader $loader->register(); ```
initialize
(Autoload $config, Modules $modules)
loadComposerAutoloader
(Modules $modules)
register
()
unregister
()
addNamespace
($namespace, ?string $path = null)
getNamespace
(?string $prefix = null)
removeNamespace
(string $namespace)
loadClassmap
(string $class)
loadClass
(string $class)
loadInNamespace
(string $class)
includeFile
(string $file)
sanitizeFilename
(string $filename)
loadComposerNamespaces
(ClassLoader $composer, array $composerPackages)
discoverComposerNamespaces
()
loadHelpers
()
initializeKint
(bool $debug = false)
autoloadKint
()
void
($class)
configureKint
()