/** * class constructor needs rpc server as first parameter either as instance * or driver string, e.g. "json", if empty will create default server with * "json" driver. the third parameter expects a absolute file pointer or string * of php.ini style which can also be used to define all class options and control * the behaviour of the gateway * * @error 14001 * @param null|string|Xapp_Rpc_Server $server expects on of the above explained values * @param null|array|object $options expects optional options * @param null|string $conf expects file pointer or string of gateway config */ public function __construct($server = null, $options = null, $conf = null) { if ($server instanceof Xapp_Rpc_Server) { $this->_server = $server; } else { if (is_null($server)) { $this->_server = Xapp_Rpc_Server::factory('json'); } else { $this->_server = Xapp_Rpc_Server::factory((string) $server); } } if ($options !== null) { xapp_init_options($options, $this); } if ($conf !== null) { $this->conf($conf); } $this->init(); }
/** * class constructor will set missing instances of smd, request and response and * call parent constructor for class initialization * * @error 14601 * @param null|array|object $options expects optional options */ public function __construct($options = null) { xapp_set_options($options, $this); if (!xapp_is_option(self::SMD, $this)) { xapp_set_option(self::SMD, Xapp_Rpc_Smd_Json::instance(), $this); } if (!xapp_is_option(self::REQUEST, $this)) { xapp_set_option(self::REQUEST, new Xapp_Rpc_Request_Json(), $this); } if (!xapp_is_option(self::RESPONSE, $this)) { xapp_set_option(self::RESPONSE, new Xapp_Rpc_Response_Json(), $this); } parent::__construct(); }