QCubed - A PHP5 rapid development MVC framework.
Home  |  Updates

classQApplicationBase

QApplicationBase Class Reference

Inherits QBaseClass.

Collaboration diagram for QApplicationBase:

List of all members.

Public Member Functions

Static Public Member Functions

Static Public Attributes

Static Protected Attributes

Static Private Attributes


Detailed Description

This abstract class should never be instantiated. It contains static methods, variables and constants to be used throughout the application.

The static method "Initialize" should be called at the begin of the script by prepend.inc.


Constructor & Destructor Documentation

QApplicationBase::__construct (  )  [final]

This faux constructor method throws a caller exception. The Application object should never be instantiated, and this constructor override simply guarantees it.

Returns:
void


Member Function Documentation

static QApplicationBase::Autoload ( strClassName  )  [static]

This is called by the PHP5 Autoloader. This static method can be overridden.

Returns:
boolean whether or not a class was found / included

static QApplicationBase::CheckRemoteAdmin (  )  [static]

By default, this is used by the codegen and form drafts to do a quick check on the ALLOW_REMOTE_ADMIN constant (as defined in configuration.inc.php). If enabled, then anyone can access the page. If disabled, only "localhost" can access the page.

If you want to run a script that should be accessible regardless of ALLOW_REMOTE_ADMIN, simply remove the CheckRemoteAdmin() method call from that script.

Parameters:
string $strFile script filename doing the check
integer $intLine line number of the check call

static QApplicationBase::CloseWindow (  )  [static]

This will close the window. It will immediately end processing of the rest of the script.

Returns:
void

References _p(), and QRequestMode::Ajax.

static QApplicationBase::DisplayAlert ( strMessage  )  [static]

static QApplicationBase::ExecuteJavaScript ( strJavaScript,
blnHighPriority = false 
) [static]

static QApplicationBase::GenerateQueryString (  )  [static]

Generates a valid URL Query String based on values in the global $_GET

Returns:
string

static QApplicationBase::HtmlEntities ( strText  )  [static]

Global/Central HtmlEntities command to perform the PHP equivalent of htmlentities. Feel free to override to specify encoding/quoting specific preferences (e.g. ENT_QUOTES/ENT_NOQUOTES, etc.)

This method is also used by the global print "_p" function.

Parameters:
string $strText text string to perform html escaping
Returns:
string the html escaped string

static QApplicationBase::InitializeDatabaseConnections (  )  [static]

This call will initialize the database connection(s) as defined by the constants DB_CONNECTION_X, where "X" is the index number of a particular database connection.

Returns:
void

static QApplicationBase::IsBrowser ( intBrowserType  )  [static]

static QApplicationBase::MakeDirectory ( strPath,
intMode = null 
) [static]

Same as mkdir but correctly implements directory recursion. At its core, it will use the php MKDIR function.

This method does no special error handling. If you want to use special error handlers, be sure to set that up BEFORE calling MakeDirectory.

Parameters:
string $strPath actual path of the directoy you want created
integer $intMode optional mode
Returns:
boolean the return flag from mkdir

References RestoreErrorHandler(), and SetErrorHandler().

static QApplicationBase::OutputPage ( strBuffer  )  [static]

static QApplicationBase::PathInfo ( intIndex  )  [static]

Gets the value of the PathInfo item at index $intIndex. Will return NULL if it doesn't exist.

The way PathInfo index is determined is, for example, given a URL '/folder/page.php/id/15/blue', QApplication::PathInfo(0) will return 'id' QApplication::PathInfo(1) will return '15' QApplication::PathInfo(2) will return 'blue'

Returns:
void

References QString::FirstCharacter().

static QApplicationBase::QueryString ( strItem  )  [static]

Gets the value of the QueryString item $strItem. Will return NULL if it doesn't exist.

Returns:
string

static QApplicationBase::Redirect ( strLocation  )  [static]

This will redirect the user to a new web location. This can be a relative or absolute web path, or it can be an entire URL.

Returns:
void

References QCallType::Ajax, QRequestMode::Ajax, and QString::XmlEscape().

static QApplicationBase::RenderJavaScript ( blnOutput = true  )  [static]

References _p(), and QString::LastCharacter().

Referenced by OutputPage().

static QApplicationBase::RestoreErrorHandler (  )  [static]

Restores the temporarily overridden default error handling mechanism back to the default.

References $intStoredErrorLevel.

Referenced by MakeDirectory().

static QApplicationBase::SetErrorHandler ( strName,
intLevel = null 
) [static]

Temprorarily overrides the default error handling mechanism. Remember to call RestoreErrorHandler to restore the error handler back to the default.

Parameters:
string $strName the name of the new error handler function, or NULL if none
integer $intLevel if a error handler function is defined, then the new error reporting level (if any)

References $intStoredErrorLevel.

Referenced by MakeDirectory().

static QApplicationBase::Translate ( strToken  )  [static]

If LanguageCode is specified and QI18n::Initialize() has been called, then this will perform a translation of the given token for the specified Language Code and optional Country code.

Otherwise, this will simply return the token as is. This method is also used by the global print-translated "_t" function.

Parameters:
string $strToken
Returns:
string the Translated token (if applicable)

static QApplicationBase::VarDump (  )  [static]

For development purposes, this static method outputs all the Application static variables

Returns:
void

References _p().


Member Data Documentation

QApplicationBase::$AlertMessageArray = array() [static]

QApplicationBase::$BrowserType = QBrowserType::Unsupported [static, protected]

QApplicationBase::$CacheControl = 'private' [static]

QApplicationBase::$ClassFile [static]

QApplicationBase::$CliMode [static]

QApplicationBase::$CountryCode [static]

QApplicationBase::$Database [static]

QApplicationBase::$DocumentRoot [static]

QApplicationBase::$EncodingType = 'UTF-8' [static]

QApplicationBase::$ErrorFlag = false [static]

QApplicationBase::$intStoredErrorLevel = null [static, private]

QApplicationBase::$JavaScriptArray = array() [static]

QApplicationBase::$JavaScriptArrayHighPriority = array() [static]

QApplicationBase::$LanguageCode [static]

QApplicationBase::$LanguageObject [static]

QApplicationBase::$PathInfo [static]

QApplicationBase::$PreloadedClassFile [static]

QApplicationBase::$ProcessOutput = true [static]

Referenced by QFormBase::RenderBegin().

QApplicationBase::$QueryString [static]

QApplicationBase::$RequestMode [static]

QApplicationBase::$RequestUri [static]

QApplicationBase::$ScriptFilename [static]

QApplicationBase::$ScriptName [static]

QApplicationBase::$ServerAddress [static]


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