Class QApplicationBase
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.
- QBaseClass
- QApplicationBase
final public
|
#
__construct( )
This faux constructor method throws a caller exception. The Application object should never be instantiated, and this constructor override simply guarantees it. |
public static
|
#
Initialize( )
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. |
public static
integer
|
|
public static
|
#
InitializeDatabaseConnections( )
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. |
public static
|
|
public static
boolean
|
|
public static
|
#
SetErrorHandler( string $strName, integer $intLevel = null )
Temprorarily overrides the default error handling mechanism. Remember to call RestoreErrorHandler to restore the error handler back to the default. |
public static
|
#
RestoreErrorHandler( )
Restores the temporarily overridden default error handling mechanism back to the default. |
public static
boolean
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
#
DeleteCookie( $strName )
Delete's the given cookie IF its set. In other words, you cannot set a cookie and then delete a cookie right away before the cookie gets sent to the browser. |
public static
string
|
#
QueryString( string $strItem )
Gets the value of the QueryString item $strItem. Will return NULL if it doesn't exist. |
public static
string
|
#
GenerateQueryString( array $arr = null )
Generates a valid URL Query String based on values in the provided array. If no array is provided, it uses the global $_GET |
protected static
null|string
|
#
GenerateQueryStringHelper( string $strKey, string|integer|array $mixValue )
Generates part of query string (helps in generating the complete query string) |
public static
|
#
CheckRemoteAdmin( )
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. |
public static
boolean
|
#
IsRemoteAdminSession( )
Checks whether the current request was made by an ADMIN This does not refer to your Database admin or an Admin user defined in your application but an IP address (or IP address range) defined in configuration.inc.php. |
public static
boolean
|
#
IsIPInRange( string $ip, string $range )
Checks whether the given IP falls into the given IP range |
public static
string|null
|
|
public static
|
#
DisplayAlert( string $strMessage )
Causes the browser to display a JavaScript alert() box with supplied message |
public static
|
#
ExecuteJavaScript( string $strJavaScript, string $strPriority =
This class can be used to call a Javascript function in the client browser from the server side. Can be used inside event handlers to do something after verification on server side. |
public static
|
#
ExecuteControlCommand( string $strControlId, string $strFunctionName )
Execute a function on a particular control. Many javascript widgets are structured this way, and this gives us a general purpose way of sending commands to widgets without an 'eval' on the client side. |
public static
|
#
ExecuteSelectorFunction( array|string $mixSelector, string $strFunctionName )
Call a function on a jQuery selector. The selector can be a single string, or an array where the first item is a selector specifying the items within the context of the second selector. |
public static
|
#
ExecuteJsFunction( string $strFunctionName )
Call the given function with the given arguments. If just a function name, then the window object is searched. The function can be inside an object accessible from the global namespace by separating with periods. |
public static
|
#
AddStyleSheets( array $strStyleSheetArray )
One time add of style sheets, to be used by QForm only for last minute style sheet injection. |
public static
|
#
AddJavaScriptFiles( string[] $strJavaScriptFileArray )
Add an array of javascript files for one-time inclusion. Called by QForm. Do not call. |
public static
string
|
|
public static
|
|
public static
|
|
public static
string
|
#
RenderFiles( )
Render scripts for injecting files into the html output. This is for server only, not ajax. This list will appear ahead of the javascript commands rendered below. |
public static
string
|
#
RenderJavascript( $blnBeforeControls = false )
Function renders all the Javascript commands as output to the client browser. This is a mirror of what occurs in the success function in the qcubed.js ajax code. |
public static
array
|
#
GetJavascriptCommandArray( )
Return the javascript command array, for use by form ajax response. Will erase the command array, so the form better use it. |
public static
string
|
|
public static
string
|
#
HtmlEntities( string $strText )
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.) |
public static
|
|
public static
string
|
|
public static
string
|
|
public static
|
OverrideAttributes(),
__call(),
__get(),
__set()
|
public static
|
$objCacheProvider
The cache provider object used for caching ORM objects It is initialized below in Initialize(), based on the CACHE_PROVIDER and CACHE_PROVIDER_OPTIONS variables defined in configuration.inc.php |
#
null
|
public static
boolean
|
$blnLocalCache
Set to true to turn on short-term caching. This is an in-memory cache that caches database objects only for as long as a single http request lasts. Depending on your application, this may speed up your database accesses. It DOES increase the amount of memory used in a request. |
#
false
|
protected static
integer
|
$BrowserType
Internal bitmask signifying which BrowserType the user is using Use the QApplication::IsBrowser() method to do browser checking |
|
public static
float
|
$BrowserVersion
Major version number of browser |
#
null
|
public static
string
|
$CacheControl
Definition of CacheControl for the HTTP header. In general, it is recommended to keep this as "private". But this can/should be overriden for file/scripts that have special caching requirements (e.g. dynamically created images like QImageLabel). |
#
'private'
|
public static
#P#C\QCrossScripting.Purify|?
|
$DefaultCrossScriptingMode
Defines the default mode for controls that need protection against cross-site scripting. Can be overridden at the individual control level, or for all controls by overriding it in QApplication. Set to QCrossScripting::Legacy for backward compatibility reasons for legacy applications; For new applications the recommended setting is QCrossScripting::Purify. |
|
public static
string
|
$DocumentRoot
Path of the "web root" or "document root" of the web server Like "/home/www/htdocs" on Linux/Unix or "c:\inetpub\wwwroot" on Windows |
|
public static
boolean
|
$ProcessOutput
Whether or not we are currently trying to Process the Output of the page. Used by the OutputPage PHP output_buffering handler. As of PHP 5.2, this gets called whenever ob_get_contents() is called. Because some classes like QFormBase utilizes ob_get_contents() to perform template evaluation without wanting to actually perform OutputPage, this flag can be set/modified by QFormBase::EvaluateTemplate accordingly to prevent OutputPage from executing. |
#
true
|
public static
string
|
$ScriptFilename
Full path of the actual PHP script being run Like "/home/www/htdocs/folder/script.php" on Linux/Unix or "c:\inetpub\wwwroot" on Windows |
|
public static
string
|
$ScriptName
Web-relative path of the actual PHP script being run So for "http://www.domain.com/folder/script.php", QApplication::$ScriptName would be "/folder/script.php" |
|
public static
string
|
$PathInfo
Extended Path Information after the script URL (if applicable) So for "http://www.domain.com/folder/script.php/15/225" QApplication::$PathInfo would be "/15/255" |
|
public static
string
|
$QueryString
Query String after the script URL (if applicable) So for "http://www.domain.com/folder/script.php?item=15&value=22" QApplication::$QueryString would be "item=15&value=22" |
|
public static
string
|
$RequestUri
The full Request URI that was requested So for "http://www.domain.com/folder/script.php/15/25/?item=15&value=22" QApplication::$RequestUri would be "/folder/script.php/15/25/?item=15&value=22" |
|
public static
string
|
$ServerAddress
The IP address of the server running the script/PHP application This is either the LOCAL_ADDR or the SERVER_ADDR server constant, depending on the server type, OS and configuration. |
|
public static
string
|
$EncodingType
The encoding type for the application (e.g. UTF-8, ISO-8859-1, etc.) |
#
"UTF-8"
|
public static
string
|
$ContentType
The content type to output. |
#
"text/html"
|
public static
|
$Database
An array of Database objects, as initialized by QApplication::InitializeDatabaseConnections() |
|
public static
boolean
|
$CliMode
A flag to indicate whether or not this script is run as a CLI (Command Line Interface) |
|
public static
array
|
$ClassFile
Class File Array - used by QApplication::AutoLoad to more quickly load core class objects without making a file_exists call. |
|
public static
array
|
$PreloadedClassFile
Preloaded Class File Array - used by QApplication::Initialize to load any core class objects during Initailize() |
|
public static
string
|
$RequestMode
The QRequestMode enumerated value for the current request mode |
|
public static
string
|
$CountryCode
2-letter country code to set for internationalization and localization (e.g. us, uk, jp) |
|
public static
string
|
$LanguageCode
2-letter language code to set for internationalization and localization (e.g. en, jp, etc.) |
|
public static
|
$LanguageObject
The instance of the active QI18n object (which contains translation strings), if any. |
|
public static
boolean
|
$Minimize
True to force drawing to be minimized. |
#
false
|
public static
null|array;
|
$JavascriptExclusiveCommand
If this particular item is set, we ensure that this command, and only this command will get invoked on the next response. The rest of the commands will wait until the next response. |
#
null
|
protected static
array
|
$JavascriptCommandArray
A structured array of commands to be sent to either the ajax response, or page output. Replaces the AlertMessageArray, JavaScriptArray, JavaScriptArrayHighPriority, and JavaScriptArrayLowPriority. |
#
array()
|
protected static
array
|
$JavascriptFileArray
JS files to be added to the list of files in front of the javascript commands. Should include jquery, etc. |
#
array()
|
public static
boolean
|
$ErrorFlag
Used to determine if an error has occurred |
#
false
|