public function executePlugin($plugin, $options)
    {
        // Any plugin name without a namespace separator is a PHPCI built in plugin
        // if not we assume it's a fully name-spaced class name that implements the plugin interface.
        // If not the factory will throw an exception.
        if (strpos($plugin, '\\') === false) {
            $class = str_replace('_', ' ', $plugin);
            $class = ucwords($class);
            $class = 'PHPCI\\Plugin\\' . str_replace(' ', '', $class);
        } else {
            $class = $plugin;
        }

        if (!class_exists($class)) {
            $this->logger->logFailure(Lang::get('plugin_missing', $plugin));
            return false;
        }

        try {
            // Build and run it
            $obj = $this->pluginFactory->buildPlugin($class, $options);
            return $obj->execute();
        } catch (\Exception $ex) {
            $this->logger->logFailure(Lang::get('exception') . $ex->getMessage(), $ex);
            return false;
        }
    }
public function executePlugin($plugin, $options)
    {
        // Any plugin name without a namespace separator is a PHPCI built in plugin
        // if not we assume it's a fully name-spaced class name that implements the plugin interface.
        // If not the factory will throw an exception.
        if (strpos($plugin, '\\') === false) {
            $class = str_replace('_', ' ', $plugin);
            $class = ucwords($class);
            $class = 'PHPCI\\Plugin\\' . str_replace(' ', '', $class);
        } else {
            $class = $plugin;
        }

        if (!class_exists($class)) {
            $this->logger->logFailure(Lang::get('plugin_missing', $plugin));
            return false;
        }

        try {
            // Build and run it
            $obj = $this->pluginFactory->buildPlugin($class, $options);
            return $obj->execute();
        } catch (\Exception $ex) {
            $this->logger->logFailure(Lang::get('exception') . $ex->getMessage(), $ex);
            return false;
        }
    }
public function executePlugin ( $ plugin , $ options ) { // Any plugin name without a namespace separator is a PHPCI built in plugin // if not we assume it's a fully name-spaced class name that implements the plugin interface. // If not the factory will throw an exception. if ( strpos ( $ plugin , '\\' ) === false ) { $ class = str_replace ( '_' , ' ' , $ plugin ) ; $ class = ucwords ( $ class ) ; $ class = 'PHPCI\\Plugin\\' . str_replace ( ' ' , '' , $ class ) ; } else { $ class = $ plugin ; } if ( ! class_exists ( $ class ) ) { $ this -> logger -> logFailure ( Lang :: get ( 'plugin_missing' , $ plugin ) ) ; return false ; } try { // Build and run it $ obj = $ this -> pluginFactory -> buildPlugin ( $ class , $ options ) ; return $ obj -> execute ( ) ; } catch ( \ Exception $ ex ) { $ this -> logger -> logFailure ( Lang :: get ( 'exception' ) . $ ex -> getMessage ( ) , $ ex ) ; return false ; } }
Executes a given plugin, with options and returns the result.
Executes a given plugin with options and returns the result .