Open Journal Systems
3.3.0
|
Public Member Functions | |
_cacheContent ($contents) | |
_displayCached ($router, $request) | |
& | _instantiateRouter ($routerName, $shortcut) |
addRouterName ($routerName, $shortcut) | |
dispatch ($request) | |
& | getApplication () |
& | getRouterNames () |
handle404 () | |
setApplication ($application) | |
url ($request, $shortcut, $newContext=null, $handler=null, $op=null, $path=null, $params=null, $anchor=null, $escape=false) | |
Data Fields | |
$_application | |
$_requestCallbackHack | |
$_router | |
$_routerInstances = array() | |
$_routerNames = array() | |
Class dispatching HTTP requests to handlers.
Definition at line 17 of file Dispatcher.inc.php.
Dispatcher::_cacheContent | ( | $contents | ) |
Cache content as a local file.
$contents | string |
Definition at line 253 of file Dispatcher.inc.php.
Dispatcher::_displayCached | ( | $router, | |
$request | |||
) |
Display the request contents from cache.
$router | PKPRouter |
Definition at line 221 of file Dispatcher.inc.php.
References Config\getVar().
Referenced by dispatch().
& Dispatcher::_instantiateRouter | ( | $routerName, | |
$shortcut | |||
) |
Instantiate a router
$routerName | string |
$shortcut | string |
Definition at line 193 of file Dispatcher.inc.php.
References fatalError(), and instantiate().
Referenced by dispatch(), and url().
Dispatcher::addRouterName | ( | $routerName, | |
$shortcut | |||
) |
Add a router name.
NB: Routers will be called in the order that they have been added to the dispatcher. The first router that supports the request will be called. The last router should always be a "catch-all" router that supports all types of requests.
NB: Routers must be part of the core package to be accepted by this dispatcher implementation.
$routerName | string a class name of a router to be given the chance to route the request. NB: These are class names and not instantiated objects. We'll use lazy instantiation to reduce the performance/memory impact to a minimum. |
$shortcut | string a shortcut name for the router to be used for quick router instance retrieval. |
Definition at line 92 of file Dispatcher.inc.php.
Dispatcher::dispatch | ( | $request | ) |
Determine the correct router for this request. Then let the router dispatch the request to the appropriate handler method.
$request | PKPRequest |
Definition at line 103 of file Dispatcher.inc.php.
References _displayCached(), _instantiateRouter(), HookRegistry\call(), fatalError(), PKPServices\get(), getRouterNames(), Config\getVar(), AppLocale\initialize(), and PluginRegistry\loadCategory().
& Dispatcher::getApplication | ( | ) |
Get the application
Definition at line 52 of file Dispatcher.inc.php.
References $_application.
& Dispatcher::getRouterNames | ( | ) |
Get the router names
Definition at line 68 of file Dispatcher.inc.php.
References $_routerNames.
Referenced by dispatch().
Dispatcher::handle404 | ( | ) |
Handle a 404 error (page not found).
Definition at line 268 of file Dispatcher.inc.php.
References fatalError().
Referenced by PKPHandler\index().
Dispatcher::setApplication | ( | $application | ) |
Set the application
$application | PKPApplication |
Definition at line 60 of file Dispatcher.inc.php.
References $application.
Dispatcher::url | ( | $request, | |
$shortcut, | |||
$newContext = null , |
|||
$handler = null , |
|||
$op = null , |
|||
$path = null , |
|||
$params = null , |
|||
$anchor = null , |
|||
$escape = false |
|||
) |
Build a handler request URL into PKPApplication.
$request | PKPRequest the request to be routed |
$shortcut | string the short name of the router that should be used to construct the URL |
$newContext | mixed Optional contextual paths |
$handler | string Optional name of the handler to invoke |
$op | string Optional name of operation to invoke |
$path | mixed Optional string or array of args to pass to handler |
$params | array Optional set of name => value pairs to pass as user parameters |
$anchor | string Optional name of anchor to add to URL |
$escape | boolean Whether or not to escape ampersands for this URL; default false. |
Definition at line 174 of file Dispatcher.inc.php.
References $op, and _instantiateRouter().
PKPApplication Dispatcher::$_application |
Definition at line 22 of file Dispatcher.inc.php.
Referenced by getApplication().
PKPRequest Dispatcher::$_requestCallbackHack |
Used for a callback hack - NOT GENERALLY SET.
Definition at line 46 of file Dispatcher.inc.php.
PKPRouter Dispatcher::$_router |
Definition at line 40 of file Dispatcher.inc.php.
array Dispatcher::$_routerInstances = array() |
an array of Router instances
Definition at line 34 of file Dispatcher.inc.php.
array Dispatcher::$_routerNames = array() |
an array of Router implementation class names
Definition at line 28 of file Dispatcher.inc.php.
Referenced by getRouterNames().