This repository was archived by the owner on Oct 1, 2023. It is now read-only.
v4.52.0: IO\ and OS\ progress
This release contains many improvements to IO\
and OS\
, some of which are backwards-incompatible changes.
- Added
OS\Errno
enum - Removed
OS\ErrorCode
enum - renamed
OS\Exception
toOS\ErrnoException
- removed
OS\ErrnoException::getErrorCode()
- useOS\ErrnoException::getErrno()
instead - added
OS\FileDescriptor
class,OS\close()
,OS\fcntl()
,OS\flock()
,OS\lseek()
,OS\open()
,OS\pipe()
,OS\read()
, andOS\write()
functions to support several operations without PHPresource
s; these functions throwOS\ErrnoException
on failure. - renamed
IO\ReadHandle::rawReadBlocking()
toread()
andIO\WriteHandle::rawWriteBlocking()
towrite()
IO\ReadHandle::readAsync()
will now return after one successfulread()
, waiting if necessary, instead of reading until end of fileIO\WriteHandle::writeAsync()
will now return after one successfulwrite()
, waiting if necessary, instead of waiting until all data is written; this means it may now partially succeedIO\ReadHandle::readAsync()
andIO\WriteHandle::writeAsync()
now take?int $timeout_ns = null
, instead of?int $timeout_seconds = null
- An exception is now raised if
0
is specified as the timeout; provide a positive integer, ornull
for no timeout. - removed
IO\ReadHandle::readLineAsync()
; it is likely to be reintroduced in a separate abstraction providing buffered reads in the future IO\pipe()
andFile\
are now implemented withOS\FileDescriptor
's instead of PHPresource
s; they should now reliably through correctOS\ErrnoException
s, rather than only in standalone CLI mode