diff options
author | Christian Raue <christian.raue@gmail.com> | 2013-12-22 14:15:50 +0400 |
---|---|---|
committer | Christian Raue <christian.raue@gmail.com> | 2013-12-22 14:15:50 +0400 |
commit | 1ba62b546d0cf54fac121428f7f3e603f1509a2f (patch) | |
tree | 5932640a0bf56ddbfbc69b0ac48adb37fc564969 /index.php | |
parent | d9126d4398b090e6f07728b3eec1b3c0a6060ea2 (diff) |
allow using Piwik when installed as a Composer dependency
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -38,7 +38,9 @@ require_once PIWIK_INCLUDE_PATH . '/core/testMinimumPhpVersion.php'; session_cache_limiter('nocache'); @date_default_timezone_set('UTC'); -require_once PIWIK_INCLUDE_PATH . '/vendor/autoload.php'; +require_once file_exists(PIWIK_INCLUDE_PATH . '/vendor/autoload.php') + ? PIWIK_INCLUDE_PATH . '/vendor/autoload.php' // Piwik is the main project + : PIWIK_INCLUDE_PATH . '/../../autoload.php'; // Piwik is installed as a dependency require_once PIWIK_INCLUDE_PATH . '/core/Loader.php'; if(!defined('PIWIK_PRINT_ERROR_BACKTRACE')) { |