class-loader-map.php

Central loader map — single owner for "which file provides which class".

Source includes/Core/class-loader-map.php2 min readPart of Performance Optimisation

includes/Core/class-loader-map.php

Central loader map — single owner for \”which file provides which class\”.

Namespace: PerformanceOptimise\\Inc · Lines: 336

Class Loader_Map

Class Loader_Map

Source: includes/Core/class-loader-map.php, line 39

final class Loader_Map

Tags: @since 2.4.0

publicstatic base_dir()

public static function base_dir(): string

Base directory for plugin class files (with trailing slash).

Return: string — `WPPO_PLUGIN_PATH . \’includes/\’`, or \’\’ when the constant is undefined.

Tags: @since 2.4.0

Source: includes/Core/class-loader-map.php, line 47

publicstatic eager_files()

public static function eager_files(): array

Files always eager-loaded by `Main::includes()`, in load order.

Return: string[] — Relative paths under `includes/`, in load order.

Tags: @since 2.4.0

Source: includes/Core/class-loader-map.php, line 65

publicstatic litespeed_stack_files()

public static function litespeed_stack_files(): array

LiteSpeed-only crawler + ESI stack files (conditionally eager-loaded).

Return: string[] — Relative paths under `includes/`, in load order.

Tags: @since 2.4.0

Source: includes/Core/class-loader-map.php, line 96

publicstatic fallback_map()

public static function fallback_map(): array

Lazy fallback short-name-to-file map for `spl_autoload_register`.

Return: array<string,string> — Short class name => relative path under `includes/`.

Tags: @since 2.4.0

Source: includes/Core/class-loader-map.php, line 119

publicstatic allowed_dirs()

public static function allowed_dirs(): array

Canonical single-level subdirectories under `includes/`.

Return: string[].

Tags: @since 2.4.0

Source: includes/Core/class-loader-map.php, line 214

publicstatic file_path()

public static function file_path(string $relative_file): string

Absolute path for a relative file under `includes/`.

ParameterTypeDefaultDescription
$relative_filestring—Relative path (e.g. `Cache/class-cache.php`).

Return: string — Absolute path, or \’\’ when `WPPO_PLUGIN_PATH` is undefined or input is invalid.

Tags: @since 2.4.0

Source: includes/Core/class-loader-map.php, line 247

publicstatic path_for()

public static function path_for(string $class_name): ?string

Absolute path for a plugin short class name, or null when unknown.

ParameterTypeDefaultDescription
$class_namestring—Short, single-namespace, or fully-qualified class name.

Return: string|null — Absolute file path, or null when unmapped/undefined base.

Tags: @since 2.4.0

Source: includes/Core/class-loader-map.php, line 296

publicstatic cli_file()

public static function cli_file(): string

Absolute path of the WP-CLI command file.

Return: string — Absolute path, or \’\’ when `WPPO_PLUGIN_PATH` is undefined.

Tags: @since 2.4.0

Source: includes/Core/class-loader-map.php, line 332