예제 #1
0
파일: Tokenize.php 프로젝트: evltuma/moodle
 /**
  */
 public function __get($name)
 {
     switch ($name) {
         case 'eos':
             return $this->_stream->eof();
     }
 }
예제 #2
0
파일: Rfc822.php 프로젝트: jubinpatel/horde
 /**
  * Find the location of the end of the header text.
  *
  * @return array  1st element: Header position, 2nd element: Length of
  *                trailing EOL.
  */
 protected function _findHeader()
 {
     $i = 0;
     while (!$this->_stream->eof()) {
         $data = $this->_stream->substring(0, 8192);
         $hdr_pos = strpos($data, "\r\n\r\n");
         if ($hdr_pos !== false) {
             return array($hdr_pos + $i * 8192, 4);
         }
         $hdr_pos = strpos($data, "\n\n");
         if ($hdr_pos !== false) {
             return array($hdr_pos + $i * 8192, 2);
         }
         $i++;
     }
     $this->_stream->end();
     return array($this->_stream->pos(), 0);
 }