PluginProbe
OPcache Manager / 3.3.0
OPcache Manager v3.3.0
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 2.0.0 2.1.0 2.10.0 2.11.0 2.12.0 2.13.0 2.13.1 2.14.0 2.2.0 2.3.0 2.3.1 2.3.2 2.4.0 2.5.0 2.6.0 All 36 releases
opcache-manager / includes / libraries / autoload.php

autoload.php in OPcache Manager 3.3.0, at includes/libraries/autoload.php

33 lines 803 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Libraries autoload for OPcache Manager.
4 *
5 * @package Libraries
6 * @author Pierre Lannoy <https://pierre.lannoy.fr/>.
7 * @since 1.0.0
8 */
9
10 spl_autoload_register(
11 function ( $class ) {
12 $file = '';
13 foreach ( OPcacheManager\Library\Libraries::get_psr4() as $library ) {
14 $len = strlen( $library['prefix'] );
15 if ( strncmp( $library['prefix'], $class, $len ) === 0 ) {
16 $file = $library['base'] . str_replace( '\\', '/', substr( $class, $len ) ) . '.php';
17 }
18 }
19 if ( '' === $file ) {
20 foreach ( OPcacheManager\Library\Libraries::get_mono() as $library ) {
21 if ( $library['detect'] === $class ) {
22 $file = $library['base'] . $library['detect'] . '.php';
23 }
24 }
25 }
26 if ( '' !== $file ) {
27 if ( file_exists( $file ) ) {
28 include_once $file;
29 }
30 }
31 }
32 );
33