From 0a39ce306728653462beb7bee1820c0b4fd58c4b Mon Sep 17 00:00:00 2001 From: patrickkusebauch Date: Tue, 10 Aug 2021 17:54:31 +0200 Subject: [PATCH 1/2] This autoload is not needed and prohibits use of the library as dependency --- deptrac.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/deptrac.php b/deptrac.php index 85e0af989..c7f190df2 100755 --- a/deptrac.php +++ b/deptrac.php @@ -8,10 +8,6 @@ exit(1); } -(static function (): void { - require_once __DIR__.'/vendor/autoload.php'; -})(); - (static function (): void { if (\file_exists($autoload = getcwd().'/vendor/autoload.php')) { include_once $autoload; From 1d10c98616bf30e2c24026e7b7328184e9f567df Mon Sep 17 00:00:00 2001 From: patrickkusebauch Date: Tue, 10 Aug 2021 18:01:18 +0200 Subject: [PATCH 2/2] conditional require --- deptrac.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deptrac.php b/deptrac.php index c7f190df2..9bc9dd26c 100755 --- a/deptrac.php +++ b/deptrac.php @@ -8,6 +8,12 @@ exit(1); } +(static function (): void { + if (\file_exists($autoload = __DIR__.'/vendor/autoload.php')) { + require_once $autoload; + } +})(); + (static function (): void { if (\file_exists($autoload = getcwd().'/vendor/autoload.php')) { include_once $autoload;