{eac}Doojigger Reference

eacDoojiggerAutoloader

{eac}DoojiggerAutoloader class - {eac}Doojigger for WordPress, Autoloader class for EarthAsylum Consulting {eac} Doojigger for WordPress classes and traits

Tags
category

WordPress Plugin

author

Kevin Burkholder KBurkholder@EarthAsylum.com

copyright

Copyright 2024 EarthAsylum Consulting <www.EarthAsylum.com> Version: 24.0904.1

link
https://eacDoojigger.earthasylum.com/

Table of Contents

AUTOLOAD_TYPES  = [ // namespace = file suffix (maybe) 'Plugin' => 'plugin', 'Plugins' => 'plugin', 'Extensions' => 'extension', 'Helpers' => 'helper', 'Classes' => 'class', // default 'Traits' => 'trait', 'Interfaces' => 'interface', 'Exceptions' => 'exception', ]
FILE_PATTERNS  = [ '%1$s.%2$s.php', // <classname>.<type>.php 'class.%1$s.%2$s.php', // class.<classname>.<type>.php '%1$s.class.php', // <classname>.class.php 'class.%1$s.php', // class.<classname>.php '%1$s.php', ]
$history  : array<string|int, mixed>
$validNamespace  : array<string|int, mixed>
addNamespace()  : bool
add namespace and root directory
autoLoader()  : void
autoloader
debugAutoLoader()  : void
register the autoloader for the default and (maybe) derivative namespace
setAutoLoader()  : void
register the autoloader for the default and (maybe) derivative namespace
setEmailNotification()  : void
set the fatal email loader - no longer supported

Constants

AUTOLOAD_TYPES

public array<string|int, mixed> AUTOLOAD_TYPES = [ // namespace = file suffix (maybe) 'Plugin' => 'plugin', 'Plugins' => 'plugin', 'Extensions' => 'extension', 'Helpers' => 'helper', 'Classes' => 'class', // default 'Traits' => 'trait', 'Interfaces' => 'interface', 'Exceptions' => 'exception', ]

map object namespace to file type

FILE_PATTERNS

public array<string|int, mixed> FILE_PATTERNS = [ '%1$s.%2$s.php', // <classname>.<type>.php 'class.%1$s.%2$s.php', // class.<classname>.<type>.php '%1$s.class.php', // <classname>.class.php 'class.%1$s.php', // class.<classname>.php '%1$s.php', ]

file name patterns to look for - %1$s = classname, %2$s = classtype

Properties

$validNamespace

public static array<string|int, mixed> $validNamespace = []

static array of [namespace => [ root_directory, ... ] ]

Methods

addNamespace()

add namespace and root directory

public static addNamespace(string $namespace, string $root) : bool
Parameters
$namespace : string
$root : string
Tags
params

string $namespace root namespace name (namespace or namespace\subnamespace)

params

string $root root directory for above namespace

Return values
bool

success

autoLoader()

autoloader

public static autoLoader(string $class) : void
Parameters
$class : string
Tags
params

string $class class to be loaded (NameSpace\SubNameSpace\MaybeType\ClassName)

Return values
void

debugAutoLoader()

register the autoloader for the default and (maybe) derivative namespace

public static debugAutoLoader(array<string|int, mixed> $debug_array) : void
Parameters
$debug_array : array<string|int, mixed>
Tags
params

string $namespace derivative plugin root namespace

params

string $root derivative plugin root directory - 'wp-content/plugins/plugin_folder/NameSpace'

Return values
void

setAutoLoader()

register the autoloader for the default and (maybe) derivative namespace

public static setAutoLoader([string $namespace = '' ][, string $root = '' ]) : void
Parameters
$namespace : string = ''
$root : string = ''
Tags
params

string $namespace derivative plugin root namespace

params

string $root derivative plugin root directory - 'wp-content/plugins/plugin_folder/NameSpace'

Return values
void

setEmailNotification()

set the fatal email loader - no longer supported

public static setEmailNotification(string $loaderClassName) : void
Parameters
$loaderClassName : string
Tags
params

string $loaderClassName plugin class name (short)

Return values
void

Search results