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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user