concrete/src/Editor/PluginManager.php
public function register($plugin, $name = null)
    {
        if ($plugin instanceof Plugin) {
            $key = $plugin->getKey();
            $p = $plugin;
        } else {
            if (!$name) {
                throw new Exception(t('You must specify a plugin key and name.'));
            }
            $key = $plugin;
            $p = new Plugin();
            $p->setKey($key);
            $p->setName($name);
        }
        $this->plugins[$key] = $p;
    }
public function register($plugin, $name = null)
    {
        if ($plugin instanceof Plugin) {
            $key = $plugin->getKey();
            $p = $plugin;
        } else {
            if (!$name) {
                throw new Exception(t('You must specify a plugin key and name.'));
            }
            $key = $plugin;
            $p = new Plugin();
            $p->setKey($key);
            $p->setName($name);
        }
        $this->plugins[$key] = $p;
    }
public function register ( $ plugin , $ name = null ) { if ( $ plugin instanceof Plugin ) { $ key = $ plugin -> getKey ( ) ; $ p = $ plugin ; } else { if ( ! $ name ) { throw new Exception ( t ( 'You must specify a plugin key and name.' ) ) ; } $ key = $ plugin ; $ p = new Plugin ( ) ; $ p -> setKey ( $ key ) ; $ p -> setName ( $ name ) ; } $ this -> plugins [ $ key ] = $ p ; }
Register a new plugin, adding it to the list of available plugins.

@param \Concrete\Core\Editor\Plugin|string $plugin the plugin to register (or its handle)
@param string|null $name the name of the plugin (if $plugin is the plugin handle

@throws \Exception throws an Exception if $plugin is the plugin handle, but $name is empty
Register a new plugin adding it to the list of available plugins .