config
3 months ago
core
6 days ago
js
3 months ago
lang
2 weeks ago
libs
1 month ago
node_modules
4 months ago
plugins
6 days ago
vendor
6 days ago
.htaccess
6 years ago
AGENTS.md
2 weeks ago
DIObject.php
2 years ago
LEGALNOTICE
6 months ago
LICENSE
2 years ago
LegacyAutoloader.php
2 years ago
PRIVACY.md
5 years ago
README.md
6 months ago
SECURITY.md
2 years ago
bootstrap.php
1 month ago
console
6 years ago
favicon.ico
2 years ago
index.php
2 years ago
matomo.js
3 months ago
matomo.php
2 years ago
offline-service-worker.js
5 years ago
piwik.js
3 months ago
piwik.php
6 months ago
robots.txt
5 years ago
LegacyAutoloader.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace { |
| 4 | class LegacyAutoloader |
| 5 | { |
| 6 | public function __construct() |
| 7 | { |
| 8 | \spl_autoload_register(array($this, 'load_class')); |
| 9 | } |
| 10 | public static function register() |
| 11 | { |
| 12 | new \LegacyAutoloader(); |
| 13 | } |
| 14 | public function load_class($className) |
| 15 | { |
| 16 | if (\strpos($className, 'Matomo\\') === 0) { |
| 17 | $newName = 'Piwik' . \substr($className, 6); |
| 18 | if (\class_exists($newName) && !\class_exists($className, \false)) { |
| 19 | @\class_alias($newName, $className); |
| 20 | } |
| 21 | } elseif (\strpos($className, 'Piwik\\') === 0) { |
| 22 | $newName = 'Matomo' . \substr($className, 5); |
| 23 | if (\class_exists($newName) && !\class_exists($className, \false)) { |
| 24 | @\class_alias($newName, $className); |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 | \LegacyAutoloader::register(); |
| 30 | } |
| 31 |