PluginProbe
YayExtra – WooCommerce Extra Product Options / 1.2
YayExtra – WooCommerce Extra Product Options v1.2
2.1.0 trunk 1.1.4 1.1.5 1.1.8 1.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.5.2 1.5.3 1.5.5 1.5.6 All 30 releases
yayextra / autoloader.php

autoloader.php in YayExtra – WooCommerce Extra Product Options 1.2, at autoloader.php

27 lines 452 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Set up autoload
4 */
5
6 namespace YayExtra;
7
8 spl_autoload_register(
9 function ( $class ) {
10 $prefix = __NAMESPACE__;
11 $base_dir = __DIR__ . '/includes';
12
13 $len = strlen( $prefix );
14 if ( strncmp( $prefix, $class, $len ) !== 0 ) {
15 return;
16 }
17
18 $relative_class_name = substr( $class, $len );
19
20 $file = $base_dir . str_replace( '\\', '/', $relative_class_name ) . '.php';
21
22 if ( file_exists( $file ) ) {
23 require $file;
24 }
25 }
26 );
27