PluginProbe ʕ •ᴥ•ʔ
W2S – Migrate WooCommerce to Shopify / trunk
W2S – Migrate WooCommerce to Shopify vtrunk
trunk 1.3.2
w2s-migrate-woo-to-shopify / autoload.php
w2s-migrate-woo-to-shopify Last commit date
admin 5 months ago assets 1 week ago includes 1 week ago languages 1 week ago public 4 years ago README.txt 1 week ago autoload.php 4 years ago changelog.txt 1 week ago uninstall.php 4 years ago w2s-migrate-woo-to-shopify.php 1 week ago
autoload.php
28 lines
1 <?php
2 namespace Shopify;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 spl_autoload_register( function ( $class ) {
9 $prefix = __NAMESPACE__;
10 $base_dir = __DIR__;
11 $len = strlen( $prefix );
12
13 if ( strncmp( $prefix, $class, $len ) !== 0 ) {
14 return;
15 }
16
17 $relative_class = strtolower( substr( $class, $len ) );
18 $relative_class = strtolower( str_replace( '_', '-', $relative_class ) );
19 $file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php';
20
21 if ( file_exists( $file ) ) {
22 require_once $file;
23 } else {
24 return;
25 }
26 } );
27
28