| 123456789101112131415161718192021222324252627282930 |
- <?php
- declare(strict_types=1);
- namespace SixShop\Core;
- use Composer\InstalledVersions;
- class Plugin
- {
- public const string EXTENSION_TYPE = 'sixshop-extension';
- public static array $installedSixShopExtensions = [];
- /**
- * @return array{root: array{reference: string}, versions: array<string, array>}
- */
- public static function getInstalledSixShopExtensions(): array
- {
- if (self::$installedSixShopExtensions) {
- return self::$installedSixShopExtensions;
- }
- $composerDir = dirname(InstalledVersions::getInstallPath('composer/composer'), 2);
- $filePath = $composerDir . '/installedSixShop.php';
- if (!file_exists($filePath)) {
- require dirname(__DIR__) . '/bin/generate-installed-sixshop.php';
- }
- return self::$installedSixShopExtensions = require $filePath;
- }
- }
|