You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(168) |
Dec
(10) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
(10) |
May
(8) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Harry F. <ha...@us...> - 2005-06-03 15:17:34
|
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30001 Modified Files: autocomplete2.html Log Message: Note on broken example Index: autocomplete2.html =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/autocomplete2.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** autocomplete2.html 12 Dec 2004 00:53:49 -0000 1.2 --- autocomplete2.html 3 Jun 2005 15:17:09 -0000 1.3 *************** *** 55,59 **** <p> </p> <h2>Step 2</h2> ! <p>Select an airport:<br> <input id="airport" name="airport" size="55" type="text" autocomplete="off" value="" language="javascript" onkeyup="actb_tocomplete(this, event,airports,false);" onblur="actb_removedisp(this);" onkeydown="actb_checkkey(event);" onkeypress="return handleEnter(this, event)"> </p> --- 55,59 ---- <p> </p> <h2>Step 2</h2> ! <p>Select an airport: (this is currently broken)<br> <input id="airport" name="airport" size="55" type="text" autocomplete="off" value="" language="javascript" onkeyup="actb_tocomplete(this, event,airports,false);" onblur="actb_removedisp(this);" onkeydown="actb_checkkey(event);" onkeypress="return handleEnter(this, event)"> </p> |
|
From: Harry F. <ha...@us...> - 2005-06-03 15:15:51
|
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29320 Modified Files: autocomplete.php Log Message: Note for IE Index: autocomplete.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/autocomplete.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** autocomplete.php 28 Apr 2005 10:26:28 -0000 1.4 --- autocomplete.php 3 Jun 2005 15:15:32 -0000 1.5 *************** *** 102,106 **** </form> <p><b>Username:</b> admin, <b>Password:</b> secret</p> ! <p>Note: the client side keypress handling logic could probably be improved in this example. Otherwise demonstrates how coding effort on client and server side is focused purely on application logic - the "networking" between client and server is no effort - even HTTP authentication is easily done.</p> </body> </html> --- 102,106 ---- </form> <p><b>Username:</b> admin, <b>Password:</b> secret</p> ! <p>Note: the client side keypress handling logic could probably be improved in this example - <strong>in IE especially it sucks</strong>. Otherwise demonstrates how coding effort on client and server side is focused purely on application logic - the "networking" between client and server is no effort - even HTTP authentication is easily done.</p> </body> </html> |
|
From: Harry F. <ha...@us...> - 2005-06-03 15:10:59
|
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27196 Modified Files: testclient.php Log Message: Rename function timeout to requesttimeout - Firefox complaining Index: testclient.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/testclient.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testclient.php 22 Nov 2004 11:06:25 -0000 1.3 --- testclient.php 3 Jun 2005 15:10:36 -0000 1.4 *************** *** 301,305 **** } ! function timeout() { var c = new JPSpan_HttpClient(); var r = new JPSpan_Request_Get(encoder); --- 301,305 ---- } ! function requesttimeout() { var c = new JPSpan_HttpClient(); var r = new JPSpan_Request_Get(encoder); *************** *** 409,413 **** <acronym title="Request to 127.0.0.253"><a href="javascript:permissionDenied()">permissionDenied()</a></acronym><br> <acronym title="Attempt multiple calls to when request already in progress"><a href="javascript:callInProgress()">callInProgress()</a></acronym><br> ! <acronym title="Request timed out before response received"><a href="javascript:timeout()">timeout()</a></acronym><br> <acronym title="Invalid request parameter name"><a href="javascript:invalidParamName()">invalidParamName()</a></acronym><br> <acronym title="Recursive references in request data"><a href="javascript:recursion()">recursion()</a></acronym><br> --- 409,413 ---- <acronym title="Request to 127.0.0.253"><a href="javascript:permissionDenied()">permissionDenied()</a></acronym><br> <acronym title="Attempt multiple calls to when request already in progress"><a href="javascript:callInProgress()">callInProgress()</a></acronym><br> ! <acronym title="Request timed out before response received"><a href="javascript:requesttimeout()">requesttimeout()</a></acronym><br> <acronym title="Invalid request parameter name"><a href="javascript:invalidParamName()">invalidParamName()</a></acronym><br> <acronym title="Recursive references in request data"><a href="javascript:recursion()">recursion()</a></acronym><br> |
|
From: Harry F. <ha...@us...> - 2005-06-02 23:47:25
|
Update of /cvsroot/jpspan/jpspan/JPSpan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7206 Modified Files: Generator.php Log Message: Add some logic for adhoc client generation Index: Generator.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Generator.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Generator.php 15 Nov 2004 20:27:36 -0000 1.3 --- Generator.php 2 Jun 2005 23:47:15 -0000 1.4 *************** *** 6,9 **** --- 6,15 ---- */ //-------------------------------------------------------------------------------- + /** + * Define + */ + if ( !defined('JPSPAN') ) { + define ('JPSPAN',dirname(__FILE__).'/'); + } /** *************** *** 11,14 **** --- 17,21 ---- * Works with JPSpan_HandleDescription to generate * client primed for a server + * @todo Review this - may be worth eliminating - not serving much useful purpose * @see JPSpan_Server::getGenerator() * @package JPSpan *************** *** 32,35 **** --- 39,43 ---- * @param string encoding to use when making requests (e.g. xml or php) * @access public + * @todo This method needs to die - just setup the ClientGenerator object */ function init(& $ClientGenerator, & $descriptions, $serverUrl, $encoding) { *************** *** 54,55 **** --- 62,240 ---- } + //-------------------------------------------------------------------------------- + /** + * @package JPSpan + * @subpackage Generator + * @access public + */ + class JPSpan_Generator_AdHoc { + + var $descriptions = array(); + + var $RequestEncoding = 'xml'; + + var $RequestMethod = 'rawpost'; + + var $jsRequestClass = 'JPSpan_Request_RawPost'; + + var $jsEncodingClass = 'JPSpan_Encode_Xml'; + + function addDescription($description) { + $this->descriptions[$description->jsClass] = $description; + } + + /** + * Invokes code generator + * @param JPSpan_CodeWriter + * @return void + * @access public + */ + function generate(& $Code) { + + switch ( $this->RequestMethod ) { + case 'rawpost': + $this->jsRequestClass = 'JPSpan_Request_RawPost'; + break; + case 'post': + $this->jsRequestClass = 'JPSpan_Request_Post'; + break; + case 'get': + // The JPSpan JS GetRequest object has bugs plus + // changing state via GET is bad idea + // http://www.intertwingly.net/blog/2005/03/16/AJAX-Considered-Harmful + trigger_error('Sending data via GET vars not supported',E_USER_ERROR); + break; + default: + trigger_error('Request method unknown: '.$this->RequestMethod,E_USER_ERROR); + break; + } + + if ( $this->RequestEncoding == 'xml' ) { + $this->jsEncodingClass = 'JPSpan_Encode_Xml'; + } else { + $this->jsEncodingClass = 'JPSpan_Encode_PHP'; + } + + $this->generateScriptHeader($Code); + + foreach ( array_keys($this->descriptions) as $key ) { + $this->generateJsClass($Code, $this->descriptions[$key]); + } + } + + /** + * Generate the starting includes section of the script + * @param JPSpan_CodeWriter + * @return void + * @access private + */ + function generateScriptHeader(& $Code) { + ob_start(); + ?> + /**@ + * include 'remoteobject.js'; + <?php + switch ( $this->RequestMethod ) { + case 'rawpost': + ?> + * include 'request/rawpost.js'; + <?php + break; + case 'post': + ?> + * include 'request/rawpost.js'; + <?php + break; + } + + if ( $this->RequestEncoding == 'xml' ) { + ?> + + * include 'encode/xml.js'; + <?php + } else { + ?> + * include 'encode/php.js'; + <?php + } + ?> + */ + <?php + $Code->append(ob_get_contents()); + ob_end_clean(); + } + + /** + * Generate code for a single description (a single PHP class) + * @param JPSpan_CodeWriter + * @param JPSpan_HandleDescription + * @return void + * @access private + */ + function generateJsClass(& $Code, & $Description) { + ob_start(); + ?> + + function <?php echo $Description->Class; ?>() { + + var oParent = new JPSpan_RemoteObject(); + + if ( arguments[0] ) { + oParent.Async(arguments[0]); + } + + oParent.__remoteClass = '<?php echo $Description->Class; ?>'; + + oParent.__request = new <?php echo $this->jsRequestClass; + ?>(new <?php echo $this->jsEncodingClass; ?>()); + <?php + foreach ( $Description->methods as $method => $url ) { + ?> + + // @access public + oParent.<?php echo $method; ?> = function() { + return this.__call('<?php echo $url; ?>',arguments,'<?php echo $method; ?>'); + }; + <?php + } + ?> + + return oParent; + } + + <?php + $Code->append(ob_get_contents()); + ob_end_clean(); + } + + function getClient() { + require_once JPSPAN . 'CodeWriter.php'; + $Code = & new JPSpan_CodeWriter(); + $this->generate($Code); + $client = $Code->toString(); + + require_once JPSPAN . 'Include.php'; + $I = & JPSpan_Include::instance(); + + // HACK - this needs to change + $I->loadString(__FILE__,$client); + return $I->getCode(); + } + } + + //-------------------------------------------------------------------------------- + /** + * @package JPSpan + * @subpackage Generator + * @access public + */ + class JPSpan_Generator_AdHoc_Description { + + var $Class; + + /** + * Map of method name to URL endpoint for method + */ + var $methods = array(); + + } |
|
From: Harry F. <ha...@us...> - 2005-06-02 22:23:11
|
Update of /cvsroot/jpspan/jpspan/JPSpan/Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26356 Removed Files: Pluggable.php Log Message: Change of plan - headed in wrong direction with this --- Pluggable.php DELETED --- |
|
From: Harry F. <ha...@us...> - 2005-05-29 12:59:47
|
Update of /cvsroot/jpspan/jpspan/JPSpan/Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2282 Added Files: Pluggable.php Log Message: Getting started with an API that could be embedded into frameworks --- NEW FILE: Pluggable.php --- <?php /** * @package JPSpan * @subpackage Server * @version $Id: Pluggable.php,v 1.1 2005/05/29 12:59:38 harryf Exp $ */ //-------------------------------------------------------------------------------- /** * Define */ if ( !defined('JPSPAN') ) { define ('JPSPAN',dirname(__FILE__).'/'); } class JPSpan_Server_Pluggable { var $descriptions = array(); function registerMethod($description) { $this->descriptions[] = $description; } function incoming($inData, $encoding = 'xml', &$failed) { $failed = FALSE; require_once JPSPAN . 'Unserializer.php'; if ( is_string($inData) ) { // Check for errors? return JPSpan_Unserializer::unserialize($inData, $encoding); } else if ( is_array($inData) ) { $return = array(); foreach($inData as $name => $value) { if (is_array($value)) { foreach($value as $key => $data) { // Check for errors? $value[$key] = JPSpan_Unserializer::unserialize( $value[$key], $encoding ); } } else { // Check for errors? $value = JPSpan_Unserializer::unserialize($value, $encoding); } $return[$name] = $value; } return $return; } else { trigger_error( 'Invalid incoming data type '.gettype($data), E_USER_ERROR ); $failed = TRUE; } return FALSE; } function outgoing($outData) { require_once JPSPAN . 'Serializer.php'; return JPSpan_Serializer::serialize($outData); } function generate() { $client = ''; return $client; } } |
|
From: Harry F. <ha...@us...> - 2005-05-26 23:41:01
|
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28239 Modified Files: postoffice_client_generated.php Log Message: Fix to ignore toString properties on arrays Index: postoffice_client_generated.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/postoffice_client_generated.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** postoffice_client_generated.php 26 May 2005 23:02:48 -0000 1.4 --- postoffice_client_generated.php 26 May 2005 23:40:52 -0000 1.5 *************** *** 141,149 **** for (var i=0;i<result.length;i++) { echo ('<br>',true); for (prop in result[i]) { ! if ( prop == 'toPHP' || prop == 'var_dump' ) { continue; } ! echo (result[i][prop]+' : ',true); } } --- 141,151 ---- for (var i=0;i<result.length;i++) { echo ('<br>',true); + var sep = ''; for (prop in result[i]) { ! if ( prop == 'toPHP' || prop == 'var_dump' || prop == 'toString' ) { continue; } ! echo (sep + result[i][prop],true); ! sep = ' : '; } } *************** *** 159,167 **** for (var i=0;i<result.length;i++) { echo ('<br>',true); for (prop in result[i]) { ! if ( prop == 'toPHP' || prop == 'var_dump' ) { continue; } ! echo (result[i][prop]+' : ',true); } } --- 161,171 ---- for (var i=0;i<result.length;i++) { echo ('<br>',true); + var sep = ''; for (prop in result[i]) { ! if ( prop == 'toPHP' || prop == 'var_dump' || prop == 'toString' ) { continue; } ! echo (sep + result[i][prop],true); ! sep = ' : '; } } |
|
From: Harry F. <ha...@us...> - 2005-05-26 23:38:51
|
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27657 Modified Files: postoffice_client.php Log Message: Fix to ignore toString properties on arrays Index: postoffice_client.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/postoffice_client.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** postoffice_client.php 28 Apr 2005 10:26:28 -0000 1.3 --- postoffice_client.php 26 May 2005 23:38:38 -0000 1.4 *************** *** 79,87 **** for (var i=0;i<colors.length;i++) { echo ("<br>"); for (prop in colors[i]) { ! if ( prop == 'toPHP' ) { continue; } ! echo (colors[i][prop]+" : "); } } --- 79,89 ---- for (var i=0;i<colors.length;i++) { echo ("<br>"); + var sep = ''; for (prop in colors[i]) { ! if ( prop == 'toPHP' || prop == 'toString' ) { continue; } ! echo (sep + colors[i][prop]); ! sep = " : "; } } |
|
From: Harry F. <ha...@us...> - 2005-05-26 23:09:46
|
Update of /cvsroot/jpspan/jpspan/JPSpan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21658 Modified Files: Serializer.php Log Message: Fix for MAC \rs - BUG 1197439 Index: Serializer.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Serializer.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Serializer.php 25 Apr 2005 10:13:20 -0000 1.4 --- Serializer.php 26 May 2005 23:09:37 -0000 1.5 *************** *** 277,280 **** --- 277,281 ---- $value = str_replace("\r\n",'\n',$value); $value = str_replace("\n",'\n',$value); + $value = str_replace("\r",'\n',$value); $value = str_replace("\t",'\t',$value); $code->append("var {$this->tmpName} = '$value';"); |
|
From: Harry F. <ha...@us...> - 2005-05-26 23:03:26
|
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20650 Modified Files: log_server.php Log Message: Load the error handler earlier, so logging errors e.g. permissions are caught Index: log_server.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/log_server.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** log_server.php 23 Nov 2004 14:10:56 -0000 1.4 --- log_server.php 26 May 2005 23:03:17 -0000 1.5 *************** *** 9,12 **** --- 9,14 ---- require_once JPSPAN . 'Server/PostOffice.php'; require_once JPSPAN . 'Types.php'; + define('JPSPAN_ERROR_DEBUG',TRUE); + require_once JPSPAN . 'ErrorHandler.php'; //----------------------------------------------------------------------------------- *************** *** 26,30 **** $Data['errorName'].' - '. str_replace(array("\n","\r\n"),'',$Data['errorMsg'])."\n"; ! error_log($message, 3, dirname(__FILE__)."/data/error.log"); } } --- 28,32 ---- $Data['errorName'].' - '. str_replace(array("\n","\r\n"),'',$Data['errorMsg'])."\n"; ! @error_log($message, 3, dirname(__FILE__)."/data/error.log"); } } *************** *** 89,98 **** //----------------------------------------------------------------------------------- if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'client')==0) { ! define('JPSPAN_INCLUDE_COMPRESS',TRUE); $S->displayClient(); } else { - require_once JPSPAN . 'ErrorHandler.php'; $S->serve(); --- 91,99 ---- //----------------------------------------------------------------------------------- if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'client')==0) { ! #define('JPSPAN_INCLUDE_COMPRESS',TRUE); $S->displayClient(); } else { $S->serve(); |
|
From: Harry F. <ha...@us...> - 2005-05-26 23:03:01
|
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20536 Modified Files: postoffice_client_generated.php Log Message: Removing a blunder Index: postoffice_client_generated.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/postoffice_client_generated.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** postoffice_client_generated.php 28 Apr 2005 10:26:28 -0000 1.3 --- postoffice_client_generated.php 26 May 2005 23:02:48 -0000 1.4 *************** *** 13,17 **** <head> <title> PostOffice Server Demo with generated client </title> ! <script type="text/javascript" src="<?php //path(); ?>http://localhost/jpspan/examples/postoffice_server.php?client"></script> <script type="text/javascript"> --- 13,17 ---- <head> <title> PostOffice Server Demo with generated client </title> ! <script type="text/javascript" src="<?php path(); ?>/postoffice_server.php?client"></script> <script type="text/javascript"> |
|
From: Harry F. <ha...@us...> - 2005-05-26 23:01:27
|
Update of /cvsroot/jpspan/jpspan/JPSpan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20117 Modified Files: ErrorHandler.php Log Message: wordwrap error messages so theyre a little more readable in a JS alert box Index: ErrorHandler.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/ErrorHandler.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ErrorHandler.php 25 Apr 2005 10:13:20 -0000 1.4 --- ErrorHandler.php 26 May 2005 23:01:16 -0000 1.5 *************** *** 54,57 **** --- 54,58 ---- $name = 'Server_Error'; $message = strip_tags($message); + $message = wordwrap($message, 60, '\n', 1); $file = addcslashes($file,"\000\042\047\134"); *************** *** 118,121 **** --- 119,123 ---- } else { $message = strip_tags($exception->getMessage()); + $message = wordwrap($message, 60, '\n', 1); } |
|
From: Harry F. <ha...@us...> - 2005-05-26 22:40:09
|
Update of /cvsroot/jpspan/jpspan/JPSpan/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15571 Modified Files: remoteobject.js Log Message: Cleaning up the default error messages and adding error code plus server script file and line number Index: remoteobject.js =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/js/remoteobject.js,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** remoteobject.js 22 Nov 2004 23:28:11 -0000 1.12 --- remoteobject.js 26 May 2005 22:40:01 -0000 1.13 *************** *** 40,54 **** clientErrorFunc: function(e) { ! try { ! var errorMsg = '['+e.name+'] '+e.message; ! } catch (ex) { ! var errorMsg = '[Client_Error] '+e; ! } ! ! if ( e.client && e.call ) { ! errorMsg = errorMsg + ' while calling '+e.client+'.'+e.call+'()'; ! } ! ! alert(errorMsg); }, --- 40,44 ---- clientErrorFunc: function(e) { ! alert(this.__drawErrorMsg('Client_Error',e)); }, *************** *** 66,77 **** serverErrorFunc: function(e) { ! try { ! var errorMsg = '['+e.name+'] '+e.message; ! } catch (ex) { ! var errorMsg = '[Server_Error] '+e; ! } ! ! if ( e.client && e.call ) { ! errorMsg = errorMsg + ' while calling '+e.client+ '.'+e.call+'()'; } --- 56,64 ---- serverErrorFunc: function(e) { ! var errorMsg = this.__drawErrorMsg('Server_Error',e); ! ! if ( e.file && e.line ) { ! errorMsg += "\nServer script: " ! +e.file+" on line "+e.line; } *************** *** 88,103 **** applicationErrorFunc: function(e) { try { ! var errorMsg = '['+e.name+'] '+e.message; } catch (ex) { ! var errorMsg = '[Application_Error] '+e; } ! if ( e.client && e.call ) { ! errorMsg = errorMsg + ' while calling '+e.client+ '.'+e.call+'()'; } ! ! alert(errorMsg); ! }, --- 75,107 ---- applicationErrorFunc: function(e) { + alert(this.__drawErrorMsg('Application_Error',e)); + + }, + + // Builds a string error message from an exceptions + // properties + // @private + __drawErrorMsg: function(type, e) { + try { ! var errorMsg = '['+e.name+']'; ! if ( e.code ) { ! errorMsg += '['+e.code+']'; ! } ! errorMsg += ' '+e.message; } catch (ex) { ! var errorMsg = '['+type+'] '; ! if ( e.code ) { ! errorMsg += '['+e.code+']'; ! } ! errorMsg += ' '+e.message; } ! if ( e.client && e.call ) { ! errorMsg += "\nMethod called: " ! +e.client+ "."+e.call+"()"; } ! ! return errorMsg; }, |
|
From: Harry F. <ha...@us...> - 2005-04-28 13:30:49
|
Update of /cvsroot/jpspan/jpspan/tests/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2123 Modified Files: encode_xml.test.php Log Message: Fix test so it works when PHP short_open_tag is on Index: encode_xml.test.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/tests/js/encode_xml.test.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** encode_xml.test.php 10 Dec 2004 23:32:05 -0000 1.4 --- encode_xml.test.php 28 Apr 2005 13:30:21 -0000 1.5 *************** *** 31,35 **** <?php jsunit_drawUtils(); ?> <?php JPSpan_Includes_Display(); ?> ! //----------------------------------------------------------------------------- --- 31,35 ---- <?php jsunit_drawUtils(); ?> <?php JPSpan_Includes_Display(); ?> ! var xmlOpen = String.fromCharCode(60); //----------------------------------------------------------------------------- *************** *** 37,41 **** var enc = new JPSpan_Encode_Xml(); var foo = "Hello World"; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><s>Hello World</s></r>',enc.encode(foo)); } --- 37,41 ---- var enc = new JPSpan_Encode_Xml(); var foo = "Hello World"; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><s>Hello World</s></r>",enc.encode(foo)); } *************** *** 45,49 **** var enc = new JPSpan_Encode_Xml(); var foo = 'Iñtërnâtiônà lizætiøn'; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><s>Iñtërnâtiônà lizætiøn</s></r>',enc.encode(foo)); } --- 45,49 ---- var enc = new JPSpan_Encode_Xml(); var foo = 'Iñtërnâtiônà lizætiøn'; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><s>Iñtërnâtiônà lizætiøn</s></r>",enc.encode(foo)); } *************** *** 52,56 **** var enc = new JPSpan_Encode_Xml(); var foo = ""; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><s></s></r>',enc.encode(foo)); } --- 52,56 ---- var enc = new JPSpan_Encode_Xml(); var foo = ""; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><s></s></r>",enc.encode(foo)); } *************** *** 60,64 **** var enc = new JPSpan_Encode_Xml(); var foo = true; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><b v="1"/></r>',enc.encode(foo)); } --- 60,64 ---- var enc = new JPSpan_Encode_Xml(); var foo = true; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><b v=\"1\"/></r>",enc.encode(foo)); } *************** *** 68,72 **** var enc = new JPSpan_Encode_Xml(); var foo = false; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><b v="0"/></r>',enc.encode(foo)); } --- 68,72 ---- var enc = new JPSpan_Encode_Xml(); var foo = false; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><b v=\"0\"/></r>",enc.encode(foo)); } *************** *** 75,79 **** var enc = new JPSpan_Encode_Xml(); var foo = null; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><n/></r>',enc.encode(foo)); } --- 75,79 ---- var enc = new JPSpan_Encode_Xml(); var foo = null; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><n/></r>",enc.encode(foo)); } *************** *** 82,86 **** var enc = new JPSpan_Encode_Xml(); try { ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><n/></r>',enc.encode(foo)); fail('undef should cause reference error'); } catch(e) { --- 82,86 ---- var enc = new JPSpan_Encode_Xml(); try { ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><n/></r>",enc.encode(foo)); fail('undef should cause reference error'); } catch(e) { *************** *** 93,97 **** var enc = new JPSpan_Encode_Xml(); var foo = 2; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><i v="2"/></r>',enc.encode(foo)); } --- 93,97 ---- var enc = new JPSpan_Encode_Xml(); var foo = 2; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><i v=\"2\"/></r>",enc.encode(foo)); } *************** *** 101,105 **** var enc = new JPSpan_Encode_Xml(); var foo = 2.2; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><d v="2.2"/></r>',enc.encode(foo)); } --- 101,105 ---- var enc = new JPSpan_Encode_Xml(); var foo = 2.2; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><d v=\"2.2\"/></r>",enc.encode(foo)); } *************** *** 109,113 **** var enc = new JPSpan_Encode_Xml(); var foo = 0; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><i v="0"/></r>',enc.encode(foo)); } --- 109,113 ---- var enc = new JPSpan_Encode_Xml(); var foo = 0; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><i v=\"0\"/></r>",enc.encode(foo)); } *************** *** 117,121 **** var enc = new JPSpan_Encode_Xml(); var foo = 0.0; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><i v="0"/></r>',enc.encode(foo)); } --- 117,121 ---- var enc = new JPSpan_Encode_Xml(); var foo = 0.0; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><i v=\"0\"/></r>",enc.encode(foo)); } *************** *** 125,129 **** var enc = new JPSpan_Encode_Xml(); var foo = new Function("x", "y", "return (x + y)/2"); ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><n/></r>',enc.encode(foo)); } --- 125,129 ---- var enc = new JPSpan_Encode_Xml(); var foo = new Function("x", "y", "return (x + y)/2"); ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><n/></r>",enc.encode(foo)); } *************** *** 133,137 **** var enc = new JPSpan_Encode_Xml(); var foo = new Array(); ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><a></a></r>',enc.encode(foo)); } --- 133,137 ---- var enc = new JPSpan_Encode_Xml(); var foo = new Array(); ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><a></a></r>",enc.encode(foo)); } *************** *** 143,147 **** 'a','b','c' ]; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><a><e k="0"><s>a</s></e><e k="1"><s>b</s></e><e k="2"><s>c</s></e></a></r>',enc.encode(foo)); } --- 143,147 ---- 'a','b','c' ]; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><a><e k=\"0\"><s>a</s></e><e k=\"1\"><s>b</s></e><e k=\"2\"><s>c</s></e></a></r>",enc.encode(foo)); } *************** *** 159,163 **** foo.push('c'); foo.m = 'z'; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><a><e k="0"><s>a</s></e><e k="1"><s>x</s></e><e k="2"><s>y</s></e><e k="3"><s>b</s></e><e k="4"><s>c</s></e><e k="m"><s>z</s></e></a></r>',enc.encode(foo)); } --- 159,163 ---- foo.push('c'); foo.m = 'z'; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><a><e k=\"0\"><s>a</s></e><e k=\"1\"><s>x</s></e><e k=\"2\"><s>y</s></e><e k=\"3\"><s>b</s></e><e k=\"4\"><s>c</s></e><e k=\"m\"><s>z</s></e></a></r>",enc.encode(foo)); } *************** *** 167,171 **** var enc = new JPSpan_Encode_Xml(); var foo = new Object(); ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><o c="jpspan_object"></o></r>',enc.encode(foo)); } --- 167,171 ---- var enc = new JPSpan_Encode_Xml(); var foo = new Object(); ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><o c=\"jpspan_object\"></o></r>",enc.encode(foo)); } *************** *** 180,184 **** foo.d = false; foo.e = ['a','b','c']; ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><o c="jpspan_object"><e k="a"><s>x</s></e><e k="b"><i v="2"/></e><e k="c"><d v="3.3"/></e><e k="d"><b v="0"/></e><e k="e"><a><e k="0"><s>a</s></e><e k="1"><s>b</s></e><e k="2"><s>c</s></e></a></e></o></r>',enc.encode(foo)); } --- 180,184 ---- foo.d = false; foo.e = ['a','b','c']; ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><o c=\"jpspan_object\"><e k=\"a\"><s>x</s></e><e k=\"b\"><i v=\"2\"/></e><e k=\"c\"><d v=\"3.3\"/></e><e k=\"d\"><b v=\"0\"/></e><e k=\"e\"><a><e k=\"0\"><s>a</s></e><e k=\"1\"><s>b</s></e><e k=\"2\"><s>c</s></e></a></e></o></r>",enc.encode(foo)); } *************** *** 198,202 **** } } ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><o c="jpspan_object"><e k="prototype"><o c="jpspan_object"><e k="a"><s>x</s></e><e k="b"><i v="2"/></e><e k="c"><i v="2"/></e><e k="d"><b v="0"/></e><e k="e"><a><e k="0"><s>a</s></e><e k="1"><s>b</s></e><e k="2"><s>c</s></e></a></e><e k="f"><n/></e></o></e></o></r>',enc.encode(foo)); } --- 198,202 ---- } } ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><o c=\"jpspan_object\"><e k=\"prototype\"><o c=\"jpspan_object\"><e k=\"a\"><s>x</s></e><e k=\"b\"><i v=\"2\"/></e><e k=\"c\"><i v=\"2\"/></e><e k=\"d\"><b v=\"0\"/></e><e k=\"e\"><a><e k=\"0\"><s>a</s></e><e k=\"1\"><s>b</s></e><e k=\"2\"><s>c</s></e></a></e><e k=\"f\"><n/></e></o></e></o></r>",enc.encode(foo)); } *************** *** 226,230 **** var enc = new JPSpan_Encode_Xml(); var foo = new Date(2004,9,2); ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><o c="jpspan_object"></o></r>',enc.encode(foo)); } --- 226,230 ---- var enc = new JPSpan_Encode_Xml(); var foo = new Date(2004,9,2); ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><o c=\"jpspan_object\"></o></r>",enc.encode(foo)); } *************** *** 234,238 **** var enc = new JPSpan_Encode_Xml(); var e = new Error('Test'); ! assertEquals('<?xml version="1.0" encoding="UTF-8"?><r><o c="jpspan_error"><e k="name"><s>Error</s></e><e k="message"><s>Test</s></e></o></r>',enc.encode(e)); } --- 234,238 ---- var enc = new JPSpan_Encode_Xml(); var e = new Error('Test'); ! assertEquals(xmlOpen+"?xml version=\"1.0\" encoding=\"UTF-8\"?><r><o c=\"jpspan_error\"><e k=\"name\"><s>Error</s></e><e k=\"message\"><s>Test</s></e></o></r>",enc.encode(e)); } |
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31638 Modified Files: autocomplete.php callstates.php log.php postoffice_client.php postoffice_client_generated.php sfsearch.php Added Files: example_utils.php Log Message: Tuning examples for CGI support Index: sfsearch.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/sfsearch.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sfsearch.php 16 Nov 2004 21:03:50 -0000 1.2 --- sfsearch.php 28 Apr 2005 10:26:28 -0000 1.3 *************** *** 6,20 **** header( "Pragma: no-cache" ); ! function path() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); ! $script = array_pop($basePath); ! $basePath = implode('/',$basePath); ! if ( isset($_SERVER['HTTPS']) ) { ! $scheme = 'https'; ! } else { ! $scheme = 'http'; ! } ! echo $scheme.'://'.$_SERVER['SERVER_NAME'].$basePath; ! } ?> --- 6,10 ---- header( "Pragma: no-cache" ); ! require_once 'example_utils.php'; ?> Index: callstates.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/callstates.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** callstates.php 23 Nov 2004 11:06:00 -0000 1.2 --- callstates.php 28 Apr 2005 10:26:28 -0000 1.3 *************** *** 7,21 **** // Just a utility to help the example work out where the server URL is... ! function path() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); ! $script = array_pop($basePath); ! $basePath = implode('/',$basePath); ! if ( isset($_SERVER['HTTPS']) ) { ! $scheme = 'https'; ! } else { ! $scheme = 'http'; ! } ! echo $scheme.'://'.$_SERVER['SERVER_NAME'].$basePath; ! } ?> --- 7,11 ---- // Just a utility to help the example work out where the server URL is... ! require_once 'example_utils.php'; ?> Index: postoffice_client_generated.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/postoffice_client_generated.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** postoffice_client_generated.php 16 Nov 2004 09:43:14 -0000 1.2 --- postoffice_client_generated.php 28 Apr 2005 10:26:28 -0000 1.3 *************** *** 6,20 **** header( "Pragma: no-cache" ); ! function path() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); ! $script = array_pop($basePath); ! $basePath = implode('/',$basePath); ! if ( isset($_SERVER['HTTPS']) ) { ! $scheme = 'https'; ! } else { ! $scheme = 'http'; ! } ! echo $scheme.'://'.$_SERVER['SERVER_NAME'].$basePath; ! } ?> --- 6,10 ---- header( "Pragma: no-cache" ); ! require_once 'example_utils.php'; ?> *************** *** 23,27 **** <head> <title> PostOffice Server Demo with generated client </title> ! <script type="text/javascript" src="<?php path(); ?>/postoffice_server.php?client"></script> <script type="text/javascript"> --- 13,17 ---- <head> <title> PostOffice Server Demo with generated client </title> ! <script type="text/javascript" src="<?php //path(); ?>http://localhost/jpspan/examples/postoffice_server.php?client"></script> <script type="text/javascript"> *************** *** 99,103 **** // Called on error with math.divide() method divideError: function(e) { ! alert(e.message); } } --- 89,95 ---- // Called on error with math.divide() method divideError: function(e) { ! for ( var prop in e ) { ! alert(e[prop]); ! } } } Index: autocomplete.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/autocomplete.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** autocomplete.php 23 Nov 2004 14:09:58 -0000 1.3 --- autocomplete.php 28 Apr 2005 10:26:28 -0000 1.4 *************** *** 7,21 **** // Just a utility to help the example work out where the server URL is... ! function path() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); ! $script = array_pop($basePath); ! $basePath = implode('/',$basePath); ! if ( isset($_SERVER['HTTPS']) ) { ! $scheme = 'https'; ! } else { ! $scheme = 'http'; ! } ! echo $scheme.'://'.$_SERVER['SERVER_NAME'].$basePath; ! } ?> --- 7,11 ---- // Just a utility to help the example work out where the server URL is... ! require_once 'example_utils.php'; ?> Index: postoffice_client.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/postoffice_client.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** postoffice_client.php 15 Nov 2004 21:23:15 -0000 1.2 --- postoffice_client.php 28 Apr 2005 10:26:28 -0000 1.3 *************** *** 16,30 **** header( "Pragma: no-cache" ); ! function path() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); ! $script = array_pop($basePath); ! $basePath = implode('/',$basePath); ! if ( isset($_SERVER['HTTPS']) ) { ! $scheme = 'https'; ! } else { ! $scheme = 'http'; ! } ! echo $scheme.'://'.$_SERVER['SERVER_NAME'].$basePath; ! } ?> --- 16,20 ---- header( "Pragma: no-cache" ); ! require_once 'example_utils.php'; ?> Index: log.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/log.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** log.php 18 Nov 2004 20:34:20 -0000 1.2 --- log.php 28 Apr 2005 10:26:28 -0000 1.3 *************** *** 7,21 **** // Just a utility to help the example work out where the server URL is... ! function path() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); ! $script = array_pop($basePath); ! $basePath = implode('/',$basePath); ! if ( isset($_SERVER['HTTPS']) ) { ! $scheme = 'https'; ! } else { ! $scheme = 'http'; ! } ! echo $scheme.'://'.$_SERVER['SERVER_NAME'].$basePath; ! } ?> --- 7,11 ---- // Just a utility to help the example work out where the server URL is... ! require_once 'example_utils.php'; ?> --- NEW FILE: example_utils.php --- <?php // Just a utility to help the example work out where the server URL is... function path() { if ( isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == $_SERVER['PHP_SELF'] ) { $script_name = $_SERVER['PATH_INFO']; } else { $script_name = $_SERVER['SCRIPT_NAME']; } $basePath = explode('/',$script_name); $script = array_pop($basePath); $basePath = implode('/',$basePath); if ( isset($_SERVER['HTTPS']) ) { $scheme = 'https'; } else { $scheme = 'http'; } echo $scheme.'://'.$_SERVER['SERVER_NAME'].$basePath; } |
|
From: Harry F. <ha...@us...> - 2005-04-28 09:59:08
|
Update of /cvsroot/jpspan/jpspan/JPSpan/Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17789/Server Modified Files: PostOffice.php Log Message: Tuning use of PHP globals Index: PostOffice.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Server/PostOffice.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PostOffice.php 20 Apr 2005 14:49:49 -0000 1.13 --- PostOffice.php 28 Apr 2005 09:58:58 -0000 1.14 *************** *** 144,148 **** function resolveCall() { // Hack between server.php?class/method and server.php/class/method ! $uriPath = key($_GET); if ( $uriPath ) { --- 144,148 ---- function resolveCall() { // Hack between server.php?class/method and server.php/class/method ! $uriPath = $_SERVER['QUERY_STRING']; if ( $uriPath ) { |
|
From: Harry F. <ha...@us...> - 2005-04-28 09:59:08
|
Update of /cvsroot/jpspan/jpspan/JPSpan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17789 Modified Files: Server.php Log Message: Tuning use of PHP globals Index: Server.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Server.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Server.php 20 Apr 2005 14:49:48 -0000 1.6 --- Server.php 28 Apr 2005 09:58:58 -0000 1.7 *************** *** 58,67 **** $prot = 'http://'; } ! if ( isset($_SERVER['PATH_INFO']) ) { ! $script_name = $_SERVER['PATH_INFO']; ! } else { ! $script_name = $_SERVER['SCRIPT_NAME']; ! } ! $this->serverUrl = $prot.$_SERVER['HTTP_HOST'].$script_name; } --- 58,62 ---- $prot = 'http://'; } ! $this->serverUrl = $prot.$_SERVER['HTTP_HOST'].$this->resolveScriptName(); } *************** *** 169,173 **** function getUriPath() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); $script = array_pop($basePath); $basePath = implode('/',$basePath); --- 164,168 ---- function getUriPath() { ! $basePath = explode('/',$this->resolveScriptName()); $script = array_pop($basePath); $basePath = implode('/',$basePath); *************** *** 190,193 **** --- 185,204 ---- /** + * Introspects the name of the script. Depending on the PHP SAPI + * determining the name of the current script varies. This will probably + * need updating later and testing under a number of environments + * @return string script name + * @access public + */ + function resolveScriptName() { + if ( isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == $_SERVER['PHP_SELF'] ) { + $script_name = $_SERVER['PATH_INFO']; + } else { + $script_name = $_SERVER['SCRIPT_NAME']; + } + return $script_name; + } + + /** * Load the error reader * @param string (optional) 2 letter localization code e.g. 'en' |
|
From: Harry F. <ha...@us...> - 2005-04-25 10:13:35
|
Update of /cvsroot/jpspan/jpspan/JPSpan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27869 Modified Files: ErrorHandler.php Serializer.php Include.php Log Message: Replace use of addslashes with addcslashes re bug 1161254 Index: Serializer.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Serializer.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Serializer.php 23 Nov 2004 11:53:42 -0000 1.3 --- Serializer.php 25 Apr 2005 10:13:20 -0000 1.4 *************** *** 195,199 **** $child->generate($code); ! $code->write('new Function("'.addSlashes($code->toString()).$child->getReturn().'");'); } } --- 195,199 ---- $child->generate($code); ! $code->write('new Function("'.addcslashes($code->toString(),"\000\042\047\134").$child->getReturn().'");'); } } *************** *** 274,278 **** */ function generate(&$code) { ! $value = addSlashes($this->value); $value = str_replace("\r\n",'\n',$value); $value = str_replace("\n",'\n',$value); --- 274,278 ---- */ function generate(&$code) { ! $value = addcslashes($this->value,"\000\042\047\134"); $value = str_replace("\r\n",'\n',$value); $value = str_replace("\n",'\n',$value); *************** *** 559,563 **** $error .= "throw e;"; // Wrap in anon function - violates RootElement ! $code->write('new Function("'.addSlashes($error).'");'); // Disable further code writing so only single Error returned --- 559,563 ---- $error .= "throw e;"; // Wrap in anon function - violates RootElement ! $code->write('new Function("'.addcslashes($error,"\000\042\047\134").'");'); // Disable further code writing so only single Error returned Index: ErrorHandler.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/ErrorHandler.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ErrorHandler.php 18 Nov 2004 13:33:26 -0000 1.3 --- ErrorHandler.php 25 Apr 2005 10:13:20 -0000 1.4 *************** *** 54,58 **** $name = 'Server_Error'; $message = strip_tags($message); ! $file = addslashes($file); switch ( $level ) { --- 54,58 ---- $name = 'Server_Error'; $message = strip_tags($message); ! $file = addcslashes($file,"\000\042\047\134"); switch ( $level ) { *************** *** 84,88 **** } $error .= "throw e;"; ! echo 'new Function("'.addSlashes($error).'");'; if ( !defined('JPSPAN') ) { --- 84,88 ---- } $error .= "throw e;"; ! echo 'new Function("'.addcslashes($error,"\000\042\047\134").'");'; if ( !defined('JPSPAN') ) { *************** *** 112,116 **** $name = 'Server_Error'; ! $file = addSlashes($exception->getFile()); if ( !JPSPAN_ERROR_MESSAGES ) { --- 112,116 ---- $name = 'Server_Error'; ! $file = addcslashes($exception->getFile(),"\000\042\047\134"); if ( !JPSPAN_ERROR_MESSAGES ) { *************** *** 127,131 **** } $error .= "throw e;"; ! echo 'new Function("'.addSlashes($error).'");'; if ( !defined('JPSPAN') ) { --- 127,131 ---- } $error .= "throw e;"; ! echo 'new Function("'.addcslashes($error,"\000\042\047\134").'");'; if ( !defined('JPSPAN') ) { Index: Include.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Include.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Include.php 23 Nov 2004 13:23:10 -0000 1.5 --- Include.php 25 Apr 2005 10:13:20 -0000 1.6 *************** *** 112,116 **** foreach ( $errors['Client_Error'] as $key => $value ) { ! $value = addslashes($value); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } --- 112,116 ---- foreach ( $errors['Client_Error'] as $key => $value ) { ! $value = addcslashes($value,"\000\042\047\134"); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } *************** *** 120,129 **** continue; } ! $value = addslashes($value); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } foreach ( $errors['Server_Error'] as $key => $value ) { ! $value = addslashes($value); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } --- 120,129 ---- continue; } ! $value = addcslashes($value,"\000\042\047\134"); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } foreach ( $errors['Server_Error'] as $key => $value ) { ! $value = addcslashes($value,"\000\042\047\134"); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } *************** *** 133,142 **** continue; } ! $value = addslashes($value); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } foreach ( $errors['Application_Error'] as $key => $value ) { ! $value = addslashes($value); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } --- 133,142 ---- continue; } ! $value = addcslashes($value,"\000\042\047\134"); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } foreach ( $errors['Application_Error'] as $key => $value ) { ! $value = addcslashes($value,"\000\042\047\134"); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } *************** *** 146,150 **** continue; } ! $value = addslashes($value); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } --- 146,150 ---- continue; } ! $value = addcslashes($value,"\000\042\047\134"); $script .= "JPSpan_Util_ErrorReader.prototype.errorList[$key] = '$value';\n"; } |
|
From: Harry F. <ha...@us...> - 2005-04-20 14:49:59
|
Update of /cvsroot/jpspan/jpspan/JPSpan/Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7166/Server Modified Files: PostOffice.php Log Message: Fixes / hacks for PHP CGI. Means modifying the generated code ie the call syntax slightly Index: PostOffice.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Server/PostOffice.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PostOffice.php 20 Apr 2005 09:43:29 -0000 1.12 --- PostOffice.php 20 Apr 2005 14:49:49 -0000 1.13 *************** *** 143,147 **** */ function resolveCall() { ! $uriPath = explode('/',JPSpan_Server::getUriPath()); if ( count($uriPath) != 2 ) { --- 143,158 ---- */ function resolveCall() { ! // Hack between server.php?class/method and server.php/class/method ! $uriPath = key($_GET); ! ! if ( $uriPath ) { ! if ( preg_match('/\/$/',$uriPath) ) { ! $uriPath = substr($uriPath,0, strlen($uriPath)-1); ! } ! } else { ! $uriPath = JPSpan_Server::getUriPath(); ! } ! ! $uriPath = explode('/',$uriPath); if ( count($uriPath) != 2 ) { *************** *** 311,315 **** oParent.__serverurl = '<?php ! echo $this->serverUrl . '/' . $Description->Class; ?>'; oParent.__remoteClass = '<?php echo $Description->Class; ?>'; --- 322,326 ---- oParent.__serverurl = '<?php ! echo $this->serverUrl . '?' . $Description->Class; ?>'; oParent.__remoteClass = '<?php echo $Description->Class; ?>'; |
|
From: Harry F. <ha...@us...> - 2005-04-20 14:49:59
|
Update of /cvsroot/jpspan/jpspan/JPSpan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7166 Modified Files: Server.php Log Message: Fixes / hacks for PHP CGI. Means modifying the generated code ie the call syntax slightly Index: Server.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Server.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Server.php 23 Nov 2004 13:49:25 -0000 1.5 --- Server.php 20 Apr 2005 14:49:48 -0000 1.6 *************** *** 58,62 **** $prot = 'http://'; } ! $this->serverUrl = $prot.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; } --- 58,67 ---- $prot = 'http://'; } ! if ( isset($_SERVER['PATH_INFO']) ) { ! $script_name = $_SERVER['PATH_INFO']; ! } else { ! $script_name = $_SERVER['SCRIPT_NAME']; ! } ! $this->serverUrl = $prot.$_SERVER['HTTP_HOST'].$script_name; } *************** *** 163,167 **** */ function getUriPath() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); $script = array_pop($basePath); --- 168,172 ---- */ function getUriPath() { ! $basePath = explode('/',$_SERVER['SCRIPT_NAME']); $script = array_pop($basePath); *************** *** 169,173 **** // Determine URI path - path variables to the right of the PHP script ! if ( false !== strpos ( $_SERVER['REQUEST_URI'], $script ) ) { $uriPath = explode( $script,$_SERVER['REQUEST_URI'] ); $uriPath = $uriPath[1]; --- 174,178 ---- // Determine URI path - path variables to the right of the PHP script ! if ( $script && ( false !== strpos ( $_SERVER['REQUEST_URI'], $script ) ) ) { $uriPath = explode( $script,$_SERVER['REQUEST_URI'] ); $uriPath = $uriPath[1]; |
|
From: Harry F. <ha...@us...> - 2005-04-20 14:48:58
|
Update of /cvsroot/jpspan/jpspan/tests/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6547 Modified Files: server.test.php Log Message: Modify server url test for CGI Index: server.test.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/tests/php/server.test.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** server.test.php 10 Nov 2004 16:03:11 -0000 1.3 --- server.test.php 20 Apr 2005 14:48:45 -0000 1.4 *************** *** 30,33 **** --- 30,34 ---- var $server_name; var $script_name; + var $path_info; var $request_uri; *************** *** 36,39 **** --- 37,43 ---- $this->server_name = $_SERVER['SERVER_NAME']; $this->script_name = $_SERVER['SCRIPT_NAME']; + if ( isset($_SERVER['PATH_INFO']) ) { + $this->path_info = $_SERVER['PATH_INFO']; + } $this->request_uri = $_SERVER['REQUEST_URI']; } *************** *** 42,45 **** --- 46,52 ---- $_SERVER['SERVER_NAME'] = $this->server_name; $_SERVER['SCRIPT_NAME'] = $this->script_name; + if ( isset($_SERVER['PATH_INFO']) ) { + $_SERVER['PATH_INFO'] = $this->path_info; + } $_SERVER['REQUEST_URI'] = $this->request_uri; } *************** *** 47,50 **** --- 54,60 ---- function testServerUrl() { $_SERVER['SCRIPT_NAME'] = '/index.php'; + if ( isset($_SERVER['PATH_INFO']) ) { + $_SERVER['PATH_INFO'] = '/index.php'; + } $S = & new JPSpan_Server(); $this->assertEqual($S->getServerUrl(),'http://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']); |
|
From: Harry F. <ha...@us...> - 2005-04-20 09:52:15
|
Update of /cvsroot/jpspan/jpspan/tests/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12005 Modified Files: postoffice.test.php Log Message: Update existing tests so that request method is POST and add test to check invalid request method error Index: postoffice.test.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/tests/php/postoffice.test.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** postoffice.test.php 23 Nov 2004 12:01:21 -0000 1.6 --- postoffice.test.php 20 Apr 2005 09:51:54 -0000 1.7 *************** *** 45,48 **** --- 45,49 ---- var $request_uri; var $post; + var $method; var $rawpost; *************** *** 53,56 **** --- 54,58 ---- $this->request_uri = $_SERVER['REQUEST_URI']; $this->post = $_POST; + $this->method = $_SERVER['REQUEST_METHOD']; global $HTTP_RAW_POST_DATA; $this->rawpost = $HTTP_RAW_POST_DATA; *************** *** 61,72 **** --- 63,86 ---- $_SERVER['SCRIPT_NAME'] = $this->script_name; $_SERVER['REQUEST_URI'] = $this->request_uri; + $_SERVER['REQUEST_METHOD'] = $this->method; $_POST = $this->post; global $HTTP_RAW_POST_DATA; $HTTP_RAW_POST_DATA = $this->rawpost; } + + function testInvalidRequestMethod() { + $_SERVER['SCRIPT_NAME'] = '/index.php'; + $_SERVER['REQUEST_URI'] = '/index.php?foo=bar'; + $_SERVER['REQUEST_METHOD'] = 'GET'; + $S = & new JPSpan_Server_PostOffice(); + $S->RequestEncoding = 'php'; + $S->serve(FALSE); + $this->assertErrorPattern('/Invalid HTTP request method/'); + } function testInvalidCallSyntax1() { $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php?foo=bar'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 78,81 **** --- 92,96 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/foo'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 87,90 **** --- 102,106 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/2/bar'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 96,99 **** --- 112,116 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/FOO/bar'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 105,108 **** --- 122,126 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/foo/2'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 114,117 **** --- 132,136 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/foo/BAR'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 123,126 **** --- 142,146 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/foo/bar'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 132,135 **** --- 152,156 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/jpspan_testhandler_postoffice/bar'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 143,146 **** --- 164,168 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/jpspan_testhandler_postoffice/test'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $S = & new JPSpan_Server_PostOffice(); $S->RequestEncoding = 'php'; *************** *** 158,161 **** --- 180,184 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/jpspan_testhandler_postoffice/hello'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $_POST['name'] = 'Joe'; $S = & new JPSpan_Server_PostOffice(); *************** *** 174,177 **** --- 197,201 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/jpspan_testhandler_postoffice/add'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $_POST['x'] = '3'; $_POST['y'] = '4'; *************** *** 191,194 **** --- 215,219 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/jpspan_testhandler_postoffice/getlist'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $_POST['whatever'] = array('a','b','c'); $S = & new JPSpan_Server_PostOffice(); *************** *** 207,210 **** --- 232,236 ---- $_SERVER['SCRIPT_NAME'] = '/index.php'; $_SERVER['REQUEST_URI'] = '/index.php/jpspan_testhandler_postoffice/hello'; + $_SERVER['REQUEST_METHOD'] = 'POST'; global $HTTP_RAW_POST_DATA; $HTTP_RAW_POST_DATA = '<?xml version="1.0" encoding="UTF-8"?><r><a><e k="0"><s>Joe</s></e></a></r>'; |
|
From: Harry F. <ha...@us...> - 2005-04-20 09:43:39
|
Update of /cvsroot/jpspan/jpspan/JPSpan/Server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7646 Modified Files: PostOffice.php Log Message: Require the incoming request to use the POST method. See http://www.intertwingly.net/blog/2005/03/16/AJAX-Considered-Harmful Index: PostOffice.php =================================================================== RCS file: /cvsroot/jpspan/jpspan/JPSpan/Server/PostOffice.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PostOffice.php 23 Nov 2004 13:49:56 -0000 1.11 --- PostOffice.php 20 Apr 2005 09:43:29 -0000 1.12 *************** *** 69,72 **** --- 69,77 ---- $this->calledMethod = NULL; + if ( $_SERVER['REQUEST_METHOD'] != 'POST' ) { + trigger_error('Invalid HTTP request method: '.$_SERVER['REQUEST_METHOD'],E_USER_ERROR); + return FALSE; + } + if ( $this->resolveCall() ) { |
|
From: Jason E. S. <js...@us...> - 2004-12-12 00:53:58
|
Update of /cvsroot/jpspan/jpspan/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7709 Modified Files: autocomplete2.html Log Message: dependant call (lookup airports for the specified country) working Index: autocomplete2.html =================================================================== RCS file: /cvsroot/jpspan/jpspan/examples/autocomplete2.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** autocomplete2.html 12 Dec 2004 00:15:38 -0000 1.1 --- autocomplete2.html 12 Dec 2004 00:53:49 -0000 1.2 *************** *** 10,14 **** var airports; function setCountries() { ! var a = new autocomplete2(CountryCompletionHandler); a.timeout = 3000; a.clientErrorFunc = function(e) { --- 10,14 ---- var airports; function setCountries() { ! var a = new autocomplete2(CountryCompletionHandler); a.timeout = 3000; a.clientErrorFunc = function(e) { *************** *** 25,34 **** } } setCountries(); </script> </head> <body> ! <input id="country" name="country" size="35" type="text" autocomplete="off" value="" language="javascript" onkeyup="actb_tocomplete(this, event,countries,false);" onblur="actb_removedisp(this);" onkeydown="actb_checkkey(event);" onkeypress="return handleEnter(this, event)"> ! <button onClick="alert(countries);">array</button> </body> </html> --- 25,63 ---- } } + + function setAirports() { + c = document.getElementById('country'); + var country = c.value; + var a = new autocomplete2(AirportCompletionHandler); + a.timeout = 3000; + a.clientErrorFunc = function(e) { + if ( e.code != 1003 ) { + alert(e); + } + } + a.getairports(country); + } + var AirportCompletionHandler = { + // Callback method + getairports: function(result2) { + airports = result2; + } + } setCountries(); </script> </head> <body> ! <h1>Dependant Autocomplete Selection via JpSpan Example</h1> ! <h2>Step 1</h2> ! <p>Select a country:<br> ! <input id="country" name="country" size="35" type="text" autocomplete="off" value="" language="javascript" onkeyup="actb_tocomplete(this, event,countries,false);" onblur="actb_removedisp(this);setAirports();" onkeydown="actb_checkkey(event);" onkeypress="return handleEnter(this, event)"> ! </p> ! <p> </p> ! <h2>Step 2</h2> ! <p>Select an airport:<br> ! <input id="airport" name="airport" size="55" type="text" autocomplete="off" value="" language="javascript" onkeyup="actb_tocomplete(this, event,airports,false);" onblur="actb_removedisp(this);" onkeydown="actb_checkkey(event);" onkeypress="return handleEnter(this, event)"> ! </p> ! <p><button onClick="document.getElementById('country').value='';document.getElementById('airport').value='';" >Clear</button> ! <p><b>Note:</b> It might take a few seconds after you loose focus on the country box before the array is populated for the airport input because we are using asynchronus JpSpan calls.</p> </body> </html> |
|
From: Jason E. S. <js...@us...> - 2004-12-12 00:15:49
|
Update of /cvsroot/jpspan/jpspan/examples/actb/img In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32216/actb/img Added Files: arrowDown.gif arrowUp.gif Log Message: inital stab at a second autocomplete example --- NEW FILE: arrowUp.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: arrowDown.gif --- (This appears to be a binary file; contents omitted.) |