PHP Класс Dingo\Api\Dispatcher

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$auth Dingo\Api\Auth\Auth Auth instance.
$container Illuminate\Container\Container Illuminate container instance.
$content string Request raw content.
$cookies array Request cookies.
$defaultDomain string Default domain.
$defaultFormat string Default format.
$defaultVersion string Default version.
$domain string Domain for the request.
$files Illuminate\Filesystem\Filesystem Illuminate filesystem instance.
$headers array Request headers.
$parameters array Request parameters.
$persistAuthentication boolean Indicates whether authentication is persisted.
$prefix string API prefix.
$raw boolean Indicates whether the returned response is the raw response object.
$requestStack array Internal request stack.
$routeStack array Internal route stack.
$router Dingo\Api\Routing\Router Router instance.
$standardsTree string API standards tree.
$subtype string API subtype.
$uploads array Request uploaded files.
$version string Version for the request.

Открытые методы

Метод Описание
__construct ( Illuminate\Container\Container $container, Illuminate\Filesystem\Filesystem $files, Router $router, Dingo\Api\Auth\Auth $auth ) : void Create a new dispatcher instance.
attach ( array $files ) : Dispatcher Attach files to be uploaded.
be ( mixed $user ) : Dispatcher Internal request will be authenticated as the given user.
cookie ( Cookie $cookie ) : Dispatcher Set a cookie to be sent on the next API request.
delete ( string $uri, string | array $parameters = [], string $content = '' ) : mixed Perform API DELETE request.
get ( string $uri, string | array $parameters = [] ) : mixed Perform API GET request.
getDomain ( ) : string Get the domain.
getFormat ( ) : string Get the format.
getStandardsTree ( ) : string Get the standards tree.
getSubtype ( ) : string Get the subtype.
getVersion ( ) : string Get the version.
header ( string $key, string $value ) : Dispatcher Set a header to be sent on the next API request.
json ( string | array $content ) : Dispatcher Send a JSON payload in the request body.
on ( string $domain ) : Dispatcher Sets the domain to be used for the request.
once ( ) : Dispatcher Only authenticate with the given user for a single request.
patch ( string $uri, string | array $parameters = [], string $content = '' ) : mixed Perform API PATCH request.
post ( string $uri, string | array $parameters = [], string $content = '' ) : mixed Perform API POST request.
put ( string $uri, string | array $parameters = [], string $content = '' ) : mixed Perform API PUT request.
raw ( ) : Dispatcher Return the raw response object once request is dispatched.
setDefaultDomain ( string $domain ) : void Set the default domain.
setDefaultFormat ( string $format ) : void Set the defult format.
setDefaultVersion ( string $version ) : void Set the default version.
setPrefix ( string $prefix ) : void Set the prefix.
setStandardsTree ( string $standardsTree ) : void Set the standards tree.
setSubtype ( string $subtype ) : void Set the subtype.
version ( string $version ) : Dispatcher Set the version of the API for the next request.
with ( string | array $parameters ) : Dispatcher Set the parameters to be sent on the next API request.

Защищенные методы

Метод Описание
addPrefixToUri ( string $uri ) : string Add the prefix to the URI.
clearCachedFacadeInstance ( ) : void Clear the cached facade instance.
createRequest ( string $verb, string $uri, string | array $parameters ) : Dingo\Api\Http\InternalRequest Create a new internal request from an HTTP verb and URI.
dispatch ( Dingo\Api\Http\InternalRequest $request ) : mixed Attempt to dispatch an internal request.
getAcceptHeader ( ) : string Build the "Accept" header.
getRootRequest ( ) : Illuminate\Http\Request Get the root request instance.
queueRequest ( string $verb, string $uri, string | array $parameters, string $content = '' ) : mixed Queue up and dispatch a new request.
refreshRequestStack ( ) : void Refresh the request stack.
replaceRequestInstance ( ) : void Replace the request instance with the previous request instance.
setupRequestStack ( ) : void Setup the request stack by grabbing the initial request.

