diff --git a/composer.lock b/composer.lock index d98a29c..bde10bb 100644 --- a/composer.lock +++ b/composer.lock @@ -340,16 +340,16 @@ }, { "name": "composer/pcre", - "version": "3.1.3", + "version": "3.1.4", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" + "reference": "04229f163664973f68f38f6f73d917799168ef24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", + "reference": "04229f163664973f68f38f6f73d917799168ef24", "shasum": "" }, "require": { @@ -391,7 +391,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.3" + "source": "https://github.com/composer/pcre/tree/3.1.4" }, "funding": [ { @@ -407,7 +407,7 @@ "type": "tidelift" } ], - "time": "2024-03-19T10:26:25+00:00" + "time": "2024-05-27T13:40:54+00:00" }, { "name": "composer/semver", @@ -811,16 +811,16 @@ }, { "name": "react/promise", - "version": "v3.1.0", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c" + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", - "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", "shasum": "" }, "require": { @@ -872,7 +872,7 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.1.0" + "source": "https://github.com/reactphp/promise/tree/v3.2.0" }, "funding": [ { @@ -880,7 +880,7 @@ "type": "open_collective" } ], - "time": "2023-11-16T16:21:57+00:00" + "time": "2024-05-24T10:39:05+00:00" }, { "name": "seld/jsonlint", @@ -4579,16 +4579,16 @@ }, { "name": "symplify/easy-coding-standard", - "version": "12.1.14", + "version": "12.2.0", "source": { "type": "git", "url": "https://github.com/easy-coding-standard/easy-coding-standard.git", - "reference": "e3c4a241ee36704f7cf920d5931f39693e64afd5" + "reference": "0b97c8e744217a8549efab3f971a982cbe0c310d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/e3c4a241ee36704f7cf920d5931f39693e64afd5", - "reference": "e3c4a241ee36704f7cf920d5931f39693e64afd5", + "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/0b97c8e744217a8549efab3f971a982cbe0c310d", + "reference": "0b97c8e744217a8549efab3f971a982cbe0c310d", "shasum": "" }, "require": { @@ -4599,6 +4599,9 @@ "phpcsstandards/php_codesniffer": "<3.8", "symplify/coding-standard": "<12.1" }, + "suggest": { + "ext-dom": "Needed to support checkstyle output format in class CheckstyleOutputFormatter" + }, "bin": [ "bin/ecs" ], @@ -4621,7 +4624,7 @@ ], "support": { "issues": "https://github.com/easy-coding-standard/easy-coding-standard/issues", - "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.1.14" + "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.2.0" }, "funding": [ { @@ -4633,7 +4636,7 @@ "type": "github" } ], - "time": "2024-02-23T13:10:40+00:00" + "time": "2024-05-23T04:36:48+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Asset/AbstractAssetManager.php b/src/Asset/AbstractAssetManager.php index 8fda97a..12c6b49 100644 --- a/src/Asset/AbstractAssetManager.php +++ b/src/Asset/AbstractAssetManager.php @@ -137,6 +137,12 @@ public function run(): int return 0; } + $rootPackageDir = $this->config->get('root-package-dir'); + + if ($rootPackageDir !== null) { + \chdir($rootPackageDir); + } + $updatable = $this->isUpdatable(); $info = sprintf('%s %s dependencies', $updatable ? 'Updating' : 'Installing', $this->getName()); $this->io->write($info); diff --git a/src/Util/AssetUtil.php b/src/Util/AssetUtil.php index 405d304..9c42575 100644 --- a/src/Util/AssetUtil.php +++ b/src/Util/AssetUtil.php @@ -55,6 +55,16 @@ public static function getPath( if (self::isAsset($package, $configPackages)) { $installPath = $installationManager->getInstallPath($package); + $composerJsonPath = $installPath . '/composer.json'; + + if (\file_exists($composerJsonPath)) { + $composerJson = \json_decode(\file_get_contents($composerJsonPath), true); + + if (isset($composerJson['config']['foxy']['root-package-dir'])) { + $installPath .= '/' . $composerJson['config']['foxy']['root-package-dir']; + } + } + if ($installPath !== null) { $filename = $installPath . '/' . $assetManager->getPackageName(); $path = \file_exists($filename) ? \str_replace('\\', '/', \realpath($filename)) : null;