/** * Initialize the response. */ public function init() { parent::init(); $this->formatters = [self::FORMAT_THRIFT => 'UrbanIndo\\Yii2\\Thrift\\ResponseFormatter']; $this->_transport = new TBufferedTransport(new TPhpStream(TPhpStream::MODE_R | TPhpStream::MODE_W)); $this->_protocol = new TBinaryProtocol($this->_transport, true, true); }
public function init() { parent::init(); $this->on(Base::EVENT_BEFORE_SEND, function ($event) { $this->isBuffering = false; if (headers_sent()) { return; } if (ob_start('ob_gzhandler')) { $this->isBuffering = true; } }); $this->on(Base::EVENT_AFTER_SEND, function ($event) { if ($this->isBuffering) { ob_end_flush(); $this->isBuffering = false; } }); }
public function init(){ $this->on(self::EVENT_BEFORE_SEND,[$this, 'beforeSend']); parent::init(); }
public function init() { parent::init(); $this->statusResponseCode = ApiResponseCode::ERR_OK; }