nanoserv
[ class tree: nanoserv ] [ index: nanoserv ] [ all elements ]

Source for file NS_Persistent_SOAP_Service_Handler.php

Documentation is available at NS_Persistent_SOAP_Service_Handler.php

  1. <?php
  2.  
  3. /**
  4.  *
  5.  * nanoserv handlers - Persistent SOAP over HTTP service handler
  6.  * 
  7.  * Copyright (C) 2004-2010 Vincent Negrier aka. sIX <six@aegis-corp.org>
  8.  * 
  9.  * This library is free software; you can redistribute it and/or
  10.  * modify it under the terms of the GNU Lesser General Public
  11.  * License as published by the Free Software Foundation; either
  12.  * version 2.1 of the License, or (at your option) any later version.
  13.  * 
  14.  * This library is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17.  * Lesser General Public License for more details.
  18.  * 
  19.  * You should have received a copy of the GNU Lesser General Public
  20.  * License along with this library; if not, write to the Free Software
  21.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
  22.  *
  23.  * @package nanoserv
  24.  * @subpackage Handlers
  25.  */
  26.  
  27. /**
  28.  * Require the SOAP server
  29.  */
  30. require_once "nanoserv-compat/handlers/NS_SOAP_Service_Handler.php";
  31.  
  32. /**
  33.  * Persistent SOAP over HTTP service handler class
  34.  *
  35.  * @package nanoserv
  36.  * @subpackage Handlers
  37.  * @since 1.0.2
  38.  */
  39.  
  40.     /**
  41.      * Persistent object
  42.      * @var object 
  43.      */
  44.     private $wrapped;
  45.     
  46.     /**
  47.      * Persistent SOAP service handler constructor
  48.      *
  49.      * @param object $o 
  50.      * @param array $soap_options 
  51.      */
  52.     public function __construct($o$soap_options=false{
  53.  
  54.         $this->wrapped $o;
  55.  
  56.         if ($soap_options === false{
  57.         
  58.             parent::__construct($o);
  59.  
  60.         else {
  61.  
  62.             parent::__construct($o$soap_options);
  63.  
  64.         }
  65.  
  66.     }
  67.     
  68.     public function Get_Exports({
  69.  
  70.         $ret array();
  71.         
  72.         $rc new ReflectionClass(get_class($this->wrapped));
  73.  
  74.         foreach ($rc->getMethods(as $rm{
  75.  
  76.             if ((!$rm->isPublic()) || ($rm->getDeclaringClass(!= $rc)) continue;
  77.             
  78.             $params array();
  79.  
  80.             foreach ($rm->getParameters(as $rp{
  81.  
  82.                 $params[array("name" => $rp->getName());
  83.             
  84.             }
  85.  
  86.             $ret[$rm->getName()$params;
  87.         
  88.         }
  89.     
  90.         return $ret;
  91.     
  92.     }
  93.     
  94.     final public function on_Call($method$args{
  95.  
  96.         return call_user_func_array(array($this->wrapped$method)$args);
  97.  
  98.     }
  99.  
  100. }
  101.  
  102. ?>

Documentation generated on Wed, 30 Nov 2011 22:03:25 +0100 by phpDocumentor 1.4.3