public static function setup($enablePsr = true, $enablePrefixes = true, $enableClasses = true)
    {
        if ($enableClasses) {
            // Register the class map based autoloader.
            spl_autoload_register([self::$instance, 'load']);
        }

        if ($enablePrefixes) {
            // Register the J prefix and base path for Joomla platform libraries.
            self::registerPrefix('J', JPATH_PLATFORM . '/joomla');

            // Register the prefix autoloader.
            spl_autoload_register([self::$instance, '_autoload']);
        }

        if ($enablePsr) {
            // Register the PSR-0 based autoloader.
            spl_autoload_register([self::$instance, 'loadByPsr0']);
            spl_autoload_register([self::$instance, 'loadByAlias']);
        }
    }