Property | Type | Description | |
---|---|---|---|
$classes | |||
$functions | |||
$modules_dir | |||
$namespaces_dirs | |||
$search_log | |||
$warn_about_not_found |
Method | Description | |
---|---|---|
__construct ( boolean $autostart = true ) | ||
autoload ( string $class_name ) : boolean | ||
get_modules_dir ( ) : string | Return modules dir like "/home/dir/modules" By default will be taken directory of this file without two last folders (__DIR__.'/. | |
get_namespaces ( ) | ||
get_search_log ( ) | ||
register_class ( string $class_name, string $path ) : boolean | Register class - associate name of the class with path to the file (mapping) | |
register_namespace_dir ( string $namespace, string $dir ) | Associate namespace with directory For example, if namespace '\name\space' will be associated with directory '/home/name/space', class '\name\space\subnamespace\Class_Name.php' will be looked in /home/name/space/subnamespace/Class_Name.php | |
set_modules_dir ( string $dir ) : void | Set directory of modules ("vendors") | |
set_warn_about_not_found ( $warn_about_not_found = true ) | ||
start ( ) | start autoloader (register in spl_autoload) |
Method | Description | |
---|---|---|
define_home_dir_constant ( ) | Define HOME_DIR - by this constant other modules can check, if autoloader is exists | |
generate_filepath ( $dir, $class_path ) | ||
include_class_file ( $class_name, $file ) | ||
log_search_variant ( string $method_title, string $class_name, string $filepath = '' ) | Add next variant of filepath from searching method to the log |
Method | Description | |
---|---|---|
find_in_classes ( string $class_name ) : boolean | Find classname in registered classes | |
find_in_namespaces ( string $class ) : boolean | string | Find path to the file of class in registered namespaces (root namespace is registered automatically) | |
lookFileInNamespaceDir ( $class_namespace, $mapped_namespace, $class_name, $mapped_dir ) | ||
register_root_namespace ( ) : void | Register "vendors" directory as root namespace | |
warning_class_not_found ( $class_name ) |
public __construct ( boolean $autostart = true ) | ||
$autostart | boolean | - call method start in constructor |
protected define_home_dir_constant ( ) |
public register_namespace_dir ( string $namespace, string $dir ) | ||
$namespace | string | name\space\ (last symbol - slash, and no slashes in start) |
$dir | string |
public set_modules_dir ( string $dir ) : void | ||
$dir | string | |
return | void |
public set_warn_about_not_found ( $warn_about_not_found = true ) |