handleCommandMessage

@param SabreAMF_AMF3_CommandMessage $request
@return Sabre_AMF3_AbstractMessage
348735
private function handleCommandMessage(SabreAMF_AMF3_CommandMessage $request) {

            switch($request->operation) {

                case SabreAMF_AMF3_CommandMessage::CLIENT_PING_OPERATION :
                    $response = new SabreAMF_AMF3_AcknowledgeMessage($request);
                    break;
                case SabreAMF_AMF3_CommandMessage::LOGIN_OPERATION :
                    $authData = base64_decode($request->body);
                    if ($authData) {
                        $authData = explode(':',$authData,2);
                        if (count($authData)==2) {
                            $this->authenticate($authData[0],$authData[1]);
                        }
                    }
                    $response = new SabreAMF_AMF3_AcknowledgeMessage($request);
                    $response->body = true;
                    break;
                case SabreAMF_AMF3_CommandMessage::DISCONNECT_OPERATION :
                    $response = new SabreAMF_AMF3_AcknowledgeMessage($request);
                    break;
                default :
                    throw new Exception('Unsupported CommandMessage operation: '  . $request->operation);

            }
            return $response;

        }
1349217
public function handle(Request $request) : Response
    {
        try {
            return (new Pipeline)
                ->send($request)
                ->through($this->convertMiddlewareToPipelineStages($this->getMiddleware()), 'handle')
                ->then(function ($request) {
                    return $this->router->route($request);
                })
                ->execute();
        } catch (Exception $ex) {
            $this->setExceptionRendererVars($request);
            $this->exceptionHandler->handle($ex);

            return $this->exceptionRenderer->getResponse();
        } catch (Throwable $ex) {
            $this->setExceptionRendererVars($request);
            $this->exceptionHandler->handle($ex);

            return $this->exceptionRenderer->getResponse();
        }
    }
1113074
public function handleRequest(ServerRequestInterface $request)
    {
        $requestBody = (array) $request->getParsedBody();

        // Set debug mode
        $this->debugMode = isset($requestBody['custom_debug']) && (strtolower($requestBody['custom_debug']) == 'true');

        // Set return URL if available
        if (isset($requestBody['launch_presentation_return_url'])) {
            $this->returnUrl = $requestBody['launch_presentation_return_url'];
        } else if (isset($requestBody['content_item_return_url'])) {
            $this->returnUrl = $requestBody['content_item_return_url'];
        }

        // Perform action
        if ($this->authenticate($request)) {
            $this->doCallback($requestBody);
        }

        $this->result();
    }
211661
public function handle(Request $request) : Response
    {
        try {
            return $this->handleRequest($request);
        } catch (HttpException $e) {
            return $this->handleHttpException($e, $request);
        } catch (\Throwable $e) {
            return $this->handleUncaughtException($e, $request);
        }
    }
611672
protected function parseContentRequest(Request $request)
    {
        return $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type'), 'Url' => $request->getPathInfo()),
                $request->getContent()
            )
        );
    }
164768
public function handle(Request $request)
	{
		$response = $this->next($request);

		$class = $this->app->get('arguments')->get('class');
		$task  = $this->app->get('arguments')->get('task');

		$command   = new $class($this->app->get('output'), $this->app->get('arguments'));
		$shortName = strtolower(with(new \ReflectionClass($command))->getShortName());

		// Fire default before event
		Event::fire($shortName . '.' . 'before' . ucfirst($task));

		$command->{$task}();

		// Fire default after event
		Event::fire($shortName . '.' . 'after' . ucfirst($task));

		$this->app->get('output')->render();

		return $response;
	}
1330399
public function handle($command)
    {
        $message = $this->message->send($command->conversation, $command->body, $command->senderId, $command->type);

        $this->dispatcher->dispatch($this->message->releaseEvents());

        return $message;
    }
890958
protected function cacheActionMessages(Request $request) {
        $errors = $request->removeActionErrors();
        if ($errors && $request->getSession()) {
            if (isset($_SESSION[ACTION_ERRORS_KEY]))
                $errors = \array_merge($_SESSION[ACTION_ERRORS_KEY], $errors);
            $_SESSION[ACTION_ERRORS_KEY] = $errors;
        }

        $messages = $request->removeActionMessages();
        if ($messages && $request->getSession()) {
            if (isset($_SESSION[ACTION_MESSAGES_KEY]))
                $messages = \array_merge($_SESSION[ACTION_MESSAGES_KEY], $messages);
            $_SESSION[ACTION_MESSAGES_KEY] = $messages;
        }
    }
1341360
public function handle($request)
	{
		$entity = $this->repository()->findById($request->getId());

        $this->authorize($request, $entity);

        if ($relatedEntity = $this->getProperty($entity, $this->field())) {
            return $this->response()->resource($request,
                new Item($relatedEntity, $this->transformer())
            );
        }

        return $this->response()->resource($request, new NullResource());
	}
