library/core/class.pluginmanager.php
public function RegisterPlugins() {

      // Loop through all declared classes looking for ones that implement Gdn_iPlugin.
      foreach (get_declared_classes() as $ClassName) {
         if ($ClassName == 'Gdn_Plugin')
            continue;

         // Only register the plugin if it implements the Gdn_IPlugin interface
         if (in_array('Gdn_IPlugin', class_implements($ClassName))) {

            // If this plugin was already indexed, skip it.
            if (array_key_exists($ClassName, $this->RegisteredPlugins))
               continue;

            // Register this plugin's methods
            $this->RegisterPlugin($ClassName);

         }
      }
   }
public function RegisterPlugins() {

      // Loop through all declared classes looking for ones that implement Gdn_iPlugin.
      foreach (get_declared_classes() as $ClassName) {
         if ($ClassName == 'Gdn_Plugin')
            continue;

         // Only register the plugin if it implements the Gdn_IPlugin interface
         if (in_array('Gdn_IPlugin', class_implements($ClassName))) {

            // If this plugin was already indexed, skip it.
            if (array_key_exists($ClassName, $this->RegisteredPlugins))
               continue;

            // Register this plugin's methods
            $this->RegisterPlugin($ClassName);

         }
      }
   }
public function RegisterPlugins ( ) { // Loop through all declared classes looking for ones that implement Gdn_iPlugin. foreach ( get_declared_classes ( ) as $ ClassName ) { if ( $ ClassName == 'Gdn_Plugin' ) continue ; // Only register the plugin if it implements the Gdn_IPlugin interface if ( in_array ( 'Gdn_IPlugin' , class_implements ( $ ClassName ) ) ) { // If this plugin was already indexed, skip it. if ( array_key_exists ( $ ClassName , $ this -> RegisteredPlugins ) ) continue ; // Register this plugin's methods $ this -> RegisterPlugin ( $ ClassName ) ; } } }
Register all enabled plugins' event handlers and overrides

Examines all declared classes, identifying which ones implement
Gdn_IPlugin and registers all of their event handlers and method
overrides. It recognizes them because Handlers end with _Handler,
_Before, and _After and overrides end with "_Override". They are prefixed
with the name of the class and method (or event) to be handled or
overridden.

For example:

class MyPlugin implements Gdn_IPlugin {
public function MyController_SignIn_After($Sender) {
// Do something neato
}
public function Url_AppRoot_Override($WithDomain) {
return "MyCustomAppRoot!";
}
}
Register all enabled plugins event handlers and overrides