From 9ab7a8507c0accdc32625e4113dcc50320242825 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 14 Apr 2016 07:46:12 +0200 Subject: [PATCH] Fix #2: Load dependencies correctly when used as composer dependency --- bin/php-sqllint | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); -- 2.30.2