src/Vectorface/SnappyRouter/Plugin/AbstractPlugin.php
public function supportsControllerAndAction($controller, $action)
    {
        if (null === $this->blacklist) {
            if (null === $this->whitelist) {
                // plugin has global scope
                return true;
            }
            // we use a whitelist so ensure the controller is in the whitelist
            if (!isset($this->whitelist[$controller])) {
                return false;
            }
            // the whitelisted controller could be an array of actions or it could
            // be mapped to the "all" string
            if (is_array($this->whitelist[$controller])) {
                return in_array($action, $this->whitelist[$controller]);
            }
            return (self::ALL_ACTIONS === (string)$this->whitelist[$controller]);
        }
        // if the controller isn't in the blacklist at all, we're good
        if (!isset($this->blacklist[$controller])) {
            return true;
        }

        // if the controller is not an array we return false
        // otherwise we check if the action is listed in the array
        return is_array($this->blacklist[$controller]) &&
              !in_array($action, $this->blacklist[$controller]);
    }
public function supportsControllerAndAction($controller, $action)
    {
        if (null === $this->blacklist) {
            if (null === $this->whitelist) {
                // plugin has global scope
                return true;
            }
            // we use a whitelist so ensure the controller is in the whitelist
            if (!isset($this->whitelist[$controller])) {
                return false;
            }
            // the whitelisted controller could be an array of actions or it could
            // be mapped to the "all" string
            if (is_array($this->whitelist[$controller])) {
                return in_array($action, $this->whitelist[$controller]);
            }
            return (self::ALL_ACTIONS === (string)$this->whitelist[$controller]);
        }
        // if the controller isn't in the blacklist at all, we're good
        if (!isset($this->blacklist[$controller])) {
            return true;
        }

        // if the controller is not an array we return false
        // otherwise we check if the action is listed in the array
        return is_array($this->blacklist[$controller]) &&
              !in_array($action, $this->blacklist[$controller]);
    }
public function supportsControllerAndAction ( $ controller , $ action ) { if ( null === $ this -> blacklist ) { if ( null === $ this -> whitelist ) { // plugin has global scope return true ; } // we use a whitelist so ensure the controller is in the whitelist if ( ! isset ( $ this -> whitelist [ $ controller ] ) ) { return false ; } // the whitelisted controller could be an array of actions or it could // be mapped to the "all" string if ( is_array ( $ this -> whitelist [ $ controller ] ) ) { return in_array ( $ action , $ this -> whitelist [ $ controller ] ) ; } return ( self :: ALL_ACTIONS === ( string ) $ this -> whitelist [ $ controller ] ) ; } // if the controller isn't in the blacklist at all, we're good if ( ! isset ( $ this -> blacklist [ $ controller ] ) ) { return true ; } // if the controller is not an array we return false // otherwise we check if the action is listed in the array return is_array ( $ this -> blacklist [ $ controller ] ) && ! in_array ( $ action , $ this -> blacklist [ $ controller ] ) ; }
Returns whether or not the given controller and action requested should
invoke this plugin.
@param string $controller The requested controller.
@param string $action The requested action.
@return boolean Returns true if the given plugin is allowed to run against
this controller/action and false otherwise.
Returns whether or not the given controller and action requested should invoke this plugin .