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.

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


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

path where class paths cache files are written

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

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

mixed $corePluginDir (line 43)
  • access: protected
array $paths = array() (line 25)

stores the plugin directories

Methods
Constructor __construct (line 45)
  • access: public
Dwoo_Loader __construct ( $cacheDir)
  • $cacheDir
addDirectory (line 131)

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

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

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 Sat, 18 Jul 2009 21:05:12 +0200 by phpDocumentor 1.4.0