Описание методов

__construct() публичный Метод

Create a new dispatcher instance.
public __construct ( Illuminate\Container\Container $container, Illuminate\Filesystem\Filesystem $files, Router $router, Dingo\Api\Auth\Auth $auth ) : void
$container Illuminate\Container\Container
$files Illuminate\Filesystem\Filesystem
$router Dingo\Api\Routing\Router
$auth Dingo\Api\Auth\Auth
Результат void

addPrefixToUri() защищенный Метод

Add the prefix to the URI.
protected addPrefixToUri ( string $uri ) : string
$uri string
Результат string

attach() публичный Метод

Attach files to be uploaded.
public attach ( array $files ) : Dispatcher
$files array
Результат Dispatcher

be() публичный Метод

Internal request will be authenticated as the given user.
public be ( mixed $user ) : Dispatcher
$user mixed
Результат Dispatcher

clearCachedFacadeInstance() защищенный Метод

Clear the cached facade instance.
protected clearCachedFacadeInstance ( ) : void
Результат void

createRequest() защищенный Метод

Create a new internal request from an HTTP verb and URI.
protected createRequest ( string $verb, string $uri, string | array $parameters ) : Dingo\Api\Http\InternalRequest
$verb string
$uri string
$parameters string | array
Результат Dingo\Api\Http\InternalRequest

delete() публичный Метод

Perform API DELETE request.
public delete ( string $uri, string | array $parameters = [], string $content = '' ) : mixed
$uri string
$parameters string | array
$content string
Результат mixed

dispatch() защищенный Метод

Attempt to dispatch an internal request.
protected dispatch ( Dingo\Api\Http\InternalRequest $request ) : mixed
$request Dingo\Api\Http\InternalRequest
Результат mixed

get() публичный Метод

Perform API GET request.
public get ( string $uri, string | array $parameters = [] ) : mixed
$uri string
$parameters string | array
Результат mixed

getAcceptHeader() защищенный Метод

Build the "Accept" header.
protected getAcceptHeader ( ) : string
Результат string

getDomain() публичный Метод

Get the domain.
public getDomain ( ) : string
Результат string

getFormat() публичный Метод

Get the format.
public getFormat ( ) : string
Результат string

getRootRequest() защищенный Метод

Get the root request instance.
protected getRootRequest ( ) : Illuminate\Http\Request
Результат Illuminate\Http\Request

getStandardsTree() публичный Метод

Get the standards tree.
public getStandardsTree ( ) : string
Результат string

getSubtype() публичный Метод

Get the subtype.
public getSubtype ( ) : string
Результат string

getVersion() публичный Метод

Get the version.
public getVersion ( ) : string
Результат string

header() публичный Метод

Set a header to be sent on the next API request.
public header ( string $key, string $value ) : Dispatcher
$key string
$value string
Результат Dispatcher

json() публичный Метод

Send a JSON payload in the request body.
public json ( string | array $content ) : Dispatcher
$content string | array
Результат Dispatcher

on() публичный Метод

Sets the domain to be used for the request.
public on ( string $domain ) : Dispatcher
$domain string
Результат Dispatcher

once() публичный Метод

Only authenticate with the given user for a single request.
public once ( ) : Dispatcher
Результат Dispatcher

patch() публичный Метод

Perform API PATCH request.
public patch ( string $uri, string | array $parameters = [], string $content = '' ) : mixed
$uri string
$parameters string | array
$content string
Результат mixed

post() публичный Метод

Perform API POST request.
public post ( string $uri, string | array $parameters = [], string $content = '' ) : mixed
$uri string
$parameters string | array
$content string
Результат mixed

put() публичный Метод

Perform API PUT request.
public put ( string $uri, string | array $parameters = [], string $content = '' ) : mixed
$uri string
$parameters string | array
$content string
Результат mixed

queueRequest() защищенный Метод

Queue up and dispatch a new request.
protected queueRequest ( string $verb, string $uri, string | array $parameters, string $content = '' ) : mixed
$verb string
$uri string
$parameters string | array
$content string
Результат mixed

raw() публичный Метод

Return the raw response object once request is dispatched.
public raw ( ) : Dispatcher
Результат Dispatcher

refreshRequestStack() защищенный Метод

This is done by resetting the authentication, popping the last request from the stack, replacing the input, and resetting the version and parameters.
protected refreshRequestStack ( ) : void
Результат void

replaceRequestInstance() защищенный Метод

Replace the request instance with the previous request instance.
protected replaceRequestInstance ( ) : void
Результат void

setDefaultDomain() публичный Метод

Set the default domain.
public setDefaultDomain ( string $domain ) : void
$domain string
Результат void

setDefaultFormat() публичный Метод

Set the defult format.
public setDefaultFormat ( string $format ) : void
$format string
Результат void

setDefaultVersion() публичный Метод

Set the default version.
public setDefaultVersion ( string $version ) : void
$version string
Результат void

setPrefix() публичный Метод

Set the prefix.
public setPrefix ( string $prefix ) : void
$prefix string
Результат void

setStandardsTree() публичный Метод

Set the standards tree.
public setStandardsTree ( string $standardsTree ) : void
$standardsTree string
Результат void

setSubtype() публичный Метод

Set the subtype.
public setSubtype ( string $subtype ) : void
$subtype string
Результат void

setupRequestStack() защищенный Метод

Setup the request stack by grabbing the initial request.
protected setupRequestStack ( ) : void
Результат void

version() публичный Метод

Set the version of the API for the next request.
public version ( string $version ) : Dispatcher
$version string
Результат Dispatcher

with() публичный Метод

Set the parameters to be sent on the next API request.
public with ( string | array $parameters ) : Dispatcher
$parameters string | array
Результат Dispatcher

Описание свойств

$auth защищенное свойство

Auth instance.
protected Auth,Dingo\Api\Auth $auth
Результат Dingo\Api\Auth\Auth

$container защищенное свойство

Illuminate container instance.
protected Container,Illuminate\Container $container
Результат Illuminate\Container\Container

$content защищенное свойство

Request raw content.
protected string $content
Результат string

$cookies защищенное свойство

Request cookies.
protected array $cookies
Результат array

$defaultDomain защищенное свойство

Default domain.
protected string $defaultDomain
Результат string

$defaultFormat защищенное свойство

Default format.
protected string $defaultFormat
Результат string

$defaultVersion защищенное свойство

Default version.
protected string $defaultVersion
Результат string

$domain защищенное свойство

Domain for the request.
protected string $domain
Результат string

$files защищенное свойство

Illuminate filesystem instance.
protected Filesystem,Illuminate\Filesystem $files
Результат Illuminate\Filesystem\Filesystem

$headers защищенное свойство

Request headers.
protected array $headers
Результат array

$parameters защищенное свойство

Request parameters.
protected array $parameters
Результат array

$persistAuthentication защищенное свойство

Indicates whether authentication is persisted.
protected bool $persistAuthentication
Результат boolean

$prefix защищенное свойство

API prefix.
protected string $prefix
Результат string

$raw защищенное свойство

Indicates whether the returned response is the raw response object.
protected bool $raw
Результат boolean

$requestStack защищенное свойство

Internal request stack.
protected array $requestStack
Результат array

$routeStack защищенное свойство

Internal route stack.
protected array $routeStack
Результат array

$router защищенное свойство

Router instance.
protected Router,Dingo\Api\Routing $router
Результат Dingo\Api\Routing\Router

$standardsTree защищенное свойство

API standards tree.
protected string $standardsTree
Результат string

$subtype защищенное свойство

API subtype.
protected string $subtype
Результат string

$uploads защищенное свойство

Request uploaded files.
protected array $uploads
Результат array

$version защищенное свойство

Version for the request.
protected string $version
Результат string