Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
Core Class Reference

Static Public Member Functions

static checkGeneralPHPModule ($moduleName)
 
static cleanFileVar ($var)
 
static cleanVar ($var)
 
static getArgs ($urlInfo, $isPathInfo, $userVars=array())
 
static getBaseDir ()
 
static getContextPaths ($urlInfo, $isPathInfo, $contextList=null, $contextDepth=null, $userVars=array())
 
static getCurrentDate ($ts=null)
 
static getOp ($urlInfo, $isPathInfo, $userVars=array())
 
static getPage ($urlInfo, $isPathInfo, $userVars=array())
 
static isUserAgentBot ($userAgent, $botRegexpsFile=USER_AGENTS_FILE)
 
static isWindows ()
 
static microtime ()
 
static serverPHPOS ()
 
static serverPHPVersion ()
 

Static Public Attributes

static $botRegexps = array()
 

Detailed Description

Class containing system-wide functions.

Definition at line 25 of file Core.inc.php.

Member Function Documentation

static Core::checkGeneralPHPModule (   $moduleName)
static

Checks to see if a PHP module is enabled.

Parameters
$moduleNamestring
Returns
boolean

Definition at line 137 of file Core.inc.php.

static Core::cleanFileVar (   $var)
static

Sanitize a value to be used in a file path. Removes any characters except alphanumeric characters, underscores, and dashes.

Parameters
$varstring
Returns
string

Definition at line 86 of file Core.inc.php.

static Core::cleanVar (   $var)
static

Sanitize a variable. Removes leading and trailing whitespace, normalizes all characters to UTF-8.

Parameters
$varstring
Returns
string

Definition at line 54 of file Core.inc.php.

Referenced by SubmissionSearchIndex\filterKeywords(), and PKPRequest\getUserDateVar().

static Core::getArgs (   $urlInfo,
  $isPathInfo,
  $userVars = array() 
)
static

Get the arguments present into the passed url information (not GET/POST arguments, only arguments appended to the URL separated by "/"). It expects that urls were built using the system.

Parameters
$urlInfostring Full url or just path info.
$isPathInfoboolean Tell if the passed url info string is a path info or not.
$userVarsarray (optional) Pass GET variables if needed (for testing only).
Returns
array

Definition at line 264 of file Core.inc.php.

static Core::getBaseDir ( )
static
static Core::getContextPaths (   $urlInfo,
  $isPathInfo,
  $contextList = null,
  $contextDepth = null,
  $userVars = array() 
)
static

Get context paths present into the passed url information.

Parameters
$urlInfostring Full url or just path info.
$isPathInfoboolean Whether the passed url info string is a path info or not.
$contextListarray (optional)
$contextDepthint (optional)
$userVarsarray (optional) Pass GET variables if needed (for testing only).
Returns
array

Definition at line 180 of file Core.inc.php.

static Core::getCurrentDate (   $ts = null)
static

Return the current date in ISO (YYYY-MM-DD HH:MM:SS) format.

Parameters
$tsint optional, use specified timestamp instead of current time
Returns
string

Definition at line 95 of file Core.inc.php.

References microtime().

Referenced by RegistrationHandler\activateUser(), EditorAction\addReviewer(), PKPUsageEventPlugin\buildUsageEvent(), ReviewerAction\confirmReview(), AccessKeyManager\createKey(), AccessKeyDAO\deleteExpiredKeys(), NewContextCssFileForm\execute(), CatalogEntrySubmissionReviewForm\execute(), CreateReviewerForm\execute(), NewSiteImageFileForm\execute(), NewContextImageFileForm\execute(), ThankReviewerForm\execute(), ReviewReminderForm\execute(), ReviewerReviewStep3Form\execute(), CategoryForm\execute(), ReviewerForm\execute(), Version\fromString(), AccessKeyDAO\getAccessKey(), AccessKeyDAO\getAccessKeyByKeyHash(), AccessKeyDAO\getAccessKeyByUserId(), PluginGridHandler\getCategoryData(), ReviewerGridCellProvider\getCellState(), NativeXmlSubmissionFileFilter\handleRevisionElement(), OMPCompletedPaymentDAO\insertCompletedPayment(), QueuedPaymentDAO\insertObject(), NotificationDAO\insertObject(), StageAssignmentDAO\insertObject(), CommentDAO\insertObject(), VersionDAO\insertVersion(), SubmissionFileLog\logEvent(), SubmissionLog\logEvent(), EditorAction\recordDecision(), PKPValidation\registerUserSession(), NotificationDAO\setDateRead(), DataObjectTombstone\stampDateDeleted(), ReviewAssignment\stampModified(), Submission\stampModified(), Submission\stampStatusModified(), CommentDAO\updateObject(), and QueuedPaymentDAO\updateQueuedPayment().

static Core::getOp (   $urlInfo,
  $isPathInfo,
  $userVars = array() 
)
static

Get the operation present into the passed url information. It expects that urls were built using the system.

Parameters
$urlInfostring Full url or just path info.
$isPathInfoboolean Tell if the passed url info string is a path info or not.
$userVarsarray (optional) Pass GET variables if needed (for testing only).
Returns
string

Definition at line 247 of file Core.inc.php.

static Core::getPage (   $urlInfo,
  $isPathInfo,
  $userVars = array() 
)
static

Get the page present into the passed url information. It expects that urls were built using the system.

Parameters
$urlInfostring Full url or just path info.
$isPathInfoboolean Tell if the passed url info string is a path info or not.
$userVarsarray (optional) Pass GET variables if needed (for testing only).
Returns
string

Definition at line 231 of file Core.inc.php.

static Core::isUserAgentBot (   $userAgent,
  $botRegexpsFile = USER_AGENTS_FILE 
)
static

Check the passed user agent for a bot.

Parameters
$userAgentstring
$botRegexpsFilestring An alternative file with regular expressions to find bots inside user agent strings.
Returns
boolean

Definition at line 151 of file Core.inc.php.

References $botRegexps.

static Core::isWindows ( )
static

Check if the server platform is Windows.

Returns
boolean

Definition at line 128 of file Core.inc.php.

Referenced by InstallForm\display().

static Core::microtime ( )
static

Return *nix timestamp with microseconds (in units of seconds).

Returns
float

Definition at line 103 of file Core.inc.php.

Referenced by getCurrentDate(), DAO\retrieve(), DAO\retrieveCached(), DAO\retrieveLimit(), DAO\retrieveRange(), and DAO\update().

static Core::serverPHPOS ( )
static

Get the operating system of the server.

Returns
string

Definition at line 112 of file Core.inc.php.

Referenced by ServerInfoGridHandler\loadData(), and serverPHPVersion().

static Core::serverPHPVersion ( )
static

Get the version of PHP running on the server.

Returns
string

Definition at line 120 of file Core.inc.php.

References serverPHPOS().

Referenced by ServerInfoGridHandler\loadData().

Member Data Documentation

array Core::$botRegexps = array()
static

The regular expressions that will find a bot user agent

Definition at line 31 of file Core.inc.php.

Referenced by isUserAgentBot().


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