summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid <ottodavid@gmx.net>2015-08-14 17:56:18 +0200
committerDavid <ottodavid@gmx.net>2015-08-16 14:11:35 +0200
commitdf99958863a061065c95a9c7910374325529d542 (patch)
treea994c91c3ea3f54b74d8ad019cb604075b755ef8
parentcbc337ced4cba058fc1ed38a6b01d7c4e6677c17 (diff)
Fix: path to vendor/autoload.php
when used as an composer dependency a different path must be used
-rw-r--r--framework/PradoBase.php11
1 files changed, 10 insertions, 1 deletions
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'));
}