PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.8
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / vendor / markbaker / matrix / classes / Autoloader.php

Autoloader.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.4.8, at vendor/markbaker/matrix/classes/Autoloader.php

54 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Matrix;
4
5 /**
6 *
7 * Autoloader for Matrix classes
8 *
9 * @package Matrix
10 * @copyright Copyright (c) 2014 Mark Baker (https://github.com/MarkBaker/PHPMatrix)
11 * @license https://opensource.org/licenses/MIT MIT
12 */
13 class Autoloader
14 {
15 /**
16 * Register the Autoloader with SPL
17 *
18 */
19 public static function Register()
20 {
21 if (function_exists('__autoload')) {
22 // Register any existing autoloader function with SPL, so we don't get any clashes
23 spl_autoload_register('__autoload');
24 }
25 // Register ourselves with SPL
26 return spl_autoload_register(['Matrix\\Autoloader', 'Load']);
27 }
28
29
30 /**
31 * Autoload a class identified by name
32 *
33 * @param string $pClassName Name of the object to load
34 */
35 public static function Load($pClassName)
36 {
37 if ((class_exists($pClassName, false)) || (strpos($pClassName, 'Matrix\\') !== 0)) {
38 // Either already loaded, or not a Matrix class request
39 return false;
40 }
41
42 $pClassFilePath = __DIR__ . DIRECTORY_SEPARATOR .
43 'src' . DIRECTORY_SEPARATOR .
44 str_replace(['Matrix\\', '\\'], ['', '/'], $pClassName) .
45 '.php';
46
47 if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) {
48 // Can't load
49 return false;
50 }
51 require($pClassFilePath);
52 }
53 }
54