@param array $request

@return string
511418
protected function createRawResponseFromArray(array $request)
    {
        $rawResponse = '';
        $arrayCount = count($request);
        $count = 1;
        foreach ($request as $key => $value) {
            $rawResponse .= $key . '=' . $value;
            if ($count < $arrayCount) {
                $rawResponse .= "\n";
            }
            $count++;
        }

        return $rawResponse;
    }
27201
protected function parseIncomingRequest($request)
    {
        if (! $request) {
            $request = LumenRequest::capture();
        }

        $this->instance(Request::class, $this->prepareRequest($request));

        return [$request->getMethod(), '/'.\trim($request->getPathInfo(), '/')];
    }
175469
protected function getResultsTemplate($request)
    {
        $templates = [
            Page::class . '_results',
            Page::class
        ];

        if ($request->getVar('format') == 'rss') {
            array_unshift($templates, Page::class . '_results_rss');
        }

        if ($request->getVar('format') == 'atom') {
            array_unshift($templates, Page::class . '_results_atom');
        }

        return $templates;
    }
531708
public function showList(array $request = ['page' => 1])
    {
        if (isset($_GET['page']) === false) {
            $_GET['page'] = $request['page'] = 1;
        }
        $pages_list = [];
        $auth = $this->core->auth();
        $paginated = false;
        if ($auth->allow(["min" => 2, "max" => 1]) === true) {
            if ($request['page'] == 0) {
                $pages_list = $this->core->api('Page/all', 'GET')->run();
            } else {
                $paginated = true;
                $pages_list = $this->core->api('Page/all', 'GET')->run([
                    "paginate" => 15
                ]);
                $pages_list['response']->withPath(web_admin_path() . "Core-Framework/pages/");
            }
            if (($pages_list["headers"][0][2] - 200) * ($pages_list["headers"][0][2] - 299) > 0) {
                if (headers_sent() === false) {
                    foreach ($pages_list["headers"] as $header) {
                        header($header[0], $header[1], $header[2]);
                    }
                }
                return $this->templates->render("500", [
                    "error" => $pages_list['response'],
                    "result" => ''
                ]);
            }
            $pages_list = $pages_list['response'];
        } elseif ($auth->allow(["min" => 3, "max" => 3]) === true) {
            if ($request['page'] == 0) {
                $pages_list = $auth->details->pages()->get();
            } else {
                $paginated = true;
                $pages_list = $auth->details->pages()->paginate(15);
                $pages_list->withPath(web_admin_path() . "Core-Framework/pages/");
            }
        }

        $messages = [
            'error' => '',
            'info' => '',
            'success' => '',
            'warning' => ''
        ];
        if (empty($request['m']) === false) {
            if ($request['m'] == 1) {
                if (headers_sent() === false) {
                    header('X-PHP-Response-Code: 202', true, 202);
                }
                $messages['success'] = 'Page deleted successfully.';
            } elseif ($request['m'] == 2) {
                if (headers_sent() === false) {
                    header('X-PHP-Response-Code: 422', true, 422);
                }
                $messages['error'] = 'Error - Page not found.';
            }
        }

        return $this->templates->render("Main::Pages/List", [
            "messages" => $messages,
            "paginated" => $paginated,
            "pages" => $pages_list
        ]);
    }
831648
public function showNew(array $request = [])
    {
        $roles_list = $this->core->api('Role/all', 'GET')->run();
        return $this->templates->render("Main::Users/New", [
            "messages" => [
                'error' => '',
                'info' => '',
                'success' => '',
                'warning' => ''
            ],
            "request" => $request,
            "roles" => $roles_list['response']
        ]);
    }
365922
private function preRequest(string $request): string
    {
        $result = $this->preRequest->handle(new TransportContainer($this, $request));

        if ($result instanceof TransportContainer) {
            return $result->getRequest();
        }

        throw new \RuntimeException();
    }
1126326
public function toArray($request)
    {
        return [
            'id'         => (int) $this->id,
            'email'      => $this->email,
            'name'       => $this->name,
            'first_name' => $this->first_name,
            'last_name'  => $this->last_name,
            'roles'      => Role::collection($this->whenLoaded('roles')),
        ];
    }
