PluginProbe ʕ •ᴥ•ʔ
LiteSpeed Cache / 3.6.4
LiteSpeed Cache v3.6.4
trunk 1.0.15 1.9.1.1 2.9.9.2 3.6.4 4.6 5.7.0.1 6.5.4 7.0.0.1 7.0.1 7.1 7.2 7.3 7.3.0.1 7.4 7.5 7.5.0.1 7.6 7.6.1 7.6.2 7.7 7.8 7.8.0.1 7.8.1
litespeed-cache / autoload.php
litespeed-cache Last commit date
assets 5 years ago cli 5 years ago data 5 years ago inc 5 years ago lang 5 years ago lib 5 years ago src 5 years ago thirdparty 5 years ago tpl 5 years ago wp_assets 5 years ago LICENSE 5 years ago autoload.php 5 years ago litespeed-cache.php 5 years ago readme.txt 5 years ago
autoload.php
43 lines
1 <?php
2 /**
3 * Auto registration for LiteSpeed classes
4 *
5 * @since 1.1.0
6 * @since 3.0 Moved into /
7 * @package LiteSpeed
8 * @author LiteSpeed Technologies <info@litespeedtech.com>
9 */
10 defined( 'WPINC' ) || exit;
11
12 if ( ! function_exists( 'litespeed_autoload' ) ) {
13 function litespeed_autoload( $cls )
14 {
15 if ( strpos( $cls, '.' ) !== false ) {
16 return;
17 }
18
19 if ( strpos( $cls, 'LiteSpeed' ) !== 0 ) {
20 return;
21 }
22
23 $file = explode( '\\', $cls );
24 array_shift( $file );
25 $file = implode( '/', $file );
26 $file = str_replace( '_', '-', strtolower( $file ) );
27
28 if ( strpos( $file, 'lib/' ) === 0 || strpos( $file, 'cli/' ) === 0 || strpos( $file, 'thirdparty/' ) === 0 ) {
29 $file = LSCWP_DIR . $file . '.cls.php';
30 }
31 else {
32 $file = LSCWP_DIR . 'src/' . $file . '.cls.php';
33 }
34
35 if ( file_exists( $file ) ) {
36 require_once $file;
37 }
38 }
39 }
40
41 spl_autoload_register( 'litespeed_autoload' );
42
43