Example #1
0
 public function read($len)
 {
     $available = $this->available();
     if ($available === 0) {
         $buffer_dump = get_site_variable('THRIFT_DUMP_CORRUPTED_BUFFERS') ? bin2hex($this->buf_) : 'DISABLED by SITEVAR';
         throw new TTransportException('TMemoryBuffer: Could not read ' . $len . ' bytes from buffer.' . ' Original length is ' . $this->length() . ' Current index is ' . $this->index_ . ' Buffer content <start>' . $buffer_dump . '<end>', TTransportException::UNKNOWN);
     }
     if ($available < $len) {
         $len = $available;
     }
     $ret = substr($this->buf_, $this->index_, $len);
     $this->index_ += $len;
     return $ret;
 }
Example #2
0
 public function __construct($fbml_impl)
 {
     $this->_fbml_impl = $fbml_impl;
     $this->_use_ext = function_exists('fbml_parse_opaque_11') && (IS_DEV_SITE || get_site_variable('FBML_FBML_EXT') == 2 || fbml_is_beta_machine());
 }