From df99958863a061065c95a9c7910374325529d542 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 14 Aug 2015 17:56:18 +0200 Subject: Fix: path to vendor/autoload.php when used as an composer dependency a different path must be used --- framework/PradoBase.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'framework/PradoBase.php') diff --git a/framework/PradoBase.php b/framework/PradoBase.php index ec1b8790..e60daafb 100644 --- a/framework/PradoBase.php +++ b/framework/PradoBase.php @@ -97,7 +97,16 @@ class PradoBase */ public static function initAutoloader() { - self::$_loader = require_once __DIR__ . '/../vendor/autoload.php'; + $autoloadPaths = array( + __DIR__ . '/../../../autoload.php', // prado as dependency + __DIR__ . '/../vendor/autoload.php', // prado itself + ); + foreach($autoloadPaths as $autoloadPath) + if(file_exists($autoloadPath)) { + self::$_loader = $autoloadPath; + break; + } + spl_autoload_register(array(get_called_class(), 'autoload')); } -- cgit v1.2.3