PHP 8.2.31
Preview: autoloader.php Size: 1.22 KB
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/elementskit-lite/autoloader.php

<?php
namespace ElementsKit_Lite;

defined( 'ABSPATH' ) || exit;

/**
 * ElementsKit_Lite autoloader.
 * Handles dynamically loading classes only when needed.
 *
 * @since 1.0.0
 */
class Autoloader {
	
	/**
	 * Run autoloader.
	 * Register a function as `__autoload()` implementation.
	 *
	 * @since 1.0.0
	 * @access public
	 */
	public static function run() {
		spl_autoload_register( array( __CLASS__, 'autoload' ) );
	}
	
	/**
	 * Autoload.
	 * For a given class, check if it exist and load it.
	 *
	 * @since 1.0.0
	 * @access private
	 * @param string $class Class name.
	 */
	private static function autoload( $class_name ) {

		// If the class being requested does not start with our prefix
		// we know it's not one in our project.
		if ( 0 !== strpos( $class_name, __NAMESPACE__ ) ) {
			return;
		}
		
		$file_name = strtolower(
			preg_replace(
				array( '/\b' . __NAMESPACE__ . '\\\/', '/([a-z])([A-Z])/', '/_/', '/\\\/' ),
				array( '', '$1-$2', '-', DIRECTORY_SEPARATOR ),
				$class_name
			)
		);

		// Compile our path from the corosponding location.
		$file = \ElementsKit_Lite::plugin_dir() . $file_name . '.php';
		
		// If a file is found.
		if ( file_exists( $file ) ) {
			// Then load it up!
			require_once $file;
		}
	}
}

Directory Contents

Dirs: 10 × Files: 5

Name Size Perms Modified Actions
assets DIR
- drwxr-xr-x 2026-06-05 03:11:37
Edit Download
- drwxr-xr-x 2026-06-05 03:11:37
Edit Download
config DIR
- drwxr-xr-x 2026-06-05 03:11:37
Edit Download
core DIR
- drwxr-xr-x 2026-06-05 03:11:37
Edit Download
helpers DIR
- drwxr-xr-x 2026-06-05 03:11:37
Edit Download
languages DIR
- drwxr-xr-x 2026-06-05 03:11:37
Edit Download
libs DIR
- drwxr-xr-x 2026-06-05 03:11:37
Edit Download
modules DIR
- drwxr-xr-x 2026-06-05 03:11:37
Edit Download
traits DIR
- drwxr-xr-x 2026-06-05 03:11:38
Edit Download
widgets DIR
- drwxr-xr-x 2026-06-05 03:11:38
Edit Download
1.22 KB lrw-r--r-- 2022-05-18 20:49:00
Edit Download
10.65 KB lrw-r--r-- 2026-06-04 10:13:40
Edit Download
18.43 KB lrw-r--r-- 2026-06-04 10:13:40
Edit Download
65.43 KB lrw-r--r-- 2026-06-04 10:13:40
Edit Download
42.61 KB lrw-r--r-- 2026-06-04 10:13:40
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).