Autoloader example

/** * The Autoloader class is the central class that handles our * spl_autoload_register method, and helper methods. * * @return Autoloader */
    public static function autoloader(bool $getShared = true)
    {
        if ($getShared) {
            if (empty(static::$instances['autoloader'])) {
                static::$instances['autoloader'] = new Autoloader();
            }

            return static::$instances['autoloader'];
        }

        return new Autoloader();
    }

    /** * The file locator provides utility methods for looking for non-classes * within namespaced folders, as well as convenience methods for * loading 'helpers', and 'libraries'. * * @return FileLocator */
Home | Imprint | This part of the site doesn't use cookies.