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

LegacyAutoloader.php - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 511cf8ce2964a22750fbc4c62ce8d0de233f4a58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

class LegacyAutoloader
{
    public function __construct()
    {
        spl_autoload_register(array($this, 'load_class'));
    }

    public static function register()
    {
        new LegacyAutoloader();
    }

    public function load_class($className)
    {
        if (strpos($className, 'Piwik\\') === 0) {
            $newName = 'Matomo' . substr($className, 5);
            if (class_exists($newName)) {
                class_alias($newName, $className);
            }
        }
    }
}

LegacyAutoloader::register();