mirror of
https://github.com/webmasterskaya/joomla-oauth-server.git
synced 2024-11-24 02:44:51 +03:00
Перенёс загрузку библиотек в component boot
This commit is contained in:
parent
fa0a116d5c
commit
5b258d4164
@ -14,8 +14,6 @@ use Webmasterskaya\Component\OauthServer\Administrator\Extension\Component;
|
|||||||
|
|
||||||
\defined('_JEXEC') or die;
|
\defined('_JEXEC') or die;
|
||||||
|
|
||||||
require_once JPATH_LIBRARIES . '/lib_oauthserver/vendor/autoload.php';
|
|
||||||
|
|
||||||
return new class implements ServiceProviderInterface {
|
return new class implements ServiceProviderInterface {
|
||||||
|
|
||||||
public function register(Container $container): void
|
public function register(Container $container): void
|
||||||
|
@ -32,5 +32,20 @@ class Component extends MVCComponent implements
|
|||||||
*/
|
*/
|
||||||
public function boot(ContainerInterface $container): void
|
public function boot(ContainerInterface $container): void
|
||||||
{
|
{
|
||||||
|
self::requireDependency();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function requireDependency(): void
|
||||||
|
{
|
||||||
|
static $required;
|
||||||
|
|
||||||
|
if (!isset($required)) {
|
||||||
|
/** @var \Composer\Autoload\ClassLoader $loader */
|
||||||
|
$loader = require JPATH_LIBRARIES . '/lib_oauthserver/vendor/autoload.php';
|
||||||
|
|
||||||
|
$loader->unregister();
|
||||||
|
|
||||||
|
spl_autoload_register([new \Joomla\CMS\Autoload\ClassLoader($loader), 'loadClass'], true, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user