Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobocoder <anthon.pang@gmail.com>2009-06-15 19:35:51 +0400
committerrobocoder <anthon.pang@gmail.com>2009-06-15 19:35:51 +0400
commiteb76947a582b81881e626fb1c82b6031cfe97c7f (patch)
treea1bc6a52960be9a42850974e61b72f6e7794386c /index.php
parent8ac6d121d92593cc3c82fea362eb0e854ddbbdb4 (diff)
refs #620, refs #803 - refactor autoloader into core/Loader.php (class
Piwik_Loader); remove unnecessary require_once in core/Common.php git-svn-id: http://dev.piwik.org/svn/trunk@1224 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php40
1 files changed, 2 insertions, 38 deletions
diff --git a/index.php b/index.php
index 0b92c05737..308431f5d3 100755
--- a/index.php
+++ b/index.php
@@ -26,44 +26,6 @@ if((@include "Version.php") === false || !class_exists('Piwik_Version', false))
. PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/plugins');
}
-function piwikAutoloader($class)
-{
- $class = str_replace('_', '/', $class) . '.php';
- if(substr($class, 0, 6) === 'Piwik/')
- {
- $class = substr($class, 6);
- if(file_exists(PIWIK_INCLUDE_PATH . "/core/" . $class))
- {
- include_once PIWIK_INCLUDE_PATH . "/core/" . $class;
- }
- else
- {
- include_once PIWIK_INCLUDE_PATH . "/plugins/" . $class;
- }
- }
- else
- {
- include_once PIWIK_INCLUDE_PATH . "/libs/" . $class;
- }
-}
-
-// Note: only one __autoload per PHP instance
-if(function_exists('spl_autoload_register'))
-{
- spl_autoload_register('piwikAutoloader'); // use the SPL autoload stack
- if(function_exists('__autoload'))
- {
- spl_auto_register('__autoload');
- }
-}
-else
-{
- function __autoload($class)
- {
- piwikAutoloader($class);
- }
-}
-
require_once "core/testMinimumPhpVersion.php";
// NOTE: the code above this comment must be PHP4 compatible
@@ -86,6 +48,8 @@ if(strlen(session_id()) === 0)
if(!defined('PIWIK_ENABLE_DISPATCH') || PIWIK_ENABLE_DISPATCH)
{
+ require_once "core/Loader.php";
+
$controller = Piwik_FrontController::getInstance();
$controller->init();
$controller->dispatch();