Open Monograph Press  1.1
 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)

Public Attributes

 $_routerInstances = array()
 $_routerNames = array()

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 244 of file

References PKPRequest\_checkThis().

Dispatcher::_displayCached (   $router,

Display the request contents from cache.


Definition at line 212 of file

& Dispatcher::_instantiateRouter (   $routerName,

Instantiate a router


Definition at line 184 of file

Referenced by addRouterName().

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 92 of file

References _instantiateRouter().

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 103 of file

& Dispatcher::getApplication ( )

Get the application


Definition at line 52 of file

& Dispatcher::getRouterNames ( )

Get the router names

array an array of Router names

Definition at line 68 of file

Dispatcher::handle404 ( )

Handle a 404 error (page not found).

Definition at line 259 of file

Dispatcher::setApplication ( $application)

Set the application


Definition at line 60 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 165 of file

Member Data Documentation

PKPRequest Dispatcher::$_requestCallbackHack

Used for a callback hack - NOT GENERALLY SET.

Definition at line 46 of file

array Dispatcher::$_routerInstances = array()

an array of Router instances

Definition at line 34 of file

array Dispatcher::$_routerNames = array()

an array of Router implementation class names

Definition at line 28 of file

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