Updates framework to support automated framework subclasses
All framework classes have been renamed to use the SihnonFramework_ prefix. The class autoloader now looks for subclasses of the framework classes in the Sihnon_Lib directory, and automatically creates them if they don't exist. The autoloader correctly creates interfaces and abstract classes as needed, by using reflection to check the type of the parent class. All references to classes within the framework now use the Sihnon_ prefix. The PluginFactory supports multiple scan directories, and will search both the framework and subclass class tree to find candidate plugins.
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Sihnon_Config_Plugin_Database extends Sihnon_PluginBase implements Sihnon_Config_IPlugin {
|
||||
|
||||
/**
|
||||
* Name of this plugin
|
||||
* @var string
|
||||
*/
|
||||
const PLUGIN_NAME = "Database";
|
||||
|
||||
private $database;
|
||||
private $table;
|
||||
|
||||
protected function __construct($options) {
|
||||
$this->database = $options['database'];
|
||||
$this->table = $options['table'];
|
||||
}
|
||||
|
||||
public static function create($options) {
|
||||
return new self($options);
|
||||
}
|
||||
|
||||
public function preload() {
|
||||
return $this->database->selectAssoc("SELECT name,type,value FROM {$this->table}", 'name', array('name', 'value', 'type'));
|
||||
}
|
||||
|
||||
public function save() {
|
||||
throw new Sihnon_Exception_NotImplemented();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Sihnon_Config_Plugin_FlatFile extends Sihnon_PluginBase implements Sihnon_Config_IPlugin {
|
||||
|
||||
/**
|
||||
* Name of this plugin
|
||||
* @var string
|
||||
*/
|
||||
const PLUGIN_NAME = "FlatFile";
|
||||
|
||||
protected $filename;
|
||||
|
||||
protected function __construct($options) {
|
||||
$this->filename = $options['filename'];
|
||||
}
|
||||
|
||||
public static function create($options) {
|
||||
return new self($options);
|
||||
}
|
||||
|
||||
public function preload() {
|
||||
return parse_ini_file($this->filename, true);;
|
||||
}
|
||||
|
||||
public function save() {
|
||||
throw new Sihnon_Exception_NotImplemented();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user