排除的方法

@param string|array $method

@return $this
14346
public function methodsExcept($method) {
        if (is_string($method)) {
            $method = array($method);
        }
        $this->rule = "except";
        $this->method = $method;
        return $this;
    }
88395
final public function runAppController($method)
    {
        //检测csrf跨站攻击
        Secure::checkCsrf(Config::get('check_csrf'));

        // 关闭GPC过滤 防止数据的正确性受到影响 在db层防注入
        if (get_magic_quotes_gpc()) {
            Secure::stripslashes($_GET);
            Secure::stripslashes($_POST);
            Secure::stripslashes($_COOKIE);
            Secure::stripslashes($_REQUEST); //在程序中对get post cookie的改变不影响 request的值
        }

        //session保存方式自定义
        if (Config::get('session_user')) {
            Session::init();
        } else {
            ini_get('session.auto_start') || session_start(); //自动开启session
        }

        header('Cache-control: ' . Config::get('http_cache_control'));  // 页面缓存控制

        //如果有子类中有init()方法 执行Init() eg:做权限控制
        if (method_exists($this, "init")) {
            $this->init();
        }

        //根据动作去找对应的方法
        if (method_exists($this, $method)) {
            $response = $this->$method();
            if (is_array($response)) {
                if (Request::acceptJson()) {
                    View::getEngine('Json')
                        ->assign($response)
                        ->display();
                } else {
                    $tpl = isset($this->htmlEngineRenderTplArray[$method])
                        ? $this->htmlEngineRenderTplArray[$method]
                        : Cml::getContainer()->make('cml_route')->getControllerName() . '/' . $method;

                    call_user_func_array([View::getEngine('Html')->assign($response), is_array($tpl) ? 'displayWithLayout' : 'display'], is_array($tpl) ? $tpl : [$tpl]);
                }
            }
        } elseif (Cml::$debug) {
            Cml::montFor404Page();
            throw new \BadMethodCallException(Lang::get('_ACTION_NOT_FOUND_', $method));
        } else {
            Cml::montFor404Page();
            Response::show404Page();
        }
    }
1101502
public function setMethod($method)
	{
		$method = strtolower($method);

		if (!array_key_exists($method, static::$methods)) {
			throw new \InvalidArgumentException("Method [$method] not a valid HTTP method.");
		}

		if ($this->data && !static::$methods[$method]) {
			throw new \LogicException('Request has POST data, but tried changing HTTP method to one that does not allow POST data');
		}

		$this->method = $method;

		return $this;
	}
968316
public function setMethod($method = self::GET)
	{
		if (in_array($method, $this->allowedMethods)) {
			$this->method = $method;
		} else {
			throw new RuntimeException('Invalid method setted.');
		}
		
		return $this;
	}
1240133
public function invokeMethod($method, $vars = []) {
        if (is_array($method)) {
            $class = is_object($method[0]) ? $method[0] : $this->invokeClass($method[0]);
            $reflect = new \ReflectionMethod($class, $method[1]);
        } else {
            // 静态方法
            $reflect = new \ReflectionMethod($method);
        }
        $args = $this->bindParams($reflect, $vars);
        return $reflect->invokeArgs(isset($class) ? $class : null, $args);
    }
983170
public function allowMethods(array $methods = []): Route
    {
        $this->methods = [];
        foreach ($methods as $method) {
            $this->allowMethod($method);
        }

        return $this;
    }
749366
public function withMethod($method)
    {
        $method = strtoupper($method);

        if (false === in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'OPTIONS', 'DELETE'])) {
            throw new \InvalidArgumentException(
                sprintf('Invalid HTTP method: %s', $method)
            );
        }

        return $this->_clone('method', $method);
    }
649593
public function methods($method) {
        if (is_string($method)) {
            $method = array($method);
        }
        $this->rule = "only";
        $this->method = $method;
        return $this;
    }
1040370
public function setMethodOverride($method = NULL)
	{
		if($method === NULL)
		{
			$this->methodOverride = NULL;
		}
		else
		{
			$method = strtoupper($method);
			
			if(!preg_match("'^[A-Z]{2,}$'", $method))
			{
				throw new \InvalidArgumentException(sprintf('Invalid HTTP request method: "%s"', $method));
			}
			
			$this->methodOverride = $method;
		}
		
		return $this;
	}
1150016
public function setMethod($method = '')
    {
        if (mb_strlen($method) == 0) {
            $this->debug->debug(__FUNCTION__, 'Set Default Method = GET if $method is does not exist');
            $method = 'GET';
        } else {
            $method       = strtoupper($method);
            $validMethods = [
                'GET',
                'HEAD',
                'PUT',
                'POST',
                'DELETE'
            ];
            if (!in_array($method, $validMethods)) {
                $message = "Error: " . __CLASS__ . ": The requested method (${method}) is not valid here";
                $this->debug->error(__FUNCTION__, $message);

                return $message;
            }
        }
        $this->method = $method;

        return $this;
    }
1077360
public function setMethod($method)
    {
        $method = strtolower($method);
        if (!in_array($method, ['post', 'get'])) {
            throw new InvalidArgumentException(
                'Method must be "post" or "get"'
            );
        }
        $this->method = $method;

        return $this;
    }
872725
public function withMethods(array $methods)
    {
        foreach ($methods as $method => $args) {
            $this->withMethod($method, $args);
        }

        return $this;
    }
726913
public function setMethod( $method )
	{
		Deprecation::getInstance()
			->setErrorVersion( '0.8.4.7' )
			->setExceptionVersion( '0.9' )
			->message( 'Please use $request->getMethod()->set() instead' );
		$this->method->set( $method );
		return $this;
	}
982653
protected function setRequestMethod($method) {
    switch (strtoupper($method)) {
      case 'HEAD':
        curl_setopt($this->request, CURLOPT_NOBODY, true);
        break;
      case 'GET':
        # Hack to allow a request body to be set via CURLOPT_POSTFIELDS
        # for GET requests.
        curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, 'GET');
        break;
      case 'POST':
        curl_setopt($this->request, CURLOPT_POST, true);
        break;
      default:
        curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, $method);
    }
  }
479878
public function handle(string $method, array $arguments)
    {
        /**
         * @var Context $arguments[0]
         */
        try {
            if ($this->isRandom) {
                return $this->random($method, $arguments);
            }

            if ($method === 'evalMock') {
                return $this->evalMock($arguments);
            } else {
                $key = $arguments[1];
                //单key操作
                if (!is_array($key)) {
                    return $this->single($method, $key, $arguments);
                    // 批量操作
                } else {
                    return $this->multi($method, $key, $arguments);
                }
            }
        } catch (\Exception $e) {
            return false;
        }
    }
967637
public function setMethod($method) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');
        $name = $this->name ? ' name="'.$this->name.'"':'';
        $path = $this->path ? ' path="'.$this->path.'"':'';

        $method = strtoupper($method);
        if ($method!='GET' && $method!='POST') throw new StrutsConfigException('<mapping'.$name.''.$path.' methods="'.func_get_arg(0).'":  Invalid HTTP method.');

        $this->methods[$method] = true;
        return $this;
    }
926392
public function methodsEnd($method) {
        if (is_string($method)) {
            $method = array($method);
        }
        $this->rule = "end";
        $this->method = $method;
        return $this;
    }