CoreFiles by mySites.guru
loader.php62 lines, 1,183 bytes, from Joomla_3.8.3-Stable-Full_Package.zip
Raw History Compare with 3.8.2
md5
a354113a6da219491b6e0e91667c75ea
sha1
de09f01b2aa8977a097a2166e56b054aba4735f4
sha256
f3c98c6a0bafc00d59e3a4e683fcf238906b1cc581a3b7b7886a78a40c19c964
<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  Class
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Composer\Autoload\ClassLoader;

/**
 * Decorate Composer ClassLoader for Joomla!
 *
 * For backward compatibility due to class aliasing in the CMS, the loadClass() method was modified to call
 * the JLoader::applyAliasFor() method.
 *
 * @since  3.4
 */
class JClassLoader
{
	/**
	 * The composer class loader
	 *
	 * @var    ClassLoader
	 * @since  3.4
	 */
	private $loader;

	/**
	 * Constructor
	 *
	 * @param   ClassLoader  $loader  Composer autoloader
	 *
	 * @since   3.4
	 */
	public function __construct(ClassLoader $loader)
	{
		$this->loader = $loader;
	}

	/**
	 * Loads the given class or interface.
	 *
	 * @param   string  $class  The name of the class
	 *
	 * @return  boolean|null  True if loaded, null otherwise
	 *
	 * @since   3.4
	 */
	public function loadClass($class)
	{
		if ($result = $this->loader->loadClass($class))
		{
			JLoader::applyAliasFor($class);
		}

		return $result;
	}
}

The same content is in 21 releases, Joomla 3.7.3-beta1 to 4.0.0-alpha2. See them all, or every version of this file.