From 86aec3578a0e8c14b6a2497877fbf64c43e149ed Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Fri, 28 Sep 2018 13:08:08 +0200 Subject: [PATCH] [TASK] Updates Autoloading to match when required from other libraries/tools --- bin/semver | 8 +++++++- bin/update-versions | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/semver b/bin/semver index 37530f3..aa87fae 100644 --- a/bin/semver +++ b/bin/semver @@ -3,7 +3,13 @@ namespace vierbergenlars\SemVer\Application\SemVer; -require __DIR__ . '/../vendor/autoload.php'; +if (file_exists(__DIR__ . '/../vendor/autoload.php')) { + require_once __DIR__ . '/../vendor/autoload.php'; +} else { + if (file_exists(__DIR__ . '/../../../autoload.php')) { + require_once __DIR__ . '/../../../autoload.php'; + } +} use vierbergenlars\SemVer\version; use vierbergenlars\SemVer\expression; diff --git a/bin/update-versions b/bin/update-versions index a0cb33f..510b91d 100644 --- a/bin/update-versions +++ b/bin/update-versions @@ -3,7 +3,13 @@ namespace vierbergenlars\SemVer\Application\UpdateVersions; -require __DIR__ . '/../vendor/autoload.php'; +if (file_exists(__DIR__ . '/../vendor/autoload.php')) { + require_once __DIR__ . '/../vendor/autoload.php'; +} else { + if (file_exists(__DIR__ . '/../../../autoload.php')) { + require_once __DIR__ . '/../../../autoload.php'; + } +} use vierbergenlars\SemVer\version; use vierbergenlars\SemVer\expression;