cvs: pear /Services_Webservice Webservice.php /Services_Webservice/Webservice SOAP.php

From: Date: Mon, 19 Sep 2005 16:41:33 +0000
Subject: cvs: pear /Services_Webservice Webservice.php /Services_Webservice/Webservice SOAP.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-34866@lists.php.net to get a copy of this message
jausions Mon Sep 19 12:41:33 2005 EDT Modified files: /pear/Services_Webservice Webservice.php /pear/Services_Webservice/Webservice SOAP.php Log: Added an init() method to set parameters passed to the user's web service class. http://cvs.php.net/diff.php/pear/Services_Webservice/Webservice.php?r1=1.10&r2=1.11&ty=u Index: pear/Services_Webservice/Webservice.php diff -u pear/Services_Webservice/Webservice.php:1.10 pear/Services_Webservice/Webservice.php:1.11 --- pear/Services_Webservice/Webservice.php:1.10 Mon Aug 29 11:15:45 2005 +++ pear/Services_Webservice/Webservice.php Mon Sep 19 12:41:32 2005 @@ -19,7 +19,7 @@ * @author Philippe Jausions <Philippe.Jausions@11abacus.com> * @copyright 2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Webservice.php,v 1.10 2005/08/29 15:15:45 jausions Exp $ + * @version CVS: $Id: Webservice.php,v 1.11 2005/09/19 16:41:32 jausions Exp $ * @link http://pear.php.net/package/Services_Webservice */ @@ -62,6 +62,14 @@ protected $_classname; /** + * Parameter for the user's web service class + * + * @var array + * @access protected + */ + protected $_initParams = array(); + + /** * Constructor * * @var object|string $class @@ -87,8 +95,6 @@ $this->protocol = 'http'; } - // }}} - // {{{ handle() /** * Returns a Services_Webservice server instance to handle incoming * requests. @@ -113,6 +119,19 @@ $instance = new $backend($class, $namespace, $options); return $instance; } + + /** + * Initializes web service + * + * The parameters passed to this method will be passed to your class + * constructor + * + * @access public + */ + public function init() + { + $this->_initParams = func_get_args(); + } } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear/Services_Webservice/Webservice/SOAP.php?r1=1.1&r2=1.2&ty=u Index: pear/Services_Webservice/Webservice/SOAP.php diff -u pear/Services_Webservice/Webservice/SOAP.php:1.1 pear/Services_Webservice/Webservice/SOAP.php:1.2 --- pear/Services_Webservice/Webservice/SOAP.php:1.1 Mon Aug 29 11:15:45 2005 +++ pear/Services_Webservice/Webservice/SOAP.php Mon Sep 19 12:41:33 2005 @@ -19,10 +19,15 @@ * @author Philippe Jausions <Philippe.Jausions@11abacus.com> * @copyright 2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: SOAP.php,v 1.1 2005/08/29 15:15:45 jausions Exp $ + * @version CVS: $Id: SOAP.php,v 1.2 2005/09/19 16:41:33 jausions Exp $ * @link http://pear.php.net/package/Services_Webservice */ +/** + * Include parent class + */ +require_once 'Services/Webservice.php'; + // {{{ abstract class Services_Webservice /** @@ -113,7 +118,9 @@ private function createServer() { $server = new SoapServer(null, $this->soapServerOptions); - $server->SetClass($this->_classname); + $params = $this->_initParams; + array_unshift($this->_classname, $params); + call_user_func_array(array(&$server, 'SetClass'), $params); $server->handle(); } }

« previous php.pear.cvs (#34866) next »