CVSROOT: /cvsroot/phpgwapi Module name: phpgwapi Changes by: Caeies <Caeies> 06/12/28 18:02:30
Modified files: doc/soap : nusoap2phpgwapi Log message: use the new phpgwapi system for prefixing classes CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/phpgwapi/doc/soap/nusoap2phpgwapi?cvsroot=phpgwapi&r1=1.3&r2=1.4 Patches: Index: nusoap2phpgwapi =================================================================== RCS file: /cvsroot/phpgwapi/phpgwapi/doc/soap/nusoap2phpgwapi,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- nusoap2phpgwapi 24 Sep 2006 13:01:46 -0000 1.3 +++ nusoap2phpgwapi 28 Dec 2006 18:02:30 -0000 1.4 @@ -18,7 +18,7 @@ "\t* @package phpgwapi\n". "\t* @subpackage communication\n". "\t* Please see original header after this one and class.nusoap_base.inc.php\n". - "\t* @version \$Id: nusoap2phpgwapi,v 1.3 2006/09/24 13:01:46 Caeies Exp $\n". + "\t* @version \$Id: nusoap2phpgwapi,v 1.4 2006/12/28 18:02:30 Caeies Exp $\n". "\t*/\n\n"; print "Processing ".$argv[1]."\n"; @@ -59,6 +59,7 @@ $i = 0; $j = 3; $a = array(); +$current_class ='_not_me_'; foreach( $f as $line ) { /* Change the XMLSchema to soap_XMLSchema to avoid collisions */ $line = ereg_replace('XMLSchema |xmlschema ','soap_XMLSchema ',$line); @@ -66,12 +67,15 @@ $line = ereg_replace('XMLSchema\(|xmlschema\(','soap_XMLSchema(',$line); if ( ereg('^class',$line) ) { $tmp = explode(' ',$line); + $current_class = trim($tmp[1]); + echo "current class : $current_class\n"; if ( ereg('extends',$line) ) { trim($tmp[3]); $a[$i][2] = "/* Please see class.base_nusoap.inc.php for more information */\n\n". "if (@!".'$GLOBALS'."['phpgw_info']['flags']['included_classes']['$tmp[3]'])\n". "{\n\trequire_once(PHPGW_API_INC.\"/class.$tmp[3].inc.php\");\n\t". '$GLOBALS'."['phpgw_info']['flags']['included_classes']['$tmp[3]'] = True;\n}\n"; + $line = ereg_replace($tmp[3], "phpgwapi_$tmp[3]", $line); } else { $a[$i][2] = "/*\n". "* @internal : This is an internal class which is used as the base for the Soap Api\n". @@ -80,6 +84,14 @@ } print "class.$tmp[1].inc.php\n"; $a[$i][0] = "class.$tmp[1].inc.php"; + $line = ereg_replace('^class ([a-zA-Z_]+)','class phpgwapi_\\1', $line); + } elseif ( ereg("function $current_class", $line) ) { + /* we modify the constructor */ + $line = ereg_replace("function $current_class", "function phpgwapi_$current_class", $line); + $current_class = '_not_me_'; + } elseif ( ereg('parent::', $line) ) { + /* we need to change call to parent classes */ + $line = ereg_replace('parent::([a-zA-Z_]+)', 'parent::phpgwapi_\\1', $line); } elseif ( ereg('\$Id[:]',$line) ) { /* Replace the version wih the based on */ $line = ereg_replace('\$Id[:]', '$ I d :', $line ) ; @@ -154,17 +166,17 @@ ?> <?php /*Dummy definition ! */ - class soap_transport_http + class phpgwapi_soap_transport_http { - function soap_transport() { + function phpgwapi_soap_transport() { } } ?> <?php /* Dummy definition ! */ - class soapval + class phpgwapi_soapval { - function soapval() { + function phpgwapi_soapval() { } } ?> @@ -200,7 +212,7 @@ * @deprecated : this is a wrapper to class.soap_transport_http.inc.php */ -class soap_client extends soap_transport_http +class soap_client extends phpgwapi_soap_transport_http { function soap_client($path,$server=False,$port=False) { @@ -286,7 +298,7 @@ * @copyright Portions Copyright (C) 2003,2004 Free Software Foundation, Inc. http://www.fsf.org/ * @package phpgwapi * @subpackage communication - * @version $Id: nusoap2phpgwapi,v 1.3 2006/09/24 13:01:46 Caeies Exp $ + * @version $Id: nusoap2phpgwapi,v 1.4 2006/12/28 18:02:30 Caeies Exp $ * @internal This project began based on code from the 2 projects below, * @internal and still contains some original code. The licenses of both must be respected. * @internal XML-RPC for PHP; SOAP for PHP @@ -298,7 +310,7 @@ * @package phpgwapi * @subpackage communication */ -class phpgw_soapval extends soapval +class phpgw_soapval extends phpgwapi_soapval { // function phpgw_soapval($name='',$type=False,$value=-1,$namespace=False,$type_namespace=False) function phpgw_soapval($name='',$type=False,$value=0,$namespace=False,$type_namespace=False) _______________________________________________ phpGroupWare-cvs mailing list phpGroupWare-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/phpgroupware-cvs