protected function makePlugin($name, array $config)
    {
        $className = $name;
        if (strpos($className, '\\') === false) {
            $className = str_replace('/', '\\', $className) . '\\' . 'Plugin';
        }
        if (class_exists($className)) {
            return new $className($config);
        }

        if (!isset($config['path'])) {
            $config['path'] = $this->plugins->findPath($name);
        }
        $config['name'] = $name;

        return new BasePlugin($config);
    }
protected function makePlugin($name, array $config)
    {
        $className = $name;
        if (strpos($className, '\\') === false) {
            $className = str_replace('/', '\\', $className) . '\\' . 'Plugin';
        }
        if (class_exists($className)) {
            return new $className($config);
        }

        if (!isset($config['path'])) {
            $config['path'] = $this->plugins->findPath($name);
        }
        $config['name'] = $name;

        return new BasePlugin($config);
    }
protected function makePlugin ( $ name , array $ config ) { $ className = $ name ; if ( strpos ( $ className , '\\' ) === false ) { $ className = str_replace ( '/' , '\\' , $ className ) . '\\' . 'Plugin' ; } if ( class_exists ( $ className ) ) { return new $ className ( $ config ) ; } if ( ! isset ( $ config [ 'path' ] ) ) { $ config [ 'path' ] = $ this -> plugins -> findPath ( $ name ) ; } $ config [ 'name' ] = $ name ; return new BasePlugin ( $ config ) ; }
Create a plugin instance from a classname and configuration

@param string $name The plugin classname
@param array $config Configuration options for the plugin
@return \Cake\Core\PluginInterface
Create a plugin instance from a classname and configuration