allow exts to mark themselves as not supporting sqlite

This commit is contained in:
Shish 2015-08-08 22:23:07 +01:00
parent a7d0158848
commit df56213ec3
2 changed files with 11 additions and 1 deletions

View file

@ -1348,7 +1348,15 @@ function _set_event_listeners() {
elseif(is_subclass_of($class, "Extension")) {
$extension = new $class();
$extension->i_am($extension);
$my_events = array();
// skip extensions which don't support our current database
if(property_exists($extension, 'db_support')) {
global $database;
if(!in_array($database->get_driver_name(), $extension->db_support)) {
continue;
}
}
foreach(get_class_methods($extension) as $method) {
if(substr($method, 0, 2) == "on") {
$event = substr($method, 2) . "Event";

View file

@ -7,6 +7,8 @@
*/
class Relationships extends Extension {
public $db_support = ['mysql', 'pgsql'];
public function onInitExt(InitExtEvent $event) {
global $config, $database;