vendor/shopware/core/Framework/Plugin/KernelPluginLoader/DbalKernelPluginLoader.php line 8

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\Plugin\KernelPluginLoader;
  3. use Composer\Autoload\ClassLoader;
  4. use Doctrine\DBAL\Connection;
  5. class DbalKernelPluginLoader extends KernelPluginLoader
  6. {
  7.     /**
  8.      * @var Connection
  9.      */
  10.     private $connection;
  11.     public function __construct(ClassLoader $classLoader, ?string $pluginDirConnection $connection)
  12.     {
  13.         parent::__construct($classLoader$pluginDir);
  14.         $this->connection $connection;
  15.     }
  16.     protected function loadPluginInfos(): void
  17.     {
  18.         $sql = <<<SQL
  19.             # dbal-plugin-loader
  20.             SELECT
  21.                    `name`,
  22.                    `base_class` AS baseClass,
  23.                    IF(`active` = 1 AND `installed_at` IS NOT NULL, 1, 0) AS active,
  24.                    `path`,
  25.                    `autoload`,
  26.                    `managed_by_composer` AS managedByComposer
  27.             FROM `plugin`
  28.             ORDER BY `installed_at`;
  29. SQL;
  30.         $plugins $this->connection->executeQuery($sql)->fetchAll();
  31.         foreach ($plugins as $i => $plugin) {
  32.             $plugins[$i]['active'] = (bool) $plugin['active'];
  33.             $plugins[$i]['managedByComposer'] = (bool) $plugin['managedByComposer'];
  34.             $plugins[$i]['autoload'] = json_decode($plugin['autoload'], true);
  35.         }
  36.         $this->pluginInfos $plugins;
  37.     }
  38. }