allow exts to mark themselves as not supporting sqlite
This commit is contained in:
parent
a7d0158848
commit
df56213ec3
@ -1348,7 +1348,15 @@ function _set_event_listeners() {
|
|||||||
elseif(is_subclass_of($class, "Extension")) {
|
elseif(is_subclass_of($class, "Extension")) {
|
||||||
$extension = new $class();
|
$extension = new $class();
|
||||||
$extension->i_am($extension);
|
$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) {
|
foreach(get_class_methods($extension) as $method) {
|
||||||
if(substr($method, 0, 2) == "on") {
|
if(substr($method, 0, 2) == "on") {
|
||||||
$event = substr($method, 2) . "Event";
|
$event = substr($method, 2) . "Event";
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class Relationships extends Extension {
|
class Relationships extends Extension {
|
||||||
|
public $db_support = ['mysql', 'pgsql'];
|
||||||
|
|
||||||
public function onInitExt(InitExtEvent $event) {
|
public function onInitExt(InitExtEvent $event) {
|
||||||
global $config, $database;
|
global $config, $database;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user