classQApplicationBase
QApplicationBase Class Reference
Inherits QBaseClass.

Public Member Functions
- __construct ()
Static Public Member Functions
- static Initialize ()
- static IsBrowser ($intBrowserType)
- static InitializeDatabaseConnections ()
- static Autoload ($strClassName)
- static SetErrorHandler ($strName, $intLevel=null)
- static RestoreErrorHandler ()
- static MakeDirectory ($strPath, $intMode=null)
- static Redirect ($strLocation)
- static CloseWindow ()
- static QueryString ($strItem)
- static GenerateQueryString ()
- static CheckRemoteAdmin ()
- static PathInfo ($intIndex)
- static DisplayAlert ($strMessage)
- static ExecuteJavaScript ($strJavaScript, $blnHighPriority=false)
- static OutputPage ($strBuffer)
- static RenderJavaScript ($blnOutput=true)
- static Translate ($strToken)
- static HtmlEntities ($strText)
- static VarDump ()
Static Public Attributes
- static $CacheControl = 'private'
- static $DocumentRoot
- static $ProcessOutput = true
- static $ScriptFilename
- static $ScriptName
- static $PathInfo
- static $QueryString
- static $RequestUri
- static $ServerAddress
- static $EncodingType = 'UTF-8'
- static $Database
- static $CliMode
- static $ClassFile
- static $PreloadedClassFile
- static $RequestMode
- static $CountryCode
- static $LanguageCode
- static $LanguageObject
- static $AlertMessageArray = array()
- static $JavaScriptArray = array()
- static $JavaScriptArrayHighPriority = array()
- static $ErrorFlag = false
Static Protected Attributes
- static $BrowserType = QBrowserType::Unsupported
Static Private Attributes
- static $intStoredErrorLevel = null
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::Initialize | ( | ) | [static] |
This should be the first call to initialize all the static variables The application object also has static methods that are miscellaneous web development utilities, etc.
- Returns:
- void
References QBrowserType::Chrome, QBrowserType::Chrome_0, QBrowserType::Chrome_1, QBrowserType::Firefox, QBrowserType::Firefox_1_0, QBrowserType::Firefox_1_5, QBrowserType::Firefox_2_0, QBrowserType::Firefox_3_0, QBrowserType::InternetExplorer, QBrowserType::InternetExplorer_6_0, QBrowserType::InternetExplorer_7_0, QBrowserType::InternetExplorer_8_0, QBrowserType::Konqueror, QBrowserType::Konqueror_3, QBrowserType::Konqueror_4, QBrowserType::Linux, QBrowserType::Macintosh, QBrowserType::Opera, QBrowserType::Opera_7, QBrowserType::Opera_8, QBrowserType::Opera_9, QBrowserType::Safari, QBrowserType::Safari_2_0, QBrowserType::Safari_3_0, QBrowserType::Safari_4_0, QBrowserType::Unsupported, and QBrowserType::Windows.
| 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] |
References QRequestMode::Ajax, and RenderJavaScript().
| 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] |
| 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] |
Referenced by QcodoHandleError(), and QcodoHandleException().
QApplicationBase::$intStoredErrorLevel = null [static, private] |
Referenced by RestoreErrorHandler(), and SetErrorHandler().
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:
- qcodo/_core/framework/QApplicationBase.class.php
