Skip to content

Commit

Permalink
conditional require
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkusebauch committed Aug 10, 2021
1 parent 0a39ce3 commit 1d10c98
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deptrac.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1d10c98

Please sign in to comment.