Views : 1091  |
------------- To be completed
-------------
In most cases, you don't have to call this API explicitely, and your source code
should not need any modification to be included in a PHK archive (except the
include/require suppression). But, if you want to interact with the PHK layer
(as when creating a plugin system), you will use the following API. Please
refer to the PHK_Creator
API for an explanation of these methods.
1 - The PHP API
1.1 - The PHK_Mgr class
This is a static-only class. It has the responsability to manage the table of
currently mounted packages. Each package is uniquely identified by a 'mount
point', which is a string computed at mount time. The PHK_Mgr class contains the
methods allowing to get information from its table, as well as methods to mount
and umount a package.
1.1.1 - Methods
All these methods are static.
1.1.1.1 - PHK_Mgr::instance($mnt)
1.1.1.2 - PHK_Mgr::is_a_phk_uri($uri)
1.1.1.3 - PHK_Mgr::is_mounted($mnt)
1.1.1.4 - PHK_Mgr::mnt_list()
1.1.1.5 - PHK_Mgr::mount($path, [$flags])
1.1.1.6 - PHK_Mgr::umount($mnt)
1.1.1.7 - PHK_Mgr::uri_to_mnt($uri)
1.2 - The PHK class
Each PHK instance controls a package file. This package file can be a 'real'
file or, in case of a subpackage a subfile of an upper(level package. There is
no limit to the recursion depth of subpackages.
You get the PHK object instance by calling PHK_Mgr::instance with a mount
point. This mount point is generally returned either by an include, when
including a package, or by PHK_Mgr::uri_to_mnt().
1.2.1 - Methods
1.2.1.1 - accelerator_is_present()
1.2.1.2 - file_is_package($path)
1.2.1.3 - auto_file($prefix)
1.2.1.4 - auto_option($option)
1.2.1.5 - base_uri()
1.2.1.6 - is_callable_plugin_method($method)
1.2.1.7 - call_plugin_method($method [, $args,...])
1.2.1.8 - crc_check()
1.2.1.9 - flags()
1.2.1.10 - is_php_source_path($path)
1.2.1.11 - mnt()
1.2.1.12 - option($option)
1.2.1.13 - parent_mnt()
1.2.1.14 - path()
1.2.1.15 - path_list()
1.2.1.16 - plugin()
1.2.1.17 - uri($path)
1.2.1.18 - user_option($option)
1.3 - The Autoload API
The autoloader works mostly in a transparent way, loading classes when they
are needed.
Unfortunately, as long as PHP does not support function and constants
autoloading, it cannot transparently load the functions and constants contained
in a package. So, if you want function/constant autoloading, it is possible but
you will have to ask explicitely the autoloader to load them.
1.3.1 - Methods
1.3.1.1 - get_function($name)
1.3.1.2 - require_function($name)
1.3.1.3 - get_constant($name)
1.3.1.4 - require_constant($name)
Last update : Sunday, 16 September 2007
|