grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026name = $url['host']; $this->buffers[$this->name] = null; $this->position = 0; return true; } /** * Read stream * * @param integer $count How many bytes of data from the current position should be returned. * * @return mixed The data from the stream up to the specified number of bytes (all data if * the total number of bytes in the stream is less than $count. Null if * the stream is empty. * * @see streamWrapper::stream_read * @since 1.7.0 */ public function stream_read($count) { $ret = substr($this->buffers[$this->name], $this->position, $count); $this->position += strlen($ret); return $ret; } /** * Write stream * * @param string $data The data to write to the stream. * * @return integer * * @see streamWrapper::stream_write * @since 1.7.0 */ public function stream_write($data) { $left = substr($this->buffers[$this->name], 0, $this->position); $right = substr($this->buffers[$this->name], $this->position + strlen($data)); $this->buffers[$this->name] = $left . $data . $right; $this->position += strlen($data); return strlen($data); } /** * Function to get the current position of the stream * * @return integer * * @see streamWrapper::stream_tell * @since 1.7.0 */ public function stream_tell() { return $this->position; } /** * Function to test for end of file pointer * * @return boolean True if the pointer is at the end of the stream * * @see streamWrapper::stream_eof * @since 1.7.0 */ public function stream_eof() { return $this->position >= strlen($this->buffers[$this->name]); } /** * The read write position updates in response to $offset and $whence * * @param integer $offset The offset in bytes * @param integer $whence Position the offset is added to * Options are SEEK_SET, SEEK_CUR, and SEEK_END * * @return boolean True if updated * * @see streamWrapper::stream_seek * @since 1.7.0 */ public function stream_seek($offset, $whence) { switch ($whence) { case SEEK_SET : return $this->seek_set($offset); case SEEK_CUR : return $this->seek_cur($offset); case SEEK_END : return $this->seek_end($offset); } return false; } /** * Set the position to the offset * * @param integer $offset The offset in bytes * * @return boolean */ protected function seek_set($offset) { if ($offset < 0 || $offset > strlen($this->buffers[$this->name])) { return false; } $this->position = $offset; return true; } /** * Adds the offset to current position * * @param integer $offset The offset in bytes * * @return boolean */ protected function seek_cur($offset) { if ($offset < 0) { return false; } $this->position += $offset; return true; } /** * Sets the position to the end of the current buffer + offset * * @param integer $offset The offset in bytes * * @return boolean */ protected function seek_end($offset) { $offset += strlen($this->buffers[$this->name]); if ($offset < 0) { return false; } $this->position = $offset; return true; } }