]> granicus.if.org Git - php/commit
- [DOC] Changed stream_get_contents() so that the offset is relative to the
authorGustavo André dos Santos Lopes <cataphract@php.net>
Thu, 14 Oct 2010 02:03:18 +0000 (02:03 +0000)
committerGustavo André dos Santos Lopes <cataphract@php.net>
Thu, 14 Oct 2010 02:03:18 +0000 (02:03 +0000)
commit1ee489f00e1ecf83ffc6c78efbee1b8eeff02197
tree412019e0c6c70bf5c87021efb0a897ec10181527
parent86944b47a659a70b8985ea1b575c9f8b21dece95
- [DOC] Changed stream_get_contents() so that the offset is relative to the
  current position (seek with SEEK_CUR, not SEEK_SET). Only positive values are
  allowed. This breaking change is necessary to fix the erratic behavior in
  streams without a seek handlder. Addresses bug #53006.
#Note that the example on the doc page for stream_get_contents() may fail
#without this change.
#This change is also in the spirit of stream_get_contents(), whose description
#is "Reads all remaining bytes (or up to maxlen bytes) from a stream...".
#Previous behavior allowed setting the file pointer to positions before the
#current one, so they wouldn't be "remaining bytes". The previous behavior was
#also inconsistent in that it allowed an moving to offset 1, 2, ..., but not 0.
ext/standard/streamsfuncs.c