Implements Config and Logging plugins, tidies Main

Added Database and Flatfile plugin engines for both Config and Log classes.
Rewrote Main to make use of the new plugins.
Updated config file definitions to make use of plugins.
This commit is contained in:
2010-10-10 17:11:44 +01:00
parent ddd2e62c13
commit 676fef1deb
15 changed files with 408 additions and 112 deletions

View File

@@ -4,6 +4,19 @@ abstract class Sihnon_PluginFactory implements Sihnon_IPluginFactory {
static private $validPlugins = array();
/**
* Scan the plugin directory for potential plugins, and load any valid ones found
*
* @param bool $force Rescan the plugin directory even if it has already been scanned before
*/
public static function scan($force = false) {
if ($force || ! isset(self::$validPlugins[get_called_class()])) {
$candidatePlugins = static::findPlugins(static::PLUGIN_DIR);
static::loadPlugins($candidatePlugins, static::PLUGIN_PREFIX, static::PLUGIN_INTERFACE);
}
}
protected static function ensureScanned() {
if (! isset(self::$validPlugins[get_called_class()])) {
static::scan();