Class Dwoo_Loader

Description

Implements interfaces:

handles plugin loading and caching of plugins names/paths relationships

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

This file is released under the LGPL "GNU Lesser General Public License" More information can be found here: http://www.gnu.org/copyleft/lesser.html

Located in /Dwoo/Loader.php (line 22)


	
			
Variable Summary
static mixed $classpath
string $cacheDir
array $classPath
array $paths
Method Summary
Dwoo_Loader __construct ( $cacheDir)
void addDirectory (string $pluginDir)
void loadPlugin (string $class, [bool $forceRehash = true])
void rebuildClassPathCache (string $path, string $cacheFile)
Variables
static mixed $classpath = array() (line 55)

legacy/transitional var for BC with old classpath.cache files, do NOT rely on it

will be deleted sooner or later

TODO remove this and compat code in addDirectory

  • access: public
string $cacheDir (line 46)

path where class paths cache files are written

  • access: protected
array $classPath = array() (line 39)

stores the plugins names/paths relationships don't edit this on your own, use addDirectory

array $paths = array() (line 30)

stores the plugin directories

Methods
Constructor __construct (line 57)
  • access: public
Dwoo_Loader __construct ( $cacheDir)
  • $cacheDir
addDirectory (line 139)

adds a plugin directory, the plugins found in the new plugin directory

will take precedence over the other directories (including the default dwoo plugin directory), you can use this for example to override plugins in a specific directory for a specific application while keeping all your usual plugins in the same place for all applications.

TOCOM don't forget that php functions overrides are not rehashed so you need to clear the classpath caches by hand when adding those

  • access: public
void addDirectory (string $pluginDir)
  • string $pluginDir: the plugin path to scan
loadPlugin (line 107)

loads a plugin file

  • access: public
void loadPlugin (string $class, [bool $forceRehash = true])
  • string $class: the plugin name, without the Dwoo_Plugin_ prefix
  • bool $forceRehash: if true, the class path caches will be rebuilt if the plugin is not found, in case it has just been added, defaults to true

Implementation of:
Dwoo_ILoader::loadPlugin()
loads a plugin file
rebuildClassPathCache (line 73)

rebuilds class paths, scans the given directory recursively and saves all paths in the given file

  • access: protected
void rebuildClassPathCache (string $path, string $cacheFile)
  • string $path: the plugin path to scan
  • string $cacheFile: the file where to store the plugin paths cache, it will be overwritten

Documentation generated on Sun, 03 Aug 2008 15:12:40 +0200 by phpDocumentor 1.4.0