594990
protected function processRequest(array $request)
    {
        try {
            $response = $this->_request(
                [
                    'uri' => $request['uri'],
                    'type' => $request['type'],
                    'data' => $request['data']
                ]
            );
        } catch ( \Exception $e ) {
            echo json_encode(array(
                'error' => array(
                    'msg' => $e->getMessage(),
                    'code' => $e->getCode(),
                ),
            ));

            exit();
        }

        return $response->getBody()->getContents();
    }
154214
protected function getTitleFromUpload($request)
    {
        $uploadedFile = $this->getUploadedFile($request, 'fileVersion');

        if ($uploadedFile) {
            if (false === strpos($uploadedFile->getClientOriginalName(), '.')) {
                return $uploadedFile->getClientOriginalName();
            }

            return implode('.', explode('.', $uploadedFile->getClientOriginalName(), -1));
        }
    }
1055578
private function _allowHeaders($request) {
        $allowHeaders = Configure::read('Cors.AllowHeaders');

        if ($allowHeaders === true) {
            return $request->getHeader('Access-Control-Request-Headers');
        }

        return implode(', ', (array) $allowHeaders);
    }
1309750
protected function getRequestClass($request)
    {
        $parts = explode('\\', $request);
        $lastIndex = count($parts) - 1;

        switch ($parts[$lastIndex]) {
            case 'Void':
                $parts[$lastIndex] = 'Cancel';
                break;
            case 'AVS':
            case 'INPay':
            case 'ABNiDEAL':
                $this->throwDeprecatedTransactionType();
                break;
            case 'Payin':
            case 'Payout':
                if ($this->getParentClass($parts, $lastIndex) === 'Citadel') {
                    $this->throwDeprecatedTransactionType();
                }
                break;
            case 'oBeP':
                if ($this->getParentClass($parts, $lastIndex) === 'PayByVouchers') {
                    $this->throwDeprecatedTransactionType();
                }
                break;
        }

        return sprintf(
            '\Genesis\API\Request\%s',
            implode('\\', $parts)
        );
    }
923359
public function toArray($request)
    {
        return [
            'id' => $this->id,
            'first_name' => $this->first_name,
            'last_name' => $this->last_name,
            'email' => $this->email,
            'phone' => $this->phone,
            'company_name' => $this->company_name,
            'image_path' => $this->image_path,
            'status' => $this->status,
            'language' => $this->language,
            'address' => $this->addresses,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ];
    }
116454
public function toArray($request)
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'identifier' => $this->identifier,
            'dropdown_options' => new AttributeDropdownOptionCollectionResource($this->attributeDropdownOptions),
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ];
    }
974951
public function toArray($request)
    {
        /** @var \Unite\Tags\Tag $this->resource */
        return [
            'id'                => $this->id,
            'name'              => $this->name,
            'type'              => $this->type,
            'custom_properties' => $this->custom_properties,
            'created_at'        => (string) $this->created_at,
        ];
    }
1067289
private function getMethodName($request) {
        $method = '';
        if(Director::isDev() && ($varMethod = $request->getVar('method'))) {
            if(in_array(strtoupper($varMethod), ['GET','POST','PUT','DELETE','HEAD', 'PATCH'])) {
                $method = $varMethod;
            }
        } else {
            $method = $request->httpMethod();
        }
        return strtolower($method);
    }
16928
public function loadDataFromRequest(array $request)
    {
        foreach ($request as $key => $value) {
            if (in_array($key, $this->requestVariables)) {
                $this->data[$key] = $value;
            }
        }
    }
834019
public function index(string $request) : string
    {
        $jsonRpcCall = null;
        try {
            $jsonRpcCall = $this->getJsonRpcCall($request);

            $jsonRpcCallResponse = $this->getJsonRpcCallResponse($jsonRpcCall);

            return $this->getResponseString($jsonRpcCallResponse, $jsonRpcCall);
        } catch (\Exception $exception) {
            // Try to create a valid json-rpc error
            $jsonRpcCallResponse = (new JsonRpcCallResponse())->addResponse(
                $this->exceptionHandler->getJsonRpcResponseFromException($exception)
            );

            return $this->getResponseString($jsonRpcCallResponse, $jsonRpcCall);
        }
    }