ZMLoader
public class ZMLoader
| Constructor Summary | |
|---|---|
ZMLoader() Create a new loader. |
|
| Method Summary | |
|---|---|
| void | addPath(string path, boolean recursive) Add a given path to the loaders path. |
| protected mixed | create(string name, var arg) Resolve, load and instantiate a new instance of the given class. |
| static array | findIncludes(string dir, boolean recursive) Scan (recursively) for .php files. |
| protected string | getClassFile(string name) Get the class file for the given class name. |
| static array | getClassHierachy(mixed object) Get class hierachy for the given class/object. |
| array | getClassPath(boolean includeParent) Get the class path. |
| array | Returns a list of all the static code in this loaders path. |
| static ZMLoader | instance() Get the root loader. |
| void | Load all available static code. |
| static mixed | make(mixed args, string name, var arg) Shortcut for creating new class instances. |
| static string | makeClassname(string filename) Normalize class names based on the filename This is pretty much following Java conventions. |
| static string | resolve(string name) Resolve and load the class code for the given class name. |
| static void | resolveZCClass(string clazz) Resolve the given zen-cart class. |
| protected array | scan(string path, boolean recursive) Scan the given path for PHP files. |
| void | setParent(mixed parent) Set the parent loader. |
public ZMLoader()
Create a new loader. /
public void addPath(string path, boolean recursive)
Add a given path to the loaders path.
protected mixed create(string name, var arg)
Resolve, load and instantiate a new instance of the given class.
public static array findIncludes(string dir, boolean recursive)
Scan (recursively) for .php files.
It is worth mentioning that directories will always be processed only after all plain files in a directory are done.
true, scan recursively..php files.protected string getClassFile(string name)
Get the class file for the given class name.
null.public static array getClassHierachy(mixed object)
Get class hierachy for the given class/object.
public array getClassPath(boolean includeParent)
Get the class path.
true include the parent loader path: default is true.public array getStatic()
Returns a list of all the static code in this loaders path. Code is identified by a filename starting with a lower case character.
Note: This is an instance specific method. There is no delegation to a parent loader.
public static ZMLoader instance()
Get the root loader.
public void loadStatic()
Load all available static code.
Note: Using this is intended to load functions, defines, etc. As this is loaded inside a method, variables inside static files will not be real globals.
/public static mixed make(mixed args, string name, var arg)
Shortcut for creating new class instances.
public static string makeClassname(string filename)
Normalize class names based on the filename
This is pretty much following Java conventions.
public static string resolve(string name)
Resolve and load the class code for the given class name.
null.public static void resolveZCClass(string clazz)
Resolve the given zen-cart class.
This functuon ensures that the given class is loaded.
protected array scan(string path, boolean recursive)
Scan the given path for PHP files.
public void setParent(mixed parent)
Set the parent loader. /
ZenMagick code/class loader.
Loader might be chained to allow delegation of theme loading. All loader implement a parent first strategy.
Classes in ZenMagick have to adhere to the following conventions:
ZMIndexControllerand be namedIndexControllercreate(..)methodNote: This is not as scalable as Java code and does not handle more than on level of inheritance.
Static methods operate on the root loader.