init() публичный Метод

Initializes this component.
public init ( )
Пример #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);
 }
Пример #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;
         }
     });
 }
Пример #3
0
 public function init(){
     $this->on(self::EVENT_BEFORE_SEND,[$this, 'beforeSend']);
     parent::init();
 }
Пример #4
0
 public function init()
 {
     parent::init();
     $this->statusResponseCode = ApiResponseCode::ERR_OK;
 }