Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
Dispatcher Class Reference

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)

Detailed Description

Class dispatching HTTP requests to handlers.

Definition at line 17 of file

Member Function Documentation

Dispatcher::_cacheContent (   $contents)

Cache content as a local file.


Definition at line 229 of file

Dispatcher::_displayCached ( $router,

Display the request contents from cache.


Definition at line 197 of file

References Config\getVar().

Referenced by dispatch().

& Dispatcher::_instantiateRouter (   $routerName,

Instantiate a router


Definition at line 169 of file

Referenced by dispatch(), and url().

Dispatcher::addRouterName (   $routerName,

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.

$routerNamestring 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.
$shortcutstring a shortcut name for the router to be used for quick router instance retrieval.

Definition at line 77 of file

Dispatcher::dispatch ( $request)

Determine the correct router for this request. Then let the router dispatch the request to the appropriate handler method.


Definition at line 88 of file

References _displayCached(), _instantiateRouter(), getRouterNames(), Config\getVar(), and PluginRegistry\loadCategory().

& Dispatcher::getApplication ( )

Get the application


Definition at line 37 of file

& Dispatcher::getRouterNames ( )

Get the router names

array an array of Router names

Definition at line 53 of file

Referenced by dispatch().

Dispatcher::handle404 ( )

Handle a 404 error (page not found).

Definition at line 244 of file

References PKPRequest\_checkThis().

Referenced by PKPHandler\index().

Dispatcher::setApplication ( $application)

Set the application


Definition at line 45 of file

Dispatcher::url ( $request,
  $newContext = null,
  $handler = null,
  $op = null,
  $path = null,
  $params = null,
  $anchor = null,
  $escape = false 

Build a handler request URL into PKPApplication.

$requestPKPRequest the request to be routed
$shortcutstring the short name of the router that should be used to construct the URL
$newContextmixed Optional contextual paths
$handlerstring Optional name of the handler to invoke
$opstring Optional name of operation to invoke
$pathmixed Optional string or array of args to pass to handler
$paramsarray Optional set of name => value pairs to pass as user parameters
$anchorstring Optional name of anchor to add to URL
$escapeboolean Whether or not to escape ampersands for this URL; default false.
string the URL

Definition at line 150 of file

References _instantiateRouter().

The documentation for this class was generated from the following file: