PHP Class xajax

It also handles processing and executing the command messages in the XML responses sent back to your page from your PHP functions.
Afficher le fichier Open project: xajax/xajax Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( $sRequestURI = null, $sLanguage = null ) * Constructor: xajax
__sleep ( ) * Function: __sleep
__wakeup ( ) * Function: __wakeup
_compile ( $sFolder = null, $bWriteFile = true )
autoCompressJavascript ( $sJsFullFilename = NULL, $bAlways = false ) * Function: autoCompressJavascript
canProcessRequest ( ) * Function: canProcessRequest
challenge ( $algo = null, $value = null ) * Function: challenge
configure ( $sName, $mValue ) * Function: configure
configureMany ( $aOptions ) * Function: configureMany
getConfiguration ( $sName ) * Function: getConfiguration
getGlobalResponse ( ) * Function: getGlobalResponse
getJavascript ( ) * Function: getJavascript
getVersion ( ) * Function: getVersion
printJavascript ( ) * Function: printJavascript Prints the xajax Javascript header and wrapper code into your page.
processRequest ( ) * Function: processRequest
register ( $sType, $mArg ) * Function: register

Private Methods

Méthode Description
_compressSelf ( $sFolder = null )
_detectURI ( ) * Function: _detectURI
loadChallenges ( $sessionKey )
makeChallenge ( $algo, $value )
saveChallenges ( $sessionKey, $challenges )
verifySession ( ) * Function: VerifySession

Method Details

__construct() public méthode

Constructs a xajax instance and initializes the plugin system. Parameters: sRequestURI - (optional): The sRequestURI> to be used for calls back to the server. If empty, xajax fills in the current URI that initiated this request.
public __construct ( $sRequestURI = null, $sLanguage = null )

__sleep() public méthode

* Function: __sleep
public __sleep ( )

__wakeup() public méthode

* Function: __wakeup
public __wakeup ( )

_compile() public méthode

public _compile ( $sFolder = null, $bWriteFile = true )

autoCompressJavascript() public méthode

Creates a new xajax_core, xajax_debug, etc... file out of the _uncompressed file with a similar name. This strips out the comments and extraneous whitespace so the file is as small as possible without modifying the function of the code. Parameters: sJsFullFilename - (string): The relative path and name of the file to be compressed. bAlways - (boolean): Compress the file, even if it already exists.
public autoCompressJavascript ( $sJsFullFilename = NULL, $bAlways = false )

canProcessRequest() public méthode

Determines if a call is a xajax request or a page load request. Return: boolean - True if this is a xajax request, false otherwise.
public canProcessRequest ( )

challenge() public méthode

Call this from the top of a xajax enabled request handler to introduce a challenge and response cycle into the request response process. NOTE: Sessions must be enabled to use this feature.
public challenge ( $algo = null, $value = null )

configure() public méthode

Call this function to set options that will effect the processing of xajax requests. Configuration settings can be specific to the xajax core, request processor plugins and response plugins. Parameters: Options include: javascript URI - (string): The path to the folder that contains the xajax javascript files. errorHandler - (boolean): true to enable the xajax error handler, see bErrorHandler> exitAllowed - (boolean): true to allow xajax to exit after processing a request. See bExitAllowed> for more information.
public configure ( $sName, $mValue )

configureMany() public méthode

Set an array of configuration options. Parameters: $aOptions - (array): Associative array of configuration settings
public configureMany ( $aOptions )

getConfiguration() public méthode

Get the current value of a configuration setting that was previously set via configure> or configureMany> Parameters: $sName - (string): The name of the configuration setting Returns: $mValue : (mixed): The value of the setting if set, null otherwise.
public getConfiguration ( $sName )

getGlobalResponse() public static méthode

Returns the object preconfigured with the encoding and entity settings from this instance of . This is used for singleton-pattern response development. Returns: : A object which can be used to return response commands. See also the class.
public static getGlobalResponse ( )

getJavascript() public méthode

See printJavascript> for more information.
public getJavascript ( )

getVersion() public static méthode

Returns: string : The current xajax version.
public static getVersion ( )

printJavascript() public méthode

This should be used to print the javascript code between the HEAD and /HEAD tags at the top of the page. The javascript code output by this function is dependent on the plugins that are included and the functions that are registered.
public printJavascript ( )

processRequest() public méthode

If this is a xajax request (see canProcessRequest>), call the requested PHP function, build the response and send it back to the browser. This is the main server side engine for xajax. It handles all the incoming requests, including the firing of events and handling of the response. If your RequestURI is the same as your web page, then this function should be called before ANY headers or HTML is output from your script. This function may exit, if a request is processed. See bAllowExit>
public processRequest ( )

register() public méthode

Call this function to register request handlers, including functions, callable objects and events. New plugins can be added that support additional registration methods and request processors. Parameters: $sType - (string): Type of request handler being registered; standard options include: XAJAX_FUNCTION: a function declared at global scope. XAJAX_CALLABLE_OBJECT: an object who's methods are to be registered. XAJAX_EVENT: an event which will cause zero or more event handlers to be called. XAJAX_EVENT_HANDLER: register an event handler function. $sFunction || $objObject || $sEvent - (mixed): when registering a function, this is the name of the function when registering a callable object, this is the object being registered when registering an event or event handler, this is the name of the event $sIncludeFile || $aCallOptions || $sEventHandler when registering a function, this is the (optional) include file. when registering a callable object, this is an (optional) array of call options for the functions being registered. when registering an event handler, this is the name of the function.
public register ( $sType, $mArg )