PluginProbe
Independent Analytics – WordPress Analytics Plugin / 2.11.4
Independent Analytics – WordPress Analytics Plugin v2.11.4
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / vendor / maxmind-db / reader / autoload.php
autoload.php
44 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare (strict_types=1);
4 namespace IAWPSCOPED;
5
6 /**
7 * PSR-4 autoloader implementation for the MaxMind\DB namespace.
8 * First we define the 'mmdb_autoload' function, and then we register
9 * it with 'spl_autoload_register' so that PHP knows to use it.
10 *
11 * @param mixed $class
12 */
13 /**
14 * Automatically include the file that defines <code>class</code>.
15 *
16 * @param string $class
17 * the name of the class to load
18 * @internal
19 */
20 function mmdb_autoload($class) : void
21 {
22 /*
23 * A project-specific mapping between the namespaces and where
24 * they're located. By convention, we include the trailing
25 * slashes. The one-element array here simply makes things easy
26 * to extend in the future if (for example) the test classes
27 * begin to use one another.
28 */
29 $namespace_map = ['MaxMind\\Db\\' => __DIR__ . '/src/MaxMind/Db/'];
30 foreach ($namespace_map as $prefix => $dir) {
31 // First swap out the namespace prefix with a directory...
32 $path = \str_replace($prefix, $dir, $class);
33 // replace the namespace separator with a directory separator...
34 $path = \str_replace('\\', '/', $path);
35 // and finally, add the PHP file extension to the result.
36 $path .= '.php';
37 // $path should now contain the path to a PHP file defining $class
38 if (\file_exists($path)) {
39 include $path;
40 }
41 }
42 }
43 \spl_autoload_register('IAWPSCOPED\\mmdb_autoload');
44