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:
27
source/lib/Sihnon/Config/PluginFactory.class.php
Normal file
27
source/lib/Sihnon/Config/PluginFactory.class.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
class Sihnon_Config_PluginFactory extends Sihnon_PluginFactory {
|
||||
|
||||
const PLUGIN_DIR = 'Sihnon/Config/Plugin/';
|
||||
const PLUGIN_PREFIX = 'Sihnon_Config_Plugin_';
|
||||
const PLUGIN_INTERFACE = 'Sihnon_Config_IPlugin';
|
||||
|
||||
public static function init() {
|
||||
|
||||
}
|
||||
|
||||
public static function create($plugin, $options) {
|
||||
self::ensureScanned();
|
||||
|
||||
if (! self::isValidPlugin($plugin)) {
|
||||
throw new Sihnon_Exception_InvalidPluginName($plugin);
|
||||
}
|
||||
|
||||
$classname = self::classname($plugin);
|
||||
|
||||
return call_user_func(array($classname, 'create'), $options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user