public function __construct($request = null, $data = null) { //start stream handler $this->stream = Stream::receive($request); //store request $this->request = $this->stream->decode(); //store data $this->request_data = $data; //start logging $this->log = Log::_get()->setLevel(Log::WARN)->setLabel('Xport-Resp'); }
protected function init($http_host = 'localhost', $http_port = 80, $http_scheme = 'http://', $log_level = Log::INFO) { //setup stream handler $this->stream = Stream::_get(); $this->stream->setCompression(Stream::COMPRESS_GZIP); $this->stream->setEncryption(Stream::CRYPT_LSS); //set environment $this->setHTTPHost($http_host); $this->setHTTPPort($http_port); $this->setHTTPScheme($http_scheme); //setup logging $this->log = Log::_get()->setLevel($log_level); //make sure the mda package exists if (!is_callable('mda_get')) { throw new Exception('MDA package not loaded: required mda_get()'); } //startup complete }