MachII provides a convenient interface to lower-level framework classes as well as some globally useful functions.
Located in /MachII/MachII.php (line 66)
Constructor
Application programming interface version number
Currently this is set to the version number of the analogous reference implementation, Mach-II for ColdFusion.
Factory for creating a configured application loader.
In general this method should not be called directly; however, it is useful when implementing custom caching mechanisms and other higher level MachII_framework_AppLoader handlers.
MachII::appLoader() is called as follows:
- $appLoader =& MachII::appLoader($configPath, $configMode);
- if (MachII::isException($appLoader)) {
- // error handling
- }
Factory for creating a caching application loader.
It is strongly recommended that some form of caching be used with Mach-II. Due to the way it functions the entire application must be present when processing an event request. There is a relatively high overhead in preparing the application for use. The use of a cache prevents the recurrance of that overhead by reusing the prepared application. In its simplest form MachII::cache() only requires three parameters:
This will use MachII's built in user session cache, MachII_cache_PhpSession. It is not intended for high volume applications. For better scalability, use a cache system that allows a single MachII_framework_AppLoader to be shared by multiple users.
- $appLoader =& MachII::cache(
- $MACHII_CONFIG_PATH,
- $MACHII_CONFIG_MODE,
- $MACHII_APP_KEY
- );
- if (MachII::isException($appLoader)) {
- // error handling
- }
Note: MachII_cache_PhpSession will fail silently on PHP <4.1.0. The application will NOT be cached! Use an alternate cache.
To use another cache system, install the driver in MachII/cache/ and call it by its dot notation name. Any cache driver specific options or default overrides may be passed as an associative array.
- $appLoader =& MachII::cache(
- $MACHII_CONFIG_PATH,
- $MACHII_CONFIG_MODE,of
- $MACHII_APP_KEY,
- // use a cache driver that uses PEAR::Cache_Lite for storage
- 'MachII.cache.PearCacheLite',
- array(
- // override the cache directory
- 'cacheDir' => '/path/to/cache/dir/',
- // change the cache life time to 2 days
- 'lifeTime' => 172800
- )
- );
Check if a value is an exception.
Package version number
Shutdown method for caching application loader.
Documentation generated on Thu, 20 Jan 2005 10:47:03 -0800 by phpDocumentor 1.3.0RC3