diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-22 06:32:06 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-22 06:32:06 +0300 |
commit | f172b5924d52cbfda53e7ce23db0bb58da6db0f3 (patch) | |
tree | bf8a8224de5573998693519ab986f2ca3c40a2ef /core | |
parent | b4af652dd9284f5565ba658389840a47dac48211 (diff) |
Removed Piwik\Loader: Composer's autoloader is now included in core/bootstrap.php
Diffstat (limited to 'core')
-rw-r--r-- | core/Loader.php | 38 | ||||
-rw-r--r-- | core/bootstrap.php | 13 |
2 files changed, 11 insertions, 40 deletions
diff --git a/core/Loader.php b/core/Loader.php deleted file mode 100644 index b89e7743f9..0000000000 --- a/core/Loader.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * - */ - -namespace Piwik; - -/** - * Initializes the Composer Autoloader - * @package Piwik - */ -class Loader -{ - public static function init() - { - return self::getLoader(); - } - - /** - * @return \Composer\Autoload\ClassLoader - */ - private static function getLoader() - { - 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 - } - - $loader = require $path; - - return $loader; - } -} diff --git a/core/bootstrap.php b/core/bootstrap.php index 546625b8c6..d6e809df20 100644 --- a/core/bootstrap.php +++ b/core/bootstrap.php @@ -22,12 +22,21 @@ 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; + /** - * See https://github.com/piwik/piwik/issues/4439#comment:8 and https://github.com/eaccelerator/eaccelerator/issues/12 - * * Eaccelerator does not support closures and is known to be not comptabile with Piwik. Therefore we are disabling * it automatically. At this point it looks like Eaccelerator is no longer under development and the bug has not * been fixed within a year. + * + * @link https://github.com/piwik/piwik/issues/4439#comment:8 + * @link https://github.com/eaccelerator/eaccelerator/issues/12 */ function disableEaccelerator() { |