From 1ceb76c05a83f1a01ae1565ccb8f54c0ed006c11 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Wed, 9 Apr 2014 11:12:38 +0200 Subject: [PATCH] fixed path if piwik is installed as dependency --- piwik.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/piwik.php b/piwik.php index dcb5db53494..ac7be69072e 100644 --- a/piwik.php +++ b/piwik.php @@ -85,8 +85,13 @@ /* * Manually require needed vendor libraries, as composers autorequire would do too much */ -require_once PIWIK_INCLUDE_PATH . '/vendor/mustangostang/spyc/Spyc.php'; -require_once PIWIK_INCLUDE_PATH . '/vendor/piwik/device-detector/DeviceDetector.php'; +if (file_exists(PIWIK_INCLUDE_PATH . '/vendor/autoload.php')) { + $vendorDirectory = PIWIK_INCLUDE_PATH . '/vendor'; +} else { + $vendorDirectory = PIWIK_INCLUDE_PATH . '/../..'; +} +require_once $vendorDirectory . '/mustangostang/spyc/Spyc.php'; +require_once $vendorDirectory . '/piwik/device-detector/DeviceDetector.php'; session_cache_limiter('nocache'); @date_default_timezone_set('UTC');