PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/footcrew.com/ads/wp-content/themes/classipress/includes/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : /home/trave494/footcrew.com/ads/wp-content/themes/classipress/includes/class-autoload.php

<?php
/**
 * ClassiPress Autoloader
 *
 * @package ClassiPress
 * @author  AppThemes
 * @since   4.0.0
 */

/**
 * Autoloader class.
 */
class CP_Autoload {

	/**
	 * The class map array.
	 *
	 * @var array
	 */
	private static $class_map = array();

	/**
	 * Adds class map to the end of registered.
	 *
	 * Overrides already been mapped classes.
	 *
	 * @param array $class_map The class map array.
	 *                         Keys - class names, values - class file path.
	 */
	static function add_class_map( array $class_map ) {
		self::$class_map = array_merge( self::$class_map, $class_map );
	}

	/**
	 * Registers autoloader in the system.
	 */
	static function register() {
		spl_autoload_register( array( __CLASS__, 'autoload' ) );
	}

	/**
	 * Autoload callback.
	 *
	 * Checks the class map and loads file if it has been mapped.
	 *
	 * @param string $class Class name.
	 */
	static function autoload( $class ) {
		if ( '\\' === $class[0] ) {
			$class = substr( $class, 1 );
		}

		if ( isset( self::$class_map[ $class ] ) && is_file( self::$class_map[ $class ] ) ) {
			require self::$class_map[ $class ];
		}
	}
}