protected function send()
    {
        if (!$this->initialized) {
            $this->initialized = true;
            $this->sendHeader = $this->headersAccepted();

            if (!$this->sendHeader) {
                return;
            }
        }

        $jsonEncoded = json_encode($this->json);
        $jsonEncoded = str_replace("\n", '', $jsonEncoded);
        $encoded = base64_encode(utf8_encode($jsonEncoded));

        // Note it's 240KB to leave room for an error message
        if (strlen($encoded) > 240*1024) {
            $this->overflowed = true;

            $this->json['rows'][count($this->json['rows']) - 1] = array(
                'Logs truncated, exceeded Chrome header size limit',
                '',
                ''
            );

            $jsonEncoded = json_encode($this->json);
            $jsonEncoded = str_replace("\n", '', $jsonEncoded);
            $encoded = base64_encode(utf8_encode($jsonEncoded));
        }

        $this->sendHeader($encoded);
    }
protected function send()
    {
        if (!$this->initialized) {
            $this->initialized = true;
            $this->sendHeader = $this->headersAccepted();

            if (!$this->sendHeader) {
                return;
            }
        }

        $jsonEncoded = json_encode($this->json);
        $jsonEncoded = str_replace("\n", '', $jsonEncoded);
        $encoded = base64_encode(utf8_encode($jsonEncoded));

        // Note it's 240KB to leave room for an error message
        if (strlen($encoded) > 240*1024) {
            $this->overflowed = true;

            $this->json['rows'][count($this->json['rows']) - 1] = array(
                'Logs truncated, exceeded Chrome header size limit',
                '',
                ''
            );

            $jsonEncoded = json_encode($this->json);
            $jsonEncoded = str_replace("\n", '', $jsonEncoded);
            $encoded = base64_encode(utf8_encode($jsonEncoded));
        }

        $this->sendHeader($encoded);
    }
protected function send ( ) { if ( ! $ this -> initialized ) { $ this -> initialized = true ; $ this -> sendHeader = $ this -> headersAccepted ( ) ; if ( ! $ this -> sendHeader ) { return ; } } $ jsonEncoded = json_encode ( $ this -> json ) ; $ jsonEncoded = str_replace ( "\n" , '' , $ jsonEncoded ) ; $ encoded = base64_encode ( utf8_encode ( $ jsonEncoded ) ) ; // Note it's 240KB to leave room for an error message if ( strlen ( $ encoded ) > 240 * 1024 ) { $ this -> overflowed = true ; $ this -> json [ 'rows' ] [ count ( $ this -> json [ 'rows' ] ) - 1 ] = array ( 'Logs truncated, exceeded Chrome header size limit' , '' , '' ) ; $ jsonEncoded = json_encode ( $ this -> json ) ; $ jsonEncoded = str_replace ( "\n" , '' , $ jsonEncoded ) ; $ encoded = base64_encode ( utf8_encode ( $ jsonEncoded ) ) ; } $ this -> sendHeader ( $ encoded ) ; }
Prepare to send header
Prepare to send header