PluginProbe
OttoKit: All-in-One Automation Platform / 1.1.30
OttoKit: All-in-One Automation Platform v1.1.30
1.1.38 1.1.37 1.1.36 1.1.35 1.1.34 1.1.33 1.1.32 1.1.31 1.1.30 1.1.29 1.1.28 1.1.27 1.1.9 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 All 124 releases
suretriggers / autoloader.php
autoloader.php
36 lines 809 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Loader for namespace.
4 *
5 * @since 1.0.0
6 * @package SureTrigger
7 */
8
9 spl_autoload_register(
10 function ( $class ) {
11 // The namespace prefix.
12 $prefix = 'SureTriggers\\';
13
14 // Does the class use the namespace prefix?
15 $len = strlen( $prefix );
16 if ( strncmp( $prefix, $class, $len ) !== 0 ) {
17 // No, move to the next registered autoloader.
18 return;
19 }
20
21 // Get the relative class name.
22 $relative_class = substr( $class, $len );
23
24 // Replace the namespace prefix with the base directory, replace namespace.
25 // separators with directory separators in the relative class name, append.
26 // with .php.
27 $file = __DIR__ . '/src/' . str_replace( '\\', '/', $relative_class ) . '.php';
28
29 // If the file exists, require it.
30 if ( file_exists( $file ) ) {
31 require $file;
32 }
33 }
34 );
35
36