protected static
|
#
_load( string $module, string $filename, Core\Profiler $profiler )
Internal actual module loader.
Internal actual module loader.
Parameters
- $module
- Name of module to load.
- $filename
Filename of module to load. Automatically resolves the file based on
the PHP include path.
- $profiler
Profiler instance used to record time and memory states for the module.
Set to null to disable profiler.
Throws
Since
3.0
|
public static
string
|
#
classNameFromModule( $module )
Returns the default class name for a given module.
Returns the default class name for a given module.
The standard class name of a module is the class with the same namespace
and base name as the requested module. Note, that the returned value
does not implicate the existence of such a class.
Parameters
- $module
- of module to extract default class name from.
Returns
string Standard class name for the module with full namespace hierarchy.
Since
3.1
|
public static
string
|
#
cleanupModuleName( $module )
Returns the unified module name from a given string.
Returns the unified module name from a given string.
Parameters
- $module
- name to return unified variant for.
Returns
string Unified module name.
Since
3.1
|
public static
string
|
#
driverNameFromClassAndScheme( $class, $scheme )
Formats class name for driver factories.
Formats class name for driver factories.
Parameters
- $class
of base class to render driver name for. Usually __CLASS__ is
used for standard driver factories. Namespace prefix is mandatory.
- $scheme
or Core\URI instance to derive driver class name from.
If a Core\URI instance is given, the scheme is automatically
extracted. If a provided Core\URI instance includes a scheme
namespace, the primary namespace of the given class bane is replaced by
the scheme namespace. This is useful to provide inter-library class
hierarchies, e.g. applications usually placing views in their own
namespace to avoid cluttering the Core namespace.
Returns
string Class name including namespace information, Core\URI scheme
and base class name.
Since
3.1
|
public static
string
|
#
encodeName( $string )
Returns a function, module and class name-safe variant of a string. All
characters except alphanumeric characters and underscores are removed.
Returns a function, module and class name-safe variant of a string. All
characters except alphanumeric characters and underscores are removed.
Parameters
- $string
- to return name-safe variant of.
Returns
string Variant of source string that is safe to use as a file, module, class,
function and variable name. If the resulting string is of empty, a
single underscore is returned instead.
See
Since
3.1
|
public static
string
|
#
encodeNameFS( string $string )
Returns a filesystem-safe version of a given string. All characters
which may not be handled correctly by some file system are replaced
with an underscore.
Returns a filesystem-safe version of a given string. All characters
which may not be handled correctly by some file system are replaced
with an underscore.
No characters are truncated from the filename. The returned string has
the same length as the original string.
Parameters
- $string
- String to return filesystem-safe variant of.
Returns
string Variant of source string with all characters not being a Latin alphabet
letter or number, minus sign, underscore or dot replaced by an underscore.
See
Since
3.1
|
public static
string[]
|
#
getLoadedModules( )
Returns an array containing all loaded module names.
Returns an array containing all loaded module names.
Returns
string[] Array of loaded module names.
Since
3.0
|
public static
string
|
#
getModuleFilename( $module, $omitSuffix = false )
Returns the filename for a given module identifier.
Returns the filename for a given module identifier.
Note, that this method does not test, whether the resulting filename
exists.
Parameters
- $module
- name to retrieve filename for.
- $omitSuffix
set to a value that evaluates to true , the filename suffix is
omitted. Defaults to false .
Returns
string Filename of given module.
Since
3.0
|
public static
array|false
|
#
getModuleInfo( string $module )
Returns information set on a specified module.
Returns information set on a specified module.
Parameters
- $module
- Name of module to retrieve information for.
Returns
array|false Associative array of module information of false if the named module
is not loaded.
Since
3.0
\todo Prototype. Planned to include further module information.
|
public static
|
#
getModuleInfoList( )
Returns an array of all loaded modules with their information sets.
Returns an array of all loaded modules with their information sets.
Since
3.0
\todo Prototype, probably obsolete.
|
public static
string|false
|
#
getModuleWithFilename( $filename )
Returns the name of a registered module based on the filename.
Returns the name of a registered module based on the filename.
Parameters
- $filename
- to search module for.
Returns
string|false Name of module with given filename, otherwise false .
Since
3.1
|
public static
boolean
|
#
loadModule( $arg1 )
Loads a set of given module names.
Loads a set of given module names.
Parameters
- $arg1
of modules to load. Multiple module name arguments are supported.
Requires fully qualified module names (with full namespace hierarchy).
Returns
boolean
true on success, otherwise an exception is thrown.
Throws
Core\Exception\Loader Either the module name does not contain the full namespace hierarchy,
the module file does not exist or is not readable.
Event
Observers are notified after a module has been loaded.
See
Since
3.0
|
public static
Core\Delegate
|
#
observeModuleLoaded( $objectOrString, string $methodName = null )
Registers an observer for the Module.Loaded event.
Registers an observer for the Module.Loaded event.
Parameters
Returns
Throws
Since
3.1
|
public static
|
#
registerModule( $version )
Registers module information for the currently loaded module. This is
the first method a regular module should call:
Registers module information for the currently loaded module. This is
the first method a regular module should call:
Loader::registerModule ('1.0-dev (revision)');
A call to this method is only valid for modules loaded via the Core
module loader interface. Otherwise an exception is thrown.
Parameters
- $version
- version string or
false , if no version information is available.
Throws
Since
3.0
|