Library/Loader.php
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']);
        }
    }
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']);
        }
    }
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' ] ) ; } }
Method to setup the autoloaders for the Joomla Platform.
Since the SPL autoloaders are called in a queue we will add our explicit
class-registration based loader first, then fall back on the autoloader based on conventions.
This will allow people to register a class in a specific location and override platform libraries
as was previously possible.

@param   bool $enablePsr      True to enable autoloading based on PSR-0.
@param   bool $enablePrefixes True to enable prefix based class loading (needed to auto load the Joomla
core).
@param   bool $enableClasses  True to enable class map based class loading (needed to auto load the Joomla
core).

@return  void
@author Maximilian Ruta <mr@xtain.net>
Method to setup the autoloaders for the Joomla Platform . Since the SPL autoloaders are called in a queue we will add our explicit class - registration based loader first then fall back on the autoloader based on conventions . This will allow people to register a class in a specific location and override platform libraries as was previously possible .