vendor/shopware/platform/src/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.                    `version`,
  26.                    `autoload`,
  27.                    `managed_by_composer` AS managedByComposer,
  28.                    composer_name as composerName
  29.             FROM `plugin`
  30.             ORDER BY `installed_at`;
  31. SQL;
  32.         $plugins $this->connection->executeQuery($sql)->fetchAll();
  33.         foreach ($plugins as $i => $plugin) {
  34.             $plugins[$i]['active'] = (bool) $plugin['active'];
  35.             $plugins[$i]['managedByComposer'] = (bool) $plugin['managedByComposer'];
  36.             $plugins[$i]['autoload'] = json_decode($plugin['autoload'], true);
  37.         }
  38.         $this->pluginInfos $plugins;
  39.     }
  40. }