403Webshell
Server IP : 60.247.133.247  /  Your IP : 216.73.217.108
Web Server : Apache
System : Linux ebs-119054 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64
User : goodwill ( 65985)
PHP Version : 8.2.20
Disable Function : link,symlink,passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server,pcntl_fork,pcntl_rfork
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wwwroot/goodwill/wwwroot/wp-content/themes/GoodWill/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wwwroot/goodwill/wwwroot/wp-content/themes/GoodWill/inc/class-the7-autoloader.php
<?php
/**
 * @since   7.5.0
 *
 * @package The7
 */

defined( 'ABSPATH' ) || exit;

/**
 * Class The7_Autoloader
 */
class The7_Autoloader {

	/**
	 * Path to the includes directory.
	 *
	 * @var string
	 */
	protected $include_path = '';

	/**
	 * The7_Aoutoloader constructor.
	 *
	 * @throws Exception
	 */
	public function __construct() {
		spl_autoload_register( array( $this, 'autoload' ) );

		$this->include_path = trailingslashit( PRESSCORE_DIR );
	}

	/**
	 * Take a class name and turn it into a file name.
	 *
	 * @param string $class Class name.
	 *
	 * @return string
	 */
	private function get_file_name_from_class( $class ) {
		return 'class-' . str_replace( '_', '-', $class ) . '.php';
	}

	/**
	 * Include a class file.
	 *
	 * @param string $path File path.
	 *
	 * @return bool Successful or not.
	 */
	private function load_file( $path ) {
		if ( $path && is_readable( $path ) ) {
			include_once $path;

			return true;
		}

		return false;
	}

	/**
	 * Auto-load The7 classes on demand to reduce memory consumption.
	 *
	 * @param string $class Class name.
	 */
	public function autoload( $class ) {
		$class = strtolower( $class );

		if ( 0 === strpos( $class, 'presscore_' ) || 0 === strpos( $class, 'dt_' ) ) {
			$this->load_deprecated_class( $class );
		}

		if ( 0 === strpos( $class, 'the7\\' ) ) {
			$this->load_namespaced_classes( $class );
		}

		if ( 0 !== strpos( $class, 'the7_' ) ) {
			return;
		}

		$file = $this->get_file_name_from_class( $class );
		$path = $this->include_path;

		if ( 0 === strpos( $class, 'the7_options' ) ) {
			$path = $this->include_path . 'extensions/options-framework/';
		} elseif ( 0 === strpos( $class, 'the7_option_field' ) ) {
			$path = $this->include_path . 'extensions/options-framework/fields/';
		} elseif ( 0 === strpos( $class, 'the7_admin' ) ) {
			$path = $this->include_path . 'admin/';
		} elseif ( 0 === strpos( $class, 'the7_less_vars' ) ) {
			$path = $this->include_path . 'extensions/less-vars/';
		}

		if ( ! $this->load_file( $path . $file ) && function_exists( 'mb_strtolower' ) ) {
			$file = $this->get_file_name_from_class( mb_strtolower( $class ) );
			$this->load_file( $path . $file );
		}
	}

	/**
	 * Load deprecated class.
	 *
	 * @param string $class Class name in lowercase.
	 */
	protected function load_deprecated_class( $class ) {
		$file = $this->get_file_name_from_class( $class );
		$path = $this->include_path . 'deprecated/';
		$this->load_file( $path . $file );
	}

	/**
	 * Load namespaced class.
	 *
	 * @param string $class Class name in lowercase.
	 */
	protected function load_namespaced_classes( $class ) {
		$class = str_replace( [ 'the7\\', '\\', '_' ], [ '', DIRECTORY_SEPARATOR, '-' ], $class );
		$this->load_file( $this->include_path . $class . '.php' );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit