From cb15ea74935090243eb730f42f50fcb86125df63 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Fri, 27 Nov 2015 19:49:53 +0100 Subject: [PATCH] Amend #286 --- index.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 2532c31..625c725 100644 --- a/index.php +++ b/index.php @@ -6,15 +6,14 @@ if (version_compare(PHP_VERSION, '5.3.6', '<')) { } // load dependencies -if(is_file($f = __DIR__ . '/vendor/autoload.php')) { - // local composer install - require_once($f); -} elseif(is_file($f = __DIR__ . '/../../../vendor/autoload.php')) { - // root composer install - require_once($f); +if(is_file(__DIR__ . '/vendor/autoload.php')) { + // composer root package + require_once(__DIR__ . '/vendor/autoload.php'); +} elseif(is_file(__DIR__ . '/../../../vendor/autoload.php')) { + // composer dependency package + require_once(__DIR__ . '/../../../vendor/autoload.php'); } else { - // composer needs install... - die('Cannot find composer `/vendor/autoload.php` -- try `composer install`'); + die("Cannot find `vendor/autoload.php`. Run `composer install`."); } // instance Pico