Diff of /plugins/plugin.php [40ad84] .. [6591d4]  Maximize  Restore

  Switch to unified view

a/plugins/plugin.php b/plugins/plugin.php
...
...
18
    
18
    
19
    /** Register plugins
19
    /** Register plugins
20
    * @param array object instances or null to register all classes starting by 'Adminer'
20
    * @param array object instances or null to register all classes starting by 'Adminer'
21
    */
21
    */
22
    function AdminerPlugin($plugins) {
22
    function AdminerPlugin($plugins) {
23
      if (!isset($plugins)) {
23
      if ($plugins === null) {
24
            $plugins = array();
24
            $plugins = array();
25
            foreach (get_declared_classes() as $class) {
25
            foreach (get_declared_classes() as $class) {
26
                if (preg_match('~^Adminer.~i', $class) && strcasecmp($this->_findRootClass($class), 'Adminer')) { // can use interface since PHP 5
26
                if (preg_match('~^Adminer.~i', $class) && strcasecmp($this->_findRootClass($class), 'Adminer')) { // can use interface since PHP 5
27
                    $plugins[$class] = new $class;
27
                    $plugins[$class] = new $class;
28
                }
28
                }
...
...
52
                    case 2: $return = $plugin->$function($args[0], $args[1]); break;
52
                    case 2: $return = $plugin->$function($args[0], $args[1]); break;
53
                    case 3: $return = $plugin->$function($args[0], $args[1], $args[2]); break;
53
                    case 3: $return = $plugin->$function($args[0], $args[1], $args[2]); break;
54
                    case 4: $return = $plugin->$function($args[0], $args[1], $args[2], $args[3]); break;
54
                    case 4: $return = $plugin->$function($args[0], $args[1], $args[2], $args[3]); break;
55
                    default: trigger_error('Too many parameters.', E_USER_WARNING);
55
                    default: trigger_error('Too many parameters.', E_USER_WARNING);
56
                }
56
                }
57
              if (isset($return)) {
57
              if ($return !== null) {
58
                    return $return;
58
                    return $return;
59
                }
59
                }
60
            }
60
            }
61
        }
61
        }
62
        return $this->_callParent($function, $args);
62
        return $this->_callParent($function, $args);

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks