Properties

$request

$request : \ManaPHP\Http\RequestInterface

Type

\ManaPHP\Http\RequestInterface

$dispatcher

$dispatcher : \ManaPHP\Http\DispatcherInterface

Type

\ManaPHP\Http\DispatcherInterface

$_context

$_context : \ManaPHP\Http\RouterContext

Type

\ManaPHP\Http\RouterContext

$alias

$alias : \ManaPHP\AliasInterface

Type

\ManaPHP\AliasInterface

$eventsManager

$eventsManager : \ManaPHP\Event\ManagerInterface

Type

\ManaPHP\Event\ManagerInterface

$logger

$logger : \ManaPHP\Logging\LoggerInterface

Type

\ManaPHP\Logging\LoggerInterface

$configure

$configure : \ManaPHP\Configuration\Configure

Type

\ManaPHP\Configuration\Configure

$settings

$settings : \ManaPHP\Configuration\SettingsInterface

Type

\ManaPHP\Configuration\SettingsInterface

$crypt

$crypt : \ManaPHP\Security\CryptInterface

Type

\ManaPHP\Security\CryptInterface

$identity

$identity : \ManaPHP\IdentityInterface

Type

\ManaPHP\IdentityInterface

$cache

$cache : \ManaPHP\Caching\CacheInterface

Type

\ManaPHP\Caching\CacheInterface

$httpClient

$httpClient : \ManaPHP\Http\ClientInterface

Type

\ManaPHP\Http\ClientInterface

$restClient

$restClient : \ManaPHP\Http\ClientInterface

Type

\ManaPHP\Http\ClientInterface

$db

$db : \ManaPHP\Data\DbInterface

Type

\ManaPHP\Data\DbInterface

$redisCache

$redisCache : \Redis|\ManaPHP\Data\RedisInterface

Type

\Redis|\ManaPHP\Data\RedisInterface

$redisDb

$redisDb : \Redis|\ManaPHP\Data\RedisInterface

Type

\Redis|\ManaPHP\Data\RedisInterface

$redisBroker

$redisBroker : \Redis|\ManaPHP\Data\RedisInterface

Type

\Redis|\ManaPHP\Data\RedisInterface

$mongodb

$mongodb : \ManaPHP\Data\MongodbInterface

Type

\ManaPHP\Data\MongodbInterface

$rabbitmq

$rabbitmq : \ManaPHP\Messaging\AmqpInterface

Type

\ManaPHP\Messaging\AmqpInterface

$elasticsearch

$elasticsearch : \Elasticsearch\Client

Type

\Elasticsearch\Client

$mailer

$mailer : \ManaPHP\Mailing\MailerInterface

Type

\ManaPHP\Mailing\MailerInterface

$bosClient

$bosClient : \ManaPHP\Bos\ClientInterface

Type

\ManaPHP\Bos\ClientInterface

$wspClient

$wspClient : \ManaPHP\Ws\Pushing\ClientInterface

Type

\ManaPHP\Ws\Pushing\ClientInterface

$coroutineManager

$coroutineManager : \ManaPHP\Coroutine\ManagerInterface

Type

\ManaPHP\Coroutine\ManagerInterface

$wsClient

$wsClient : \ManaPHP\Ws\ClientInterface

Type

\ManaPHP\Ws\ClientInterface

$pubSub

$pubSub : \ManaPHP\Messaging\PubSubInterface

Type

\ManaPHP\Messaging\PubSubInterface

$_context

$_context : \object

Type

\object

$_di

$_di : \ManaPHP\DiInterface

Type

\ManaPHP\DiInterface

$_object_id

$_object_id : integer

Type

integer

$_on

$_on : array<mixed,callable>

Type

array<mixed,callable>

$_injections

$_injections : array

Type

array

$_case_sensitive

$_case_sensitive : boolean

Type

boolean

$_prefix

$_prefix : string

Type

string

$_areas

$_areas : array

Type

array

$_simple_routes

$_simple_routes : array<mixed,\ManaPHP\Http\Router\RouteInterface[]>

Type

array<mixed,\ManaPHP\Http\Router\RouteInterface[]>

Methods

getInstance()

getInstance(string  $class, array  $params = array()) : mixed

Parameters

string $class
array $params

Returns

mixed

getShared()

getShared(string  $name) : mixed

Parameters

string $name

Returns

mixed

inject()

inject(string  $name, mixed  $target) : static

Parameters

string $name
mixed $target

Returns

static

__get()

__get(string  $name) : mixed

Magic method __get

Parameters

string $name

Returns

mixed

__set()

__set(string  $name, mixed  $value) : void

Parameters

string $name
mixed $value

__isset()

__isset(string  $name) : boolean

Parameters

string $name

Returns

boolean

attachEvent()

attachEvent(string  $event, callable  $handler, boolean  $appended = true) : static

Attach a listener to the events manager

Parameters

string $event
callable $handler
boolean $appended

Returns

static

detachEvent()

detachEvent(string  $event, callable  $handler) : static

Parameters

string $event
callable $handler

Returns

static

peekEvent()

peekEvent(string  $group, callable  $handler) : static

Parameters

string $group
callable $handler

Returns

static

fireEvent()

fireEvent(string  $event, mixed  $data = array(), mixed  $source = null) : void

Fires an event in the events manager causing that the active listeners will be notified about it

Parameters

string $event
mixed $data
mixed $source

on()

on(string  $event, callable  $handler) : static

Parameters

string $event
callable $handler

Returns

static

off()

off(string  $event = null, callable  $handler = null) : static

Parameters

string $event
callable $handler

Returns

static

emit()

emit(string  $event, array  $data = array()) : void

Parameters

string $event
array $data

__debugInfo()

__debugInfo() : array

Returns

array

dump()

dump() : array

Returns

array

toArray()

toArray() : array

Returns

array

jsonSerialize()

jsonSerialize() 

__construct()

__construct(boolean  $useDefaultRoutes = true) 

Parameters

boolean $useDefaultRoutes

isCaseSensitive()

isCaseSensitive() : boolean

Returns

boolean

setPrefix()

setPrefix(string  $prefix) : static

Parameters

string $prefix

Returns

static

getPrefix()

getPrefix() : string

Returns

string

setAreas()

setAreas(array  $areas = null) : static

Parameters

array $areas

Returns

static

getAreas()

getAreas() : array

Returns

array

add()

add(string  $pattern, string|array  $paths = null, string|array  $method = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router on any HTTP method

Parameters

string $pattern
string|array $paths
string|array $method

Returns

\ManaPHP\Http\Router\RouteInterface

addGet()

addGet(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is GET

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addPost()

addPost(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is POST

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addPut()

addPut(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is PUT

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addPatch()

addPatch(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is PATCH

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addDelete()

addDelete(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is DELETE

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addOptions()

addOptions(string  $pattern = '{all:.*}', string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Add a route to the router that only match if the HTTP method is OPTIONS

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addHead()

addHead(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is HEAD

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addRest()

addRest(string  $pattern, string  $controller = null) : \ManaPHP\Http\Router\RouteInterface

Parameters

string $pattern
string $controller

Returns

\ManaPHP\Http\Router\RouteInterface

getRewriteUri()

getRewriteUri() : string

Get rewrite info.

Returns

string

match()

match(string  $uri = null, string  $method = null) : \ManaPHP\Http\RouterContext|false

Handles routing information received from the rewrite engine

Parameters

string $uri
string $method

Returns

\ManaPHP\Http\RouterContext|false

dispatch()

dispatch(string  $uri = null, string  $method = null) : mixed

Handles routing information received from the rewrite engine

Parameters

string $uri
string $method

Returns

mixed

getArea()

getArea() : string

Returns processed area name

Returns

string

setArea()

setArea(string  $area) : static

Parameters

string $area

Returns

static

getController()

getController() : string

Returns the processed controller name

Returns

string

setController()

setController(string  $controller) : static

Parameters

string $controller

Returns

static

getAction()

getAction() : string

Returns the processed action name

Returns

string

setAction()

setAction(string  $action) : static

Parameters

string $action

Returns

static

getParams()

getParams() : array

Returns the processed parameters

Returns

array

setParams()

setParams(array  $params) : static

Parameters

array $params

Returns

static

wasMatched()

wasMatched() : boolean

Checks if the router matches any of the defined routes

Returns

boolean

setMatched()

setMatched(boolean  $matched) : static

Parameters

boolean $matched

Returns

static

createUrl()

createUrl(array|string  $args, boolean|string  $scheme = false) : string

Parameters

array|string $args
boolean|string $scheme

Returns

string

_createContext()

_createContext() : object

Returns

object

_addRoute()

_addRoute(string  $pattern, string|array  $paths = null, string  $method = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route applying the common attributes

Parameters

string $pattern
string|array $paths
string $method

Returns

\ManaPHP\Http\Router\RouteInterface

_matchDefaultRoutes()

_matchDefaultRoutes(string  $uri, string  $method) : array|false

Parameters

string $uri
string $method

Returns

array|false