__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace MPBC;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Autoloader {
/**
* Relative path to the source directory (without trailing slash).
*/
protected const BASE_DIR = 'src';
protected const AUTOLOAD_EXCEPTIONS = array(
// Class name with namespace => The relative path to the file
);
protected const FUNCTION_FILES = array(
// Relative path to the file in the source directory
'functions.php',
'template-functions.php',
);
protected string $namespace = '';
/**
* Absolute path to the plugin directory (with trailing slash).
*/
protected string $plugin_dir = '';
/**
* @param string $plugin_dir Absolute path to the plugin directory (with
* trailing slash).
*/
public function __construct( string $namespace, string $plugin_dir ) {
$this->namespace = $namespace;
$this->plugin_dir = $plugin_dir;
spl_autoload_register( array( $this, 'load_class' ) );
$this->load_functions();
}
/**
* @access protected
*/
public function load_class( string $class_name ): void {
if ( strpos( $class_name, $this->namespace ) !== 0 ) {
return; // Skip
}
if ( isset( static::AUTOLOAD_EXCEPTIONS[ $class_name ] ) ) {
$plugin_file = static::AUTOLOAD_EXCEPTIONS[ $class_name ];
} else {
// 'MPBC\Sub_Package\Class_X' → 'src/sub-package/class-x.php'
$plugin_file = str_replace( $this->namespace, static::BASE_DIR, $class_name );
$plugin_file = str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, $plugin_file );
$plugin_file = str_replace( '_', '-', $plugin_file );
$plugin_file = strtolower( $plugin_file );
$plugin_file .= '.php';
}
require $this->plugin_dir . $plugin_file;
}
protected function load_functions(): void {
$base_dir = $this->plugin_dir . static::BASE_DIR . DIRECTORY_SEPARATOR;
foreach ( static::FUNCTION_FILES as $function_file ) {
require $base_dir . $function_file;
}
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| action | Folder | 0750 |
|
|
| admin | Folder | 0750 |
|
|
| data | Folder | 0750 |
|
|
| Folder | 0750 |
|
||
| exception | Folder | 0750 |
|
|
| field | Folder | 0750 |
|
|
| helper | Folder | 0750 |
|
|
| library | Folder | 0750 |
|
|
| post-type | Folder | 0750 |
|
|
| rest | Folder | 0750 |
|
|
| shortcode | Folder | 0750 |
|
|
| structure | Folder | 0750 |
|
|
| assets.php | File | 9.4 KB | 0640 |
|
| autoloader.php | File | 1.88 KB | 0640 |
|
| blocks.php | File | 4.4 KB | 0640 |
|
| bundles.php | File | 11.43 KB | 0640 |
|
| database.php | File | 2.01 KB | 0640 |
|
| functions.php | File | 6.72 KB | 0640 |
|
| i18n.php | File | 415 B | 0640 |
|
| plugin.php | File | 6.22 KB | 0640 |
|
| roles-and-capabilities.php | File | 4.68 KB | 0640 |
|
| settings.php | File | 6.84 KB | 0640 |
|
| template-functions.php | File | 5.7 KB | 0640 |
|