diff options
Diffstat (limited to 'plugins/Irc/extlib/phergie/Phergie/Plugin/Reload.php')
-rwxr-xr-x | plugins/Irc/extlib/phergie/Phergie/Plugin/Reload.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Reload.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Reload.php index a2d680d7a..90e3adcd5 100755 --- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Reload.php +++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/Reload.php @@ -57,6 +57,7 @@ class Phergie_Plugin_Reload extends Phergie_Plugin_Abstract if (!$this->plugins->hasPlugin($plugin)) { echo 'DEBUG(Reload): ' . ucfirst($plugin) . ' is not loaded yet, loading', PHP_EOL; $this->plugins->getPlugin($plugin); + $this->plugins->command->populateMethodCache(); return; } @@ -79,7 +80,7 @@ class Phergie_Plugin_Reload extends Phergie_Plugin_Abstract } $contents = preg_replace( - array('/<\?(?:php)?/', '/class\s+' . $class . '/i'), + array('/^<\?(?:php)?/', '/class\s+' . $class . '/i'), array('', 'class ' . $newClass), $contents ); @@ -87,10 +88,16 @@ class Phergie_Plugin_Reload extends Phergie_Plugin_Abstract $instance = new $newClass; $instance->setName($plugin); + $instance->setEvent($this->event); $this->plugins ->removePlugin($plugin) ->addPlugin($instance); + $this->plugins->command->populateMethodCache(); + if ($this->plugins->hasPlugin('Help')) { + $this->plugins->help->populateRegistry(); + } + echo 'DEBUG(Reload): Reloaded ', $class, ' to ', $newClass, PHP_EOL; } } |