init() public method

Initializes this component.
public init ( )
Esempio n. 1
0
 /**
  * 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);
 }
Esempio n. 2
0
 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;
         }
     });
 }
Esempio n. 3
0
 public function init(){
     $this->on(self::EVENT_BEFORE_SEND,[$this, 'beforeSend']);
     parent::init();
 }
Esempio n. 4
0
 public function init()
 {
     parent::init();
     $this->statusResponseCode = ApiResponseCode::ERR_OK;
 }