コード例 #1
0
 /**
  * Creates a new Client proxy, takes an url and an optional options object
  * that can also be an array
  * @param string $url
  * @param mixed $options
  */
 public function __construct($url, $options = null)
 {
     $this->url = $url;
     $this->options = HessianOptions::resolveOptions($options);
     $this->typemap = new HessianTypeMap($this->options->typeMap);
     $this->factory = new HessianFactory();
 }
コード例 #2
0
 /**
  * Tries to resolve a HessianOptions object from either an object or an array.
  * Always return an options object
  * @param mixed $object variable to resolve
  * @return HessianOptions
  */
 public static function resolveOptions($object)
 {
     $options = new HessianOptions();
     if ($object == null) {
         return $options;
     }
     if ($object instanceof HessianOptions) {
         return $object;
     } elseif (is_array($object)) {
         $options->fromArray($object);
     } elseif (is_object($object)) {
         $arr = (array) $object;
         $options->fromArray($arr);
     }
     return $options;
 }
コード例 #3
0
 /**
  * Creates a new HessianService instace to serve remote requests from Hessian clients
  * @param $serviceObject Class name or object instance
  * @param mixed $options array or HessianOptions object
  */
 function __construct($serviceObject, $options = null)
 {
     $this->options = HessianOptions::resolveOptions($options);
     if ($serviceObject) {
         $this->registerObject($serviceObject);
     }
     $this->options->detectVersion = true;
     $this->typemap = new HessianTypeMap($this->options->typeMap);
     $this->factory = new HessianFactory();
     // timezones
     HessianUtils::setTimeZone($this->options->timeZone);
 }