[geeklog-cvs] Auth_Enterprise/Server/XMLRPC XMLRPCCommandFactory.class.php,1.1.1.1,1.2 index.php,1.1.1.1,1.2
tony at geeklog.net
tony at geeklog.net
Tue Oct 28 19:52:42 EST 2003
Update of /usr/cvs/geeklog/Auth_Enterprise/Server/XMLRPC
In directory geeklog_prod:/tmp/cvs-serv1664/Server/XMLRPC
Modified Files:
XMLRPCCommandFactory.class.php index.php
Log Message:
Authenticate method nearly complete using XML_RPC
Index: XMLRPCCommandFactory.class.php
===================================================================
RCS file: /usr/cvs/geeklog/Auth_Enterprise/Server/XMLRPC/XMLRPCCommandFactory.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** XMLRPCCommandFactory.class.php 23 Oct 2003 14:17:35 -0000 1.1.1.1
--- XMLRPCCommandFactory.class.php 29 Oct 2003 00:52:40 -0000 1.2
***************
*** 1,52 ****
<?php
!
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
! */
!
!
! /**
! * This is the Auth_Enteprise command factory for the XML-RPC implementation.
! * This class simply builds the requested commands and returns them
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.server.xmlrpc
! *
*/
! class XMLRPCCommandFactory {
! /**
! * Builds the requested command and returns it
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $method Method to call on the service
! * @return object A command object
! *
! */
! function &getCommand($method)
! {
! AEUtility::logMessage('XMLRPC command factory got ' . $method . ' as a command',__FILE__,__LINE__);
! if (empty($method)) {
! trigger_error('XMLRPCCommandFactory received an empty method parameter', E_USER_ERROR);
! return PEAR::raiseError('XMLRPCCommandFactory received an empty method parameter');
! }
! $fileName = 'Auth_Enterprise/Server/XMLRPC/commands/' . $method . '.class.php';
! require_once $fileName;
! return new $method();
! }
}
-
?>
--- 1,48 ----
<?php
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
*/
! /**
! * This is the Auth_Enteprise command factory for the XML-RPC implementation.
! * This class simply builds the requested commands and returns them
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.server.xmlrpc
! *
! */
! class XMLRPCCommandFactory {
! /**
! * Builds the requested command and returns it
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $method Method to call on the service
! * @return object A command object
! *
! */
! function &getCommand($method)
! {
! AEUtility::logMessage('XMLRPC command factory got ' . $method . ' as a command',__FILE__,__LINE__);
! if (empty($method)) {
! trigger_error('XMLRPCCommandFactory received an empty method parameter', E_USER_ERROR);
! return PEAR::raiseError('XMLRPCCommandFactory received an empty method parameter');
! }
! $fileName = 'Auth_Enterprise/Server/XMLRPC/commands/' . $method . '.class.php';
! require_once $fileName;
! return new $method();
! }
}
?>
Index: index.php
===================================================================
RCS file: /usr/cvs/geeklog/Auth_Enterprise/Server/XMLRPC/index.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** index.php 23 Oct 2003 14:17:35 -0000 1.1.1.1
--- index.php 29 Oct 2003 00:52:40 -0000 1.2
***************
*** 1,70 ****
<?php
!
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
! */
!
! /**
! * Bring in the Server's configuration file
*/
require_once 'Auth_Enterprise/Server/AEIncludes.php';
!
! /**
! * PEAR's XML RPC server implementation
! */
require_once 'XML/RPC/Server.php';
!
! /**
! * XML RPC Command Factory
! */
require_once 'Auth_Enterprise/Server/XMLRPC/XMLRPCCommandFactory.class.php';
!
! /**
! * Single function responsible for handling *all* XMLRPC requests to the
! * A&A Service
! *
! * @author Tony Bibbs <tony at cvs.geeklog.net>
! * @param array $params Params sent to method call.
! * @return string Depends on the method that gets called.
! *
! */
! function XMLRPC_Handler($params) {
! // Convert parameters into an array to be sent to
! // some command
! foreach ($params->params as $curParam) {
! $fnParams[] = $curParam->scalarval();
! }
! AEUtility::logObject($fnParams, __FILE__, __LINE__);
! $method = $fnParams[0];
! AEUtility::logMessage("Auth_Enterprise's XMLRPC Service received command, $method, to execute",
__FILE__,__LINE__,PEAR_LOG_DEBUG);
!
! // Build appropriate command
! $cmd = XMLRPCCommandFactory::getCommand($method);
!
AEUtility::logObject($cmd, __FILE__, __LINE__);
!
! // Execute the command passing any arguments
! $cmd->execute($fnParams);
!
! // Return XML_RPC response
! return $cmd->getXMLRPCResponse();
}
! AEUtility::logMessage('Instantiating server',__FILE__,__LINE__);
! // Send XML_RPC request to generic handler
$XMLRPCServer = new XML_RPC_Server(array('Auth_Enterprise.processRequest' => array('function' => 'XMLRPC_Handler')));
-
?>
--- 1,60 ----
<?php
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
*/
+ /**
+ * Bring in the Server's configuration file
+ */
require_once 'Auth_Enterprise/Server/AEIncludes.php';
! /**
* PEAR's XML RPC server implementation
! */
require_once 'XML/RPC/Server.php';
! /**
! * XML RPC Command Factory
! */
require_once 'Auth_Enterprise/Server/XMLRPC/XMLRPCCommandFactory.class.php';
! /**
! * Single function responsible for handling *all* XMLRPC requests to the
! * A&A Service
! *
! * @author Tony Bibbs <tony at cvs.geeklog.net>
! * @param array $params Params sent to method call.
! * @return string Depends on the method that gets called.
! *
! */
! function XMLRPC_Handler($params) {
! // Convert parameters into an array to be sent to
! // some command
! foreach ($params->params as $curParam) {
! $fnParams[] = $curParam->scalarval();
! }
! AEUtility::logObject($fnParams, __FILE__, __LINE__);
! $method = $fnParams[0];
! AEUtility::logMessage("Auth_Enterprise's XMLRPC Service received command, $method, to execute",
__FILE__,__LINE__,PEAR_LOG_DEBUG);
! // Build appropriate command
! $cmd = XMLRPCCommandFactory::getCommand($method);
AEUtility::logObject($cmd, __FILE__, __LINE__);
! // Execute the command passing any arguments
! $cmd->execute($fnParams);
!
! // Return XML_RPC response
! return $cmd->getXMLRPCResponse();
}
! AEUtility::logMessage('Instantiating server',__FILE__,__LINE__);
! // Send XML_RPC request to generic handler
$XMLRPCServer = new XML_RPC_Server(array('Auth_Enterprise.processRequest' => array('function' => 'XMLRPC_Handler')));
?>
More information about the geeklog-cvs
mailing list