1326974
public function handleSamlLoginRequest($request)
    {
        // Store RelayState to session if provided
        if (!empty($request->input('RelayState'))) {
            session()->put('RelayState', $request->input('RelayState'));
        }
        // Handle SamlRequest if provided, otherwise just exit
        if (isset($request->SAMLRequest)) {
            // Get and decode the SAML request
            $SAML = $request->SAMLRequest;
            $decoded = base64_decode($SAML);
            $xml = gzinflate($decoded);
            // Initiate context and authentication request object
            $deserializationContext = new \LightSaml\Model\Context\DeserializationContext();
            $deserializationContext->getDocument()->loadXML($xml);
            $authnRequest = new \LightSaml\Model\Protocol\AuthnRequest();
            $authnRequest->deserialize($deserializationContext->getDocument()->firstChild, $deserializationContext);
            // Generate the saml response (saml authentication attempt)
            $this->buildSamlResponse($authnRequest, $request);
        }
    }
1320463
public function handle(Request $request)
	{
		$response = $this->next($request);

		try
		{
			$this->app->get('arguments')->parse();
		}
		catch (UnsupportedCommandException $e)
		{
			$this->app->get('output')->error($e->getMessage());
		}
		catch (UnsupportedTaskException $e)
		{
			$this->app->get('output')->error($e->getMessage());
		}

		return $response;
	}
269833
public function deliverMessage(MessageRequest $request) {
    $this->setRequestUrl('/message');
    $this->setRequestMethod('POST');
    $this->setRequestObject($request);

    try {
      $this->execute();
    } catch (Exception $e) {
      throw $e;
    }
  }
114824
public function exec() {

            // First we'll be looping through the headers to see if there's anything we reconize

            foreach($this->getRequestHeaders() as $header) {

                switch($header['name']) {

                    // We found a credentials headers, calling the authenticate method
                    case 'Credentials' :
                        $this->authenticate($header['data']['userid'],$header['data']['password']);
                        break;

                }

            }

            foreach($this->getRequests() as $request) {

                // Default AMFVersion
                $AMFVersion = 0;

                $response = null;

                try {

                    if (is_array($request['data']) && isset($request['data'][0]) && $request['data'][0] instanceof SabreAMF_AMF3_AbstractMessage) {
                        $request['data'] = $request['data'][0];
                    }

                    // See if we are dealing with the AMF3 messaging system
                    if (is_object($request['data']) && $request['data'] instanceof SabreAMF_AMF3_AbstractMessage) {
            
                        $AMFVersion = 3;
                       
                        // See if we are dealing with a CommandMessage
                        if ($request['data'] instanceof SabreAMF_AMF3_CommandMessage) {

                            // Handle the command message 
                            $response = $this->handleCommandMessage($request['data']);
                        }

                        // Is this maybe a RemotingMessage ?
                        if ($request['data'] instanceof SabreAMF_AMF3_RemotingMessage) {

                            // Yes
                            $response = new SabreAMF_AMF3_AcknowledgeMessage($request['data']);
                            $response->body = $this->invokeService($request['data']->source,$request['data']->operation,$request['data']->body);

                        }

                    } else {

                        // We are dealing with AMF0
                        $service = substr($request['target'],0,strrpos($request['target'],'.'));
                        $method  = substr(strrchr($request['target'],'.'),1);
                        
                        $response = $this->invokeService($service,$method,$request['data']);

                    }

                    $status = SabreAMF_Const::R_RESULT;

                } catch (Exception $e) {

                    // We got an exception somewhere, ignore anything that has happened and send back
                    // exception information

                    if ($e instanceof SabreAMF_DetailException) {
                        $detail = $e->getDetail();
                    } else {
                        $detail = '';
                    }

                    switch($AMFVersion) {
                        case SabreAMF_Const::AMF0 :
                            $response = array(
                                'description' => $e->getMessage(),
                                'detail'      => $detail,
                                'line'        => $e->getLine(), 
                                'code'        => $e->getCode()?$e->getCode():get_class($e),
                            );
                            break;
                        case SabreAMF_Const::AMF3 :
                            $response = new SabreAMF_AMF3_ErrorMessage($request['data']);
                            $response->faultString = $e->getMessage();
                            $response->faultCode   = $e->getCode();
                            $response->faultDetail = $detail;
                            break;

                    }
                    $status = SabreAMF_Const::R_STATUS;
                }

                $this->setResponse($request['response'],$status,$response);

            }
            $this->sendResponse();

        }
391184
final protected function handleMessage(Message $message): ?Response
    {
        if ($message instanceof Command) {
            $this->handleCommand($message);
            return null;
        }

        if ($message instanceof Event) {
            $this->handleEvent($message);
            return null;
        }

        if ($message instanceof Request) {
            return $this->handleRequest($message);
        }
    }
361067
public function handleClientRequest($request)
    {
        $this->client_data->m = substr($request->server['path_info'], 1);
        $this->client_data->p = $request->get;
    }
264037
public function handle(Request $request)
    {
        $pathInfo = $request->getPathInfo();

        if (0 === strpos($pathInfo, $this->basePath)) {
            foreach ($this->routes as $config) {
                list($method, $pattern, $controller) = $config;

                if ($request->getMethod() === strtoupper($method)
                    && preg_match('!^' . preg_quote($this->basePath . $pattern, '!') . '$!', $request->getPathInfo())
                ) {
                    return call_user_func($controller, $request);
                }
            }
        }

        return null;
    }
432368
public function sendMessage(SendMessageRequest $request)
    {
        $response = new SendMessageResponse();
        return $this->client->sendRequest($request, $response);
    }