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 /js | |
parent | 565117f01ac7ab413f6b372a69efa9569fc2547f (diff) |
add constant PIWIK_VENDOR_PATH
Diffstat (limited to 'js')
-rw-r--r-- | js/tracker.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/js/tracker.php b/js/tracker.php index c7c546f46e..b06cca49f6 100644 --- a/js/tracker.php +++ b/js/tracker.php @@ -28,13 +28,14 @@ define('PIWIK_USER_PATH', '..'); 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 +if (is_dir(PIWIK_INCLUDE_PATH . '/vendor')) { + define('PIWIK_VENDOR_PATH', PIWIK_INCLUDE_PATH . '/vendor'); // Piwik is the main project } else { - $path = PIWIK_INCLUDE_PATH . '/../../autoload.php'; // Piwik is installed as a dependency + define('PIWIK_VENDOR_PATH', PIWIK_INCLUDE_PATH . '/../..'); // Piwik is installed as a Composer dependency } -require $path; + +// Composer autoloader +require PIWIK_VENDOR_PATH . '/autoload.php'; $file = '../piwik.js'; |