Stream

php\io\Stream

abstract class

Children


Properties


property path

string

private

property mode

string

private

Methods


getPath()
Результат:string
getMode()
Результат:string
read($length)

abstract

throws php\io\IOException

Параметры:
  • $lengthint - - count of bytes
Результат:

mixed

readFully()

abstract

throws php\io\IOException

Результат:mixed
write($value, $length = null)

abstract

throws php\io\IOException

Параметры:
  • $valuestring
  • $lengthnull, int
Результат:

int

eof()

abstract

Результат:bool
seek($position)

abstract

throws php\io\IOException

Параметры:
  • $positionint
Результат:

mixed

getPosition()

abstract

throws php\io\IOException

Результат:int
close()

abstract

Результат:mixed
__construct($path, $mode = null)
Параметры:
  • $pathstring
  • $modenull, string
Результат:

php\io\Stream

setContext($context)
Параметры:
  • $context
Результат:

void

getContext()
Результат:mixed
static of($path, $mode = 'r')

throws php\io\IOException

Параметры:
  • $pathstring
  • $modestring
Результат:

php\io\Stream

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

Параметры:
  • $pathstring
  • $modestring
Результат:

string binary

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

Параметры:
  • $pathstring
  • $datastring
  • $modestring
static tryAccess($path, $onAccess, $mode = 'r')

Open a stream and close it after calling $onAccess automatically.

throws php\io\IOException

Параметры:
  • $pathstring
  • $onAccesscallable - (Stream $stream)
  • $modestring
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\\Exception if you check external streams like http or ftp

Параметры:
  • $pathstring
Результат:

bool

static register($protocol, $className)
Параметры:
  • $protocolstring
  • $classNamestring
static unregister($protocol)
Параметры:
  • $protocol