Autoloader
class Autoloader
Class Autoloader XELOS Autoloader for loading XELOS related class files Supporting XELOS Namespaces as well as a Fallback for files without namespace (XELOS < 7.0, DEPRECIATED)
Constants
TYPE_PSR_0 |
|
TYPE_PSR_4 |
|
Properties
static array | $file_prefix | File Prefixes used by XELOS in front of module name |
|
static string | $ns_prefix | XELOS Namespace Prefix |
|
static array | $classmap_cache | Lookup Cache |
|
static array | $modules_cache | Module Cache |
|
static array | $class_is_loaded | Loaded Classes |
|
static array | $class_alias | Class Alias Lookup |
|
static bool | $composer_autoloader_loaded | Identifies if the Composer Autoloader has already been loaded |
|
static string[] | $alias_blacklist | Problematic ClassNames which are conflicting with PHP internals or Major Extensions (e.g. PEAR) |
Methods
Forces all Code Caches to Reload (Classmap, OPCache,...) Should be called after a Code Deployment to enforce Revalidation
Error Handler to catch Fatal Error during Composer Autoload Init
Returns the passed name in underscore writing (TestClass --> test_class)
Returns module_name, vendor, path for XELOS Namespace
Returns the HDD filepath for the passed class
Returns the base path for the classmap based on the XELOS namespaced path
Extracts the module name from the full hdd path
Returns a list of all modules in the module and vendor/*module/ path
Extracts a full file path to a file namespace based on the path components if possible
Returns the base path for the classmap based on the XELOS namespaced path
Require Class File
Loads the passed class file
Returns all Classmap Details for the given class name
Register Required Autoloaders
Register COMPOSER Autoloader
Returns the passed name from underscore writing to CamelCase (test_class --> TestClass) Warning: Converting back to CamelCase is not unique in all cases! e.g. SystemDMS can not be regenerated from system_dms
Details
at line 834
static
clear_cache()
Forces all Code Caches to Reload (Classmap, OPCache,...) Should be called after a Code Deployment to enforce Revalidation
at line 108
static
composer_autoload_error_handler()
Error Handler to catch Fatal Error during Composer Autoload Init
at line 343
static string
from_camel_case(string $input, bool $without_ns = true)
Returns the passed name in underscore writing (TestClass --> test_class)
at line 580
static array
getClassInfoFromNS(string $class_name_with_ns)
Returns module_name, vendor, path for XELOS Namespace
at line 194
static bool|string
get_class_path(string $class_name, array $data = array())
Returns the HDD filepath for the passed class
at line 537
static bool|string
get_classmap_path_from_ns(string $class_name_with_ns)
Returns the base path for the classmap based on the XELOS namespaced path
at line 758
static string
get_module_name_from_path(string $path)
Extracts the module name from the full hdd path
at line 705
static mixed
get_modules(bool $cached = true)
Returns a list of all modules in the module and vendor/*module/ path
at line 783
static string
get_ns_from_path($path, $return_class_name = false)
Extracts a full file path to a file namespace based on the path components if possible
at line 566
static bool|string
get_path_from_ns(string $class_name_with_ns)
Returns the base path for the classmap based on the XELOS namespaced path
at line 127
static void
load_class(string $class_name)
Require Class File
The Lookup Logic consists of multiple stages, whereby the fastest method is used first:
- Try to lookup via ClassMap (This is the fastest version as it doesn't require any file operation, cached between requests)
- Try to lookup file via fallback method (Using manual dir check if NS is present)
- Fallback using PHP Include Path Scan (stream_resolve_include_path)
at line 180
static mixed
load_class_file(string $class_file)
Loads the passed class file
at line 234
static array|bool
lookup_classname_from_classmap($class_name, bool $additional_paths = false)
Returns all Classmap Details for the given class name
at line 73
static
register()
Register Required Autoloaders
at line 85
static
register_composer_loader(bool $load_class = false)
Register COMPOSER Autoloader
at line 368
static string
to_camel_case($input)
Returns the passed name from underscore writing to CamelCase (test_class --> TestClass) Warning: Converting back to CamelCase is not unique in all cases! e.g. SystemDMS can not be regenerated from system_dms