| plugins_jsrs

# Class: JsrsServer Source Location: /plugins/jsrs/JsrsServer.class.php
### Class Overview
JsrsServer.class.php - JavaScript Remote Scripting server #### Author(s): Sam Blum <at blueshoes dot org> Collected all the ideas, merged and rewrote them and added doc. Inspired by: Brent Ashley [jsrs@megahuge.com] initial Autor of jsrs V1 and V2. See http://ashleyit.com/rs/main.htm Inspired by: Danne Lundqvist [dotvoid@dotvoid.com] remote call *without* iframe Inspired by: Eric Costello see http://www.oreillynet.com/pub/a/javascript/2002/02/08/iframe.html Inspired by: Nate Weiss [nweiss@icesinc.com] See www.openwddx.org ------------------------------------------------------------------------------------------------------ #### Version: 3.0 beta CVS $Revision: 1.2 $ (April-2002) See history.txt for full history ------------------------------------------------------------------------------------------------------ Some Notes: The PHP WDDX implementation is limited and some basic types are not supported. Missing Tags (See PHP Bug report : http://bugs.php.net/bug.php?id=16716) The <dataTime>-tag : In PHP 4.0.0 - current(PHP 4.2.0) it's just ignored(!). That means the javascript Date-type can *not* be supported. You must transform it to a string. The <recordset>-tag : Is supported since PHP 4.2. But this has *no* major influence. Javascript types are never transformed to WDDX with the use of the <recordset>-tag. INFO: PHP Object Support ------------------------------------------------------------------------------------------------------ #### Copyright: see license.txt for copyright and license info | ### Variables $lastErr $propagateList | ### Methods propagateFunction propagateMethod start
### Inherited Variables | ### Inherited Methods
### Class Details [line 56] JsrsServer.class.php - JavaScript Remote Scripting server This is the PHP-version of the JavaScript Remote Scripting server Look at the provided sample to see how to use it. Mainly it's: // Include the JsrsServer require("../lib_server/JsrsServer.class.php"); -- Yor code here -- // propagate the methodes and functions that are available for the client $JsrsServer->propagateMethod(<object name> , <methode name>); $JsrsServer->propagateMethod(<object name> , <methode name>); $JsrsServer->propagateFunction(<function name>); // Start the JsrsServer to handle the request from the client $JsrsServer->start(); #### Tags:
copyright: | see license.txt for copyright and license info
author: | Sam Blum <at blueshoes dot org> Collected all the ideas, merged and rewrote them and added doc. Inspired by: Brent Ashley [jsrs@megahuge.com] initial Autor of jsrs V1 and V2. See http://ashleyit.com/rs/main.htm Inspired by: Danne Lundqvist [dotvoid@dotvoid.com] remote call *without* iframe Inspired by: Eric Costello see http://www.oreillynet.com/pub/a/javascript/2002/02/08/iframe.html Inspired by: Nate Weiss [nweiss@icesinc.com] See www.openwddx.org ------------------------------------------------------------------------------------------------------
version: | 3.0 beta CVS $Revision: 1.2 $ (April-2002) See history.txt for full history ------------------------------------------------------------------------------------------------------ Some Notes: The PHP WDDX implementation is limited and some basic types are not supported. Missing Tags (See PHP Bug report : http://bugs.php.net/bug.php?id=16716) The <dataTime>-tag : In PHP 4.0.0 - current(PHP 4.2.0) it's just ignored(!). That means the javascript Date-type can *not* be supported. You must transform it to a string. The <recordset>-tag : Is supported since PHP 4.2. But this has *no* major influence. Javascript types are never transformed to WDDX with the use of the <recordset>-tag. INFO: PHP Object Support ------------------------------------------------------------------------------------------------------
source: | http://sourceforge.net/projects/js-rs/ ------------------------------------------------------------------------------------------------------
[ Top ] ### Class Variables #### $lastErr = '' [line 58]
Type: | mixed
[ Top ] #### $propagateList = array() [line 59]
Type: | mixed
[ Top ] ### Class Methods ### method propagateFunction [line 99]
`[bool] propagateFunction( functionName $functionName)`
************************************************************************************ propagate a Function #### Tags:
return: | TRUE on success otherwise FALSE
#### Parameters:
functionName | $functionName | [stirng]: The function-name that is to be propagated.
[ Top ] ### method propagateMethod [line 68]
`[bool] propagateMethod( object [object]: &$object, methodName $methodName)`
************************************************************************************ propagate a Object Methode #### Tags:
return: | TRUE on success otherwise FALSE
#### Parameters:
object [object]: | &$object | Is an instance of the object that holds the method to be called
methodName | $methodName | [stirng]: The method-name that is to be propagated.
[ Top ] ### method start [line 118]
`void start( )`
************************************************************************************ Start handling the request from the client Read out the passed query params from the client and check if the method (or function) is available. That means if it was propagated before (see propagated-methods). Call the method (or function) and return the data in a WDDX format. The client query params are: jsrsC [<stirng>] : Call ID - A unique call identifier that is passed back. jsrsF [<stirng>] : Method call (<class>.<methode>) or function call (<function>) jsrsP [<stirng>] : Parameter - (squeezed) WDDX formated and escaped data-array. jsrsZ [<stirng>] : Use Squeezed WDDX. If set, then use the squeezed WDDX format. jsrsR ['js'|'html']: Return Mode - The client is expecting html (with js) or a pure js-call [ Top ] Documentation generated on Mon, 29 Dec 2003 21:15:29 +0100 by phpDocumentor 1.2.3