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
string $cacheDir
array $classPath
array $paths
Method Summary
Dwoo_Loader __construct ( $cacheDir)
void addDirectory (string $pluginDirectory)
void loadPlugin (string $class, [bool $forceRehash = true])
void rebuildClassPathCache (string $path, string $cacheFile)
Variables
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

mixed $corePluginDir (line 48)
  • access: protected
array $paths = array() (line 30)

stores the plugin directories

Methods
Constructor __construct (line 50)
  • access: public
Dwoo_Loader __construct ( $cacheDir)
  • $cacheDir
addDirectory (line 136)

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 $pluginDirectory)
  • string $pluginDirectory: the plugin path to scan
loadPlugin (line 104)

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 70)

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, 07 Sep 2008 23:57:53 +0200 by phpDocumentor 1.4.0