Documentation

LocalFileSeeker
in package
implements SeekerInterface

Tags

Interfaces, Classes, Traits and Enums

SeekerInterface
Defines an interface for retrieving arbitrary data from within an object.

Table of Contents

$path  : string
The path of the local file.
$size  : int
The size of the file.
$stream  : false|resource
The file pointer.
__construct()  : mixed
Create a new LocalFileSeeker object.
__destruct()  : mixed
Destructor function to ensure the file descriptor is closed.
getStream()  : resource
Retrieve a file pointer that returns a decompressed copy of `$length` bytes starting from `$offset`.
retrieveEnd()  : string
Retrieve data from the end of the object, with an optional offset.
retrieveStart()  : string
Retrieve data from the start of the object, with an optional offset.

Properties

Methods

__construct()

Create a new LocalFileSeeker object.

public __construct(string $path) : mixed
Parameters
$path : string

The path to the local file.

Tags
throws
NotSeekable

Thrown if the opened file pointer is not seekable.

Return values
mixed

__destruct()

Destructor function to ensure the file descriptor is closed.

public __destruct() : mixed
Tags
Return values
mixed

getStream()

Retrieve a file pointer that returns a decompressed copy of `$length` bytes starting from `$offset`.

public getStream(int $length[, int $offset = 0 ][, int $compression = 0 ]) : resource
Parameters
$length : int

The number of bytes to be read.

$offset : int = 0

The offset from the start of the object.

$compression : int = 0

The value of the compression header for the file.

Tags
inheritdoc
Return values
resource

A file pointer to retrieve the decompressed bytes.

retrieveEnd()

Retrieve data from the end of the object, with an optional offset.

public retrieveEnd(int $length[, int $offset = 0 ]) : string
Parameters
$length : int

The number of bytes to be returned.

$offset : int = 0

The offset counting backwards from the end of the object.

Tags
inheritDoc
Return values
string

The bytestring of the data.

retrieveStart()

Retrieve data from the start of the object, with an optional offset.

public retrieveStart(int $length[, int $offset = 0 ]) : string
Parameters
$length : int

The number of bytes to be returned.

$offset : int = 0

The offset from the start of the object.

Tags
inheritDoc
Return values
string

The bytestring of the data.


        

Search results