diff --git a/com_oauthserver/administrator/src/Helper/ComponentHelper.php b/com_oauthserver/administrator/src/Helper/ComponentHelper.php index bdf6b3d..43ae6c5 100644 --- a/com_oauthserver/administrator/src/Helper/ComponentHelper.php +++ b/com_oauthserver/administrator/src/Helper/ComponentHelper.php @@ -1,22 +1,36 @@ + * @license MIT; see LICENSE.txt + **/ namespace Webmasterskaya\Component\OauthServer\Administrator\Helper; +\defined('_JEXEC') or die; + abstract class ComponentHelper { + /** + * Creates a Composer autoloader, unregisters it, and registers it again at the end of the autoloader stack. + * + * @return void + * @since version + */ public static function registerComponentDependencies(): void { static $registered; - if (!isset($registered)) { + if (!isset($registered)) + { /** @var \Composer\Autoload\ClassLoader $loader */ $loader = require JPATH_ADMINISTRATOR . '/components/com_oauthserver/vendor/autoload.php'; $loader->unregister(); - if (spl_autoload_register([new \Joomla\CMS\Autoload\ClassLoader($loader), 'loadClass'])) { - $registered = true; - } + $loader->register(); } } -} \ No newline at end of file +}