From: Christian Weiske Date: Thu, 14 Apr 2016 05:46:12 +0000 (+0200) Subject: Fix #2: Load dependencies correctly when used as composer dependency X-Git-Tag: v0.1.1 X-Git-Url: https://git.cweiske.de/php-sqllint.git/commitdiff_plain/9ab7a8507c0accdc32625e4113dcc50320242825 Fix #2: Load dependencies correctly when used as composer dependency --- diff --git a/bin/php-sqllint b/bin/php-sqllint index f746813..8075c9e 100755 --- a/bin/php-sqllint +++ b/bin/php-sqllint @@ -13,9 +13,14 @@ */ namespace phpsqllint; -if (file_exists(__DIR__ . '/../vendor/autoload.php')) { +if (file_exists('vendor/autoload.php')) { + //dependency composer installation + include_once 'vendor/autoload.php'; +} else if (file_exists(__DIR__ . '/../vendor/autoload.php')) { + //local git checkout include_once __DIR__ . '/../vendor/autoload.php'; } + if (file_exists(__DIR__ . '/../src/phpsqllint/Autoloader.php')) { include_once __DIR__ . '/../src/phpsqllint/Autoloader.php'; Autoloader::register();