Stream¶
-
php\io\Stream abstract class
Children
- class php\io\FileStream
- class php\io\MiscStream
- class php\io\ResourceStream
- class php\net\NetStream
Properties
Methods
getPath()¶
Результат: string
getMode()¶
Результат: string
read($length)¶abstract
throws php\io\IOException
Параметры:
- $length –
int- - count of bytesРезультат:
mixed
readFully()¶abstract
throws php\io\IOException
Результат: mixed
write($value, $length = null)¶abstract
throws php\io\IOException
Параметры:
- $value –
string- $length –
null,intРезультат:
int
eof()¶abstract
Результат: bool
seek($position)¶abstract
throws php\io\IOException
Параметры:
- $position –
intРезультат:
mixed
getPosition()¶abstract
throws php\io\IOException
Результат: int
close()¶abstract
Результат: mixed
__construct($path, $mode = null)¶
Параметры:
- $path –
string- $mode –
null,stringРезультат:
setContext($context)¶
Параметры:
- $context –
Результат:
void
getContext()¶
Результат: mixed
- static
of($path, $mode = 'r')¶throws php\io\IOException
Параметры:
- $path –
string- $mode –
stringРезультат:
- static
getContents($path, $mode = 'r')¶Create a stream, call and return the result of the readFully() method, finally call the close() method.
throws php\io\IOException
Параметры:
- $path –
string- $mode –
stringРезультат:
stringbinary
- static
putContents($path, $data, $mode = 'w+')¶Create a stream, call and return the result of the write() method, finally call the close() method.
throws php\io\IOException
Параметры:
- $path –
string- $data –
string- $mode –
string
- static
tryAccess($path, $onAccess, $mode = 'r')¶Open a stream and close it after calling $onAccess automatically.
throws php\io\IOException
Параметры:
- $path –
string- $onAccess –
callable- (Stream $stream)- $mode –
string
- static
exists($path)¶Checks stream is exists. It tries to open a stream and if all is ok, returns true and closes it.
throws
php\io\\Exceptionif you check external streams like http or ftp
Параметры:
- $path –
stringРезультат:
bool
- static
register($protocol, $className)¶
Параметры:
- $protocol –
string- $className –
string
- static
unregister($protocol)¶
Параметры:
- $protocol –