diff options
author | Christian Raue <christian.raue@gmail.com> | 2015-06-26 12:32:52 +0300 |
---|---|---|
committer | Christian Raue <christian.raue@gmail.com> | 2015-06-26 12:49:40 +0300 |
commit | 75469d13e15245b605037b48ebd6df516971665d (patch) | |
tree | 65def8fe8dff947f1ed3475322bc38c1df8ff34a /core/bootstrap.php | |
parent | 565117f01ac7ab413f6b372a69efa9569fc2547f (diff) |
add constant PIWIK_VENDOR_PATH
Diffstat (limited to 'core/bootstrap.php')
-rw-r--r-- | core/bootstrap.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/bootstrap.php b/core/bootstrap.php index ddb23c6016..44103a54b9 100644 --- a/core/bootstrap.php +++ b/core/bootstrap.php @@ -14,6 +14,14 @@ error_reporting(E_ALL | E_NOTICE); @ini_set('xdebug.show_exception_trace', 0); @ini_set('magic_quotes_runtime', 0); +if (!defined('PIWIK_VENDOR_PATH')) { + if (is_dir(PIWIK_INCLUDE_PATH . '/vendor')) { + define('PIWIK_VENDOR_PATH', PIWIK_INCLUDE_PATH . '/vendor'); // Piwik is the main project + } else { + define('PIWIK_VENDOR_PATH', PIWIK_INCLUDE_PATH . '/../..'); // Piwik is installed as a Composer dependency + } +} + // NOTE: the code above must be PHP 4 compatible require_once PIWIK_INCLUDE_PATH . '/core/testMinimumPhpVersion.php'; @@ -25,12 +33,7 @@ disableEaccelerator(); require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php'; // Composer autoloader -if (file_exists(PIWIK_INCLUDE_PATH . '/vendor/autoload.php')) { - $path = PIWIK_INCLUDE_PATH . '/vendor/autoload.php'; // Piwik is the main project -} else { - $path = PIWIK_INCLUDE_PATH . '/../../autoload.php'; // Piwik is installed as a dependency -} -require_once $path; +require_once PIWIK_VENDOR_PATH . '/autoload.php'; /** * Eaccelerator does not support closures and is known to be not comptabile with Piwik. Therefore we are disabling |