Open Journal Systems
3.3.0
|
Public Member Functions | |
& | _delegateToRouter ($method) |
checkCSRF () | |
encodeBasePathFragment ($fragment) | |
getBasePath () | |
getBaseUrl ($allowProtocolRelative=false) | |
getCompleteUrl () | |
& | getContext () |
getCookieVar ($key) | |
& | getDispatcher () |
getIfModifiedSince () | |
getIndexUrl () | |
getProtocol () | |
getQueryArray () | |
getQueryString () | |
getRemoteAddr () | |
getRemoteDomain () | |
getRequestedArgs () | |
getRequestedContextPath ($contextLevel=null) | |
getRequestedOp () | |
getRequestedPage () | |
getRequestMethod () | |
getRequestPath () | |
getRequestUrl () | |
& | getRouter () |
getServerHost ($default=null, $includePort=true) | |
& | getSession () |
& | getSite () |
& | getUser () |
getUserAgent () | |
getUserDateVar ($prefix, $defaultDay=null, $defaultMonth=null, $defaultYear=null, $defaultHour=0, $defaultMinute=0, $defaultSecond=0) | |
getUserVar ($key) | |
& | getUserVars () |
isBot () | |
isGet () | |
isPathInfoEnabled () | |
isPost () | |
isRestfulUrlsEnabled () | |
redirect ($context=null, $page=null, $op=null, $path=null, $params=null, $anchor=null) | |
redirectNonSSL () | |
redirectSSL () | |
redirectUrl ($url) | |
redirectUrlJson ($url) | |
setCookieVar ($key, $value, $expire=0) | |
setDispatcher ($dispatcher) | |
setRouter ($router) | |
url ($context=null, $page=null, $op=null, $path=null, $params=null, $anchor=null, $escape=false) | |
Data Fields | |
$_basePath | |
$_dispatcher = null | |
$_isBot | |
$_isPathInfoEnabled | |
$_isRestfulUrlsEnabled | |
$_protocol | |
$_requestPath | |
$_requestVars = null | |
$_router = null | |
$_serverHost | |
$_userAgent | |
Class providing operations associated with HTTP requests.
Definition at line 17 of file PKPRequest.inc.php.
& PKPRequest::_delegateToRouter | ( | $method | ) |
This method exists to maintain backwards compatibility with calls to methods that have been factored into the Router implementations.
It delegates the call to the router and returns the result.
NB: This method is protected and may not be used by external classes. It should also only be used in legacy methods.
Definition at line 765 of file PKPRequest.inc.php.
References getRouter().
Referenced by Request\getContext(), getContext(), Request\getContextByName(), getIndexUrl(), Request\getJournal(), getRequestedArgs(), Request\getRequestedContextPath(), getRequestedContextPath(), Request\getRequestedJournalPath(), getRequestedOp(), getRequestedPage(), Request\redirectHome(), Request\url(), and url().
PKPRequest::checkCSRF | ( | ) |
Determine whether a CSRF token is present and correct.
Definition at line 418 of file PKPRequest.inc.php.
References getSession(), and getUserVar().
PKPRequest::encodeBasePathFragment | ( | $fragment | ) |
Callback function for getBasePath() to correctly encode (or not encode) a basepath fragment.
string | $fragment |
Definition at line 240 of file PKPRequest.inc.php.
PKPRequest::getBasePath | ( | ) |
Get the base path of the request (excluding trailing slash).
Definition at line 205 of file PKPRequest.inc.php.
References $_basePath, and HookRegistry\call().
Referenced by getBaseUrl(), getRequestPath(), and setCookieVar().
PKPRequest::getBaseUrl | ( | $allowProtocolRelative = false | ) |
Get the base URL of the request (excluding script).
$allowProtocolRelative | boolean True iff protocol-relative URLs are allowed |
Definition at line 184 of file PKPRequest.inc.php.
References HookRegistry\call(), getBasePath(), getProtocol(), getServerHost(), and Config\getVar().
PKPRequest::getCompleteUrl | ( | ) |
Get the complete URL to this page, including parameters.
Definition at line 268 of file PKPRequest.inc.php.
References HookRegistry\call(), getQueryString(), and getRequestUrl().
& PKPRequest::getContext | ( | ) |
Get the current "context" (press/journal/etc) object.
Definition at line 700 of file PKPRequest.inc.php.
References _delegateToRouter().
PKPRequest::getCookieVar | ( | $key | ) |
& PKPRequest::getDispatcher | ( | ) |
Get the dispatcher
Definition at line 116 of file PKPRequest.inc.php.
References $_dispatcher.
Referenced by redirect().
PKPRequest::getIfModifiedSince | ( | ) |
Get the IF_MODIFIED_SINCE date (as a numerical timestamp) if available
Definition at line 174 of file PKPRequest.inc.php.
PKPRequest::getIndexUrl | ( | ) |
Deprecated
Definition at line 251 of file PKPRequest.inc.php.
References _delegateToRouter(), and HookRegistry\call().
PKPRequest::getProtocol | ( | ) |
Get the protocol used for the request (HTTP or HTTPS).
Definition at line 382 of file PKPRequest.inc.php.
References $_protocol, HookRegistry\call(), and strtolower_codesafe().
Referenced by getBaseUrl(), and getRequestUrl().
PKPRequest::getQueryArray | ( | ) |
Get the complete set of URL parameters to the current request as an associative array. (Excludes reserved parameters, such as "path", which are used by disable_path_info mode.)
Definition at line 317 of file PKPRequest.inc.php.
References Application\getContextList(), and getQueryString().
PKPRequest::getQueryString | ( | ) |
Get the complete set of URL parameters to the current request.
Definition at line 300 of file PKPRequest.inc.php.
References HookRegistry\call().
Referenced by getCompleteUrl(), and getQueryArray().
PKPRequest::getRemoteAddr | ( | ) |
Get the remote IP address of the current request.
Definition at line 427 of file PKPRequest.inc.php.
References HookRegistry\call(), Registry\get(), and Config\getVar().
Referenced by getRemoteDomain().
PKPRequest::getRemoteDomain | ( | ) |
Get the remote domain of the current request
Definition at line 453 of file PKPRequest.inc.php.
References HookRegistry\call(), and getRemoteAddr().
PKPRequest::getRequestedArgs | ( | ) |
PKPRequest::getRequestedContextPath | ( | $contextLevel = null | ) |
Deprecated
Reimplemented in Request.
Definition at line 708 of file PKPRequest.inc.php.
References _delegateToRouter().
PKPRequest::getRequestedOp | ( | ) |
Deprecated
Definition at line 730 of file PKPRequest.inc.php.
References _delegateToRouter().
PKPRequest::getRequestedPage | ( | ) |
PKPRequest::getRequestMethod | ( | ) |
PKPRequest::getRequestPath | ( | ) |
Get the completed path of the request.
Definition at line 337 of file PKPRequest.inc.php.
References $_requestPath, HookRegistry\call(), getBasePath(), isPathInfoEnabled(), and isRestfulUrlsEnabled().
Referenced by getRequestUrl().
PKPRequest::getRequestUrl | ( | ) |
Get the complete URL of the request.
Definition at line 285 of file PKPRequest.inc.php.
References HookRegistry\call(), getProtocol(), getRequestPath(), and getServerHost().
Referenced by getCompleteUrl().
& PKPRequest::getRouter | ( | ) |
get the router instance
Definition at line 92 of file PKPRequest.inc.php.
References $_router.
Referenced by _delegateToRouter(), getUser(), and getUserVar().
PKPRequest::getServerHost | ( | $default = null , |
|
$includePort = true |
|||
) |
Get the server hostname in the request.
$default | string Default hostname (defaults to localhost) |
$includePort | boolean Whether to include non-standard port number; default true |
Definition at line 359 of file PKPRequest.inc.php.
References $_serverHost, and HookRegistry\call().
Referenced by getBaseUrl(), getRequestUrl(), redirectNonSSL(), and redirectSSL().
& PKPRequest::getSession | ( | ) |
Get the user session associated with the current request.
Definition at line 535 of file PKPRequest.inc.php.
References Registry\get(), and SessionManager\getManager().
Referenced by checkCSRF().
& PKPRequest::getSite | ( | ) |
Get site data.
Definition at line 519 of file PKPRequest.inc.php.
References Registry\get(), DAORegistry\getDAO(), and Registry\set().
& PKPRequest::getUser | ( | ) |
Get the user associated with the current request.
Definition at line 550 of file PKPRequest.inc.php.
References Registry\get(), DAORegistry\getDAO(), SessionManager\getManager(), and getRouter().
PKPRequest::getUserAgent | ( | ) |
Get the user agent of the current request.
Definition at line 467 of file PKPRequest.inc.php.
References $_userAgent, and HookRegistry\call().
Referenced by isBot().
PKPRequest::getUserDateVar | ( | $prefix, | |
$defaultDay = null , |
|||
$defaultMonth = null , |
|||
$defaultYear = null , |
|||
$defaultHour = 0 , |
|||
$defaultMinute = 0 , |
|||
$defaultSecond = 0 |
|||
) |
Get the value of a GET/POST variable generated using the Smarty html_select_date and/or html_select_time function.
$prefix | string |
$defaultDay | int |
$defaultMonth | int |
$defaultYear | int |
$defaultHour | int |
$defaultMinute | int |
$defaultSecond | int |
Definition at line 625 of file PKPRequest.inc.php.
References getUserVar().
PKPRequest::getUserVar | ( | $key | ) |
Get the value of a GET/POST variable.
Definition at line 578 of file PKPRequest.inc.php.
References getRouter(), and getUserVars().
Referenced by checkCSRF(), and getUserDateVar().
& PKPRequest::getUserVars | ( | ) |
Get all GET/POST variables as an array
Definition at line 603 of file PKPRequest.inc.php.
References $_requestVars.
Referenced by getUserVar().
PKPRequest::isBot | ( | ) |
Determine whether the user agent is a bot or not.
Definition at line 487 of file PKPRequest.inc.php.
References $_isBot, getUserAgent(), and Core\isUserAgentBot().
PKPRequest::isGet | ( | ) |
Determine whether the request is a GET request
Definition at line 410 of file PKPRequest.inc.php.
References getRequestMethod().
PKPRequest::isPathInfoEnabled | ( | ) |
Return true if PATH_INFO is enabled.
Definition at line 498 of file PKPRequest.inc.php.
References $_isPathInfoEnabled, and Config\getVar().
Referenced by getRequestPath().
PKPRequest::isPost | ( | ) |
Determine whether the request is a POST request
Reimplemented in Request.
Definition at line 402 of file PKPRequest.inc.php.
References getRequestMethod().
PKPRequest::isRestfulUrlsEnabled | ( | ) |
Return true if RESTFUL_URLS is enabled.
Definition at line 508 of file PKPRequest.inc.php.
References $_isRestfulUrlsEnabled, and Config\getVar().
Referenced by getRequestPath().
PKPRequest::redirect | ( | $context = null , |
|
$page = null , |
|||
$op = null , |
|||
$path = null , |
|||
$params = null , |
|||
$anchor = null |
|||
) |
Redirect to the specified page within a PKP Application. Shorthand for a common call to $request->redirect($dispatcher->url($request, ROUTE_PAGE, ...)).
$context | Array The optional contextual paths |
$page | string The name of the op to redirect to. |
$op | string optional The name of the op to redirect to. |
$path | mixed string or array containing path info for redirect. |
$params | array Map of name => value pairs for additional parameters |
$anchor | string Name of desired anchor on the target page |
Definition at line 690 of file PKPRequest.inc.php.
References $op, getDispatcher(), and redirectUrl().
PKPRequest::redirectNonSSL | ( | ) |
Redirect to the current URL, forcing the HTTP protocol to be used.
Definition at line 161 of file PKPRequest.inc.php.
References getServerHost(), and redirectUrl().
PKPRequest::redirectSSL | ( | ) |
Redirect to the current URL, forcing the HTTPS protocol to be used.
Definition at line 149 of file PKPRequest.inc.php.
References getServerHost(), and redirectUrl().
PKPRequest::redirectUrl | ( | $url | ) |
Perform an HTTP redirect to an absolute or relative (to base system URL) URL.
$url | string (exclude protocol for local redirects) |
Definition at line 125 of file PKPRequest.inc.php.
References HookRegistry\call().
Referenced by redirect(), redirectNonSSL(), and redirectSSL().
PKPRequest::redirectUrlJson | ( | $url | ) |
Request an HTTP redirect via JSON to be used from components.
$url | string |
Definition at line 139 of file PKPRequest.inc.php.
PKPRequest::setCookieVar | ( | $key, | |
$value, | |||
$expire = 0 |
|||
) |
Set a cookie variable.
$key | string |
$value | mixed |
$expire | int (optional) |
Definition at line 672 of file PKPRequest.inc.php.
References getBasePath().
PKPRequest::setDispatcher | ( | $dispatcher | ) |
Set the dispatcher
$dispatcher | Dispatcher |
Definition at line 108 of file PKPRequest.inc.php.
PKPRequest::setRouter | ( | $router | ) |
set the router instance
$router | instance PKPRouter |
Definition at line 100 of file PKPRequest.inc.php.
PKPRequest::url | ( | $context = null , |
|
$page = null , |
|||
$op = null , |
|||
$path = null , |
|||
$params = null , |
|||
$anchor = null , |
|||
$escape = false |
|||
) |
Deprecated
Reimplemented in Request.
Definition at line 746 of file PKPRequest.inc.php.
References $op, and _delegateToRouter().
string PKPRequest::$_basePath |
Dispatcher PKPRequest::$_dispatcher = null |
dispatcher instance used to dispatch this request
Definition at line 31 of file PKPRequest.inc.php.
Referenced by getDispatcher().
boolean PKPRequest::$_isBot |
boolean PKPRequest::$_isPathInfoEnabled |
true if path info is enabled for this server
Definition at line 61 of file PKPRequest.inc.php.
Referenced by isPathInfoEnabled().
boolean PKPRequest::$_isRestfulUrlsEnabled |
true if restful URLs are enabled in the config
Definition at line 55 of file PKPRequest.inc.php.
Referenced by isRestfulUrlsEnabled().
string PKPRequest::$_protocol |
string PKPRequest::$_requestPath |
array PKPRequest::$_requestVars = null |
the request variables cache (GET/POST)
Definition at line 37 of file PKPRequest.inc.php.
Referenced by getUserVars().
PKPRouter PKPRequest::$_router = null |
router instance used to route this request
Definition at line 25 of file PKPRequest.inc.php.
Referenced by getRouter().
string PKPRequest::$_serverHost |
string PKPRequest::$_userAgent |