From 947a916e6331318f4e37a5f47238f81febbc14b1 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 27 Dec 2021 13:51:04 +0000 Subject: [PATCH] fix issue #313 for branch 6.0 of CompatInfo --- CHANGELOG-6.x.md | 4 ++++ config/set/default.php | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index 571e1b18..3d0a2bfb 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -7,6 +7,10 @@ using the [Keep a CHANGELOG](http://keepachangelog.com) principles. ## [Unreleased] +### Fixed + +- [GH-313](https://github.com/llaville/php-compatinfo/issues/313) Cannot install CompatInfo as a vendor dependency + ## [6.0.1] - 2021-12-13 ### Fixed diff --git a/config/set/default.php b/config/set/default.php index 53453193..43640a4e 100644 --- a/config/set/default.php +++ b/config/set/default.php @@ -32,7 +32,12 @@ * @return void */ return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->import(dirname(__DIR__, 2) . '/vendor/bartlett/php-compatinfo-db/config/set/default.php'); + if (file_exists(dirname(__DIR__, 2) . '/vendor')) { + $configSet = dirname(__DIR__, 2) . '/vendor/bartlett/php-compatinfo-db/config/set/default.php'; + } else { + $configSet = dirname(__DIR__, 3) . '/php-compatinfo-db/config/set/default.php'; + } + $containerConfigurator->import($configSet); $containerConfigurator->import(__DIR__ . '/common.php'); $containerConfigurator->import(__DIR__ . '/../packages/messenger.php');