Contentserv PHP API

CSMamDriverFile extends CSFileStream
in package

Tags

Table of Contents

__construct()  : mixed
__toString()  : string
Reads all data from the stream into a string, from the beginning to end.
addMetaData()  : void
Adds a specific meta-data key to the MAM driver file.
addTags()  : void
Adds a specific tag to the MAM driver file.
clearCache()  : bool
Clears the filesystem cache for the current MAM driver file.
closeStream()  : bool
Closes the file stream API object.
delete()  : bool
Deletes the file stream API object.
exists()  : bool
Checks whether the file stream API object exists.
getBaseName()  : string
Returns the base name of the file stream API object.
getContent()  : mixed
Returns the content of the file stream API object.
getCreationTimestamp()  : int
Returns the creation timestamp of the file stream API object.
getDriver()  : CSMamDriver|null
Returns the corresponding MAM driver of the MAM file.
getItem()  : MamFile
Returns the corresponding MAM file object.
getLocalPath()  : string
Returns the local file path of the file stream API object.
getMetaData()  : mixed
Returns all or a specific key of the meta-data information.
getModificationTimestamp()  : int
Returns the modification timestamp of the file stream API object.
getName()  : string
Returns the name of the file stream API object.
getSize()  : int
Returns the file size of the file stream API object.
getTags()  : mixed
Returns all tags or a specific key from the MAM driver file.
getType()  : string
Returns the file type of the file stream API object.
getVolumeFilePath()  : string
Returns the volume file path of the MAM driver file.
getVolumeFolderPath()  : string
Returns the volume folder path of the MAM driver file.
isEndOfStream()  : bool
Checks whether it is the end of the stream.
isFolder()  : bool
Checks if the file stream API object is a folder.
isLocal()  : bool
Checks if the file stream API object is a local file.
isReadableStream()  : bool
Checks if the stream is readable.
isSeekableStream()  : bool
Checks if the stream is seekable.
isWritableStream()  : bool
Checks if the stream is writable.
openStream()  : void
Opens the stream file.
readStream()  : string
Reads the content of the stream with the given length.
rewindStream()  : void
Rewinds the stream file API object.
seekStream()  : void
Seeks the stream file API objects.
setContentFromPath()  : bool
Sets the content from a given file path.
setContentFromStream()  : bool
Sets the content from a given stream file API object.
setContentFromString()  : bool
Sets the content from string content.
setMetaData()  : void
Sets meta-data values to the MAM driver file.
setTags()  : void
Sets tags to the MAM driver file.
streamContent()  : void
Streams the content for the given stream type.
writeStream()  : int|false
Writes the given content to the file stream API object.

Methods

__toString()

Reads all data from the stream into a string, from the beginning to end.

public __toString() : string

This method MUST attempt to seek to the beginning of the stream before reading data and read the stream until the end is reached.

Warning: This could attempt to load a large amount of data into memory.

This method MUST NOT raise an exception in order to conform with PHP's string casting operations.

Tags
see
http://php.net/manual/en/language.oop5.magic.php#object.tostring
Return values
string

addMetaData()

Adds a specific meta-data key to the MAM driver file.

public addMetaData(string $sKey, mixed $mValue) : void
Parameters
$sKey : string

The target key of the meta-data information.

$mValue : mixed

The value.

Tags
Return values
void

addTags()

Adds a specific tag to the MAM driver file.

public addTags(string $sKey, mixed $mValue) : void
Parameters
$sKey : string

The target tag name.

$mValue : mixed

The value of the tag.

Tags
Return values
void

clearCache()

Clears the filesystem cache for the current MAM driver file.

public clearCache() : bool
Tags
Return values
bool

closeStream()

Closes the file stream API object.

public closeStream() : bool
Tags
inheritDoc
Return values
bool

delete()

Deletes the file stream API object.

public delete() : bool
Tags
inheritDoc
Return values
bool

exists()

Checks whether the file stream API object exists.

public exists() : bool
Tags
inheritDoc
Return values
bool

getBaseName()

Returns the base name of the file stream API object.

public getBaseName() : string
Tags
inheritDoc
Return values
string

getContent()

Returns the content of the file stream API object.

public getContent() : mixed
Tags
inheritDoc
Return values
mixed

getCreationTimestamp()

Returns the creation timestamp of the file stream API object.

public getCreationTimestamp() : int
Tags
inheritDoc
Return values
int

getDriver()

Returns the corresponding MAM driver of the MAM file.

public getDriver() : CSMamDriver|null
Tags
Return values
CSMamDriver|null

getItem()

Returns the corresponding MAM file object.

public getItem() : MamFile
Tags
Return values
MamFile

getLocalPath()

Returns the local file path of the file stream API object.

public getLocalPath([bool $bDownloadRemoteFileIfNotExisting = false ][, bool $bRegisterDeletionForLocalFile = false ]) : string

If the file stream API object is located on a remote storage, it can be downloaded with the parameter.

Parameters
$bDownloadRemoteFileIfNotExisting : bool = false

Whether the file should be downloaded if it is located on a remote storage.

$bRegisterDeletionForLocalFile : bool = false

Whether the local file, which has been downloaded from the remote storage, should be deleted after the process has finished. Takes only place for non-local MAM driver files!

Tags
Return values
string

getMetaData()

Returns all or a specific key of the meta-data information.

public getMetaData([string $sKey = '' ]) : mixed
Parameters
$sKey : string = ''

The target meta-data key.

Tags
Return values
mixed

getModificationTimestamp()

Returns the modification timestamp of the file stream API object.

public getModificationTimestamp() : int
Tags
inheritDoc
Return values
int

getName()

Returns the name of the file stream API object.

public getName() : string
Tags
inheritDoc
Return values
string

getSize()

Returns the file size of the file stream API object.

public getSize() : int
Tags
inheritDoc
Return values
int

getTags()

Returns all tags or a specific key from the MAM driver file.

public getTags([string $sKey = '' ]) : mixed
Parameters
$sKey : string = ''

The target key.

Tags
Return values
mixed

getType()

Returns the file type of the file stream API object.

public getType() : string
Tags
inheritDoc
Return values
string

getVolumeFilePath()

Returns the volume file path of the MAM driver file.

public getVolumeFilePath() : string
Tags
Return values
string

getVolumeFolderPath()

Returns the volume folder path of the MAM driver file.

public getVolumeFolderPath() : string
Tags
Return values
string

isEndOfStream()

Checks whether it is the end of the stream.

public isEndOfStream() : bool
Tags
inheritDoc
Return values
bool

isFolder()

Checks if the file stream API object is a folder.

public isFolder() : bool
Tags
inheritDoc
Return values
bool

isLocal()

Checks if the file stream API object is a local file.

public isLocal() : bool
Tags
inheritDoc
Return values
bool

isReadableStream()

Checks if the stream is readable.

public isReadableStream() : bool
Tags
inheritDoc
Return values
bool

isSeekableStream()

Checks if the stream is seekable.

public isSeekableStream() : bool
Tags
inheritDoc
Return values
bool

isWritableStream()

Checks if the stream is writable.

public isWritableStream() : bool
Tags
inheritDoc
Return values
bool

openStream()

Opens the stream file.

public openStream(string $sMode) : void
Parameters
$sMode : string

The target stream mode

Tags
inheritDoc
Return values
void

readStream()

Reads the content of the stream with the given length.

public readStream([int|null $iLength = null ]) : string
Parameters
$iLength : int|null = null
Tags
inheritDoc
Return values
string

rewindStream()

Rewinds the stream file API object.

public rewindStream() : void
Tags
inheritDoc
Return values
void

seekStream()

Seeks the stream file API objects.

public seekStream(int $iOffset[, int $iWhence = SEEK_SET ]) : void
Parameters
$iOffset : int

To move to a position before the end-of-file, you need to pass a negative value in offset and set whence to SEEK_END.

$iWhence : int = SEEK_SET

Whence values are: SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. SEEK_END - Set position to end-of-file plus offset. If whence is not specified, it is assumed to be SEEK_SET.

Tags
inheritDoc
Return values
void

setContentFromPath()

Sets the content from a given file path.

public final setContentFromPath(string $sFilePath) : bool
Parameters
$sFilePath : string

The path of the file where we get the content to write.

Tags
Return values
bool

setContentFromStream()

Sets the content from a given stream file API object.

public final setContentFromStream(CSFileStream $oFileStream) : bool
Parameters
$oFileStream : CSFileStream

The stream file API object where we get the content to write.

Tags
Return values
bool

setContentFromString()

Sets the content from string content.

public final setContentFromString(string $sContent) : bool
Parameters
$sContent : string

The content, which should be set to the stream file API object

Tags
Return values
bool

setMetaData()

Sets meta-data values to the MAM driver file.

public setMetaData(array<string|int, mixed> $aMetaData) : void
Parameters
$aMetaData : array<string|int, mixed>

Key & Value pair of meta-data information.

Tags
Return values
void

setTags()

Sets tags to the MAM driver file.

public setTags(array<string|int, mixed> $aTags) : void
Parameters
$aTags : array<string|int, mixed>

An array with key & value pair.

Tags
Return values
void

streamContent()

Streams the content for the given stream type.

public streamContent([int $iStreamType = self::STREAM_TYPE_PRINT_AND_DIE ][, string $sTargetFileName = '' ]) : void
Parameters
$iStreamType : int = self::STREAM_TYPE_PRINT_AND_DIE

The target stream type to stream the content.

$sTargetFileName : string = ''

The target file name of the stream file.

Tags
inheritDoc
Return values
void

writeStream()

Writes the given content to the file stream API object.

public writeStream(string $sContent[, int|null $iLength = null ]) : int|false
Parameters
$sContent : string

The content, which should be written to the file.

$iLength : int|null = null

If the length argument is given, writing will stop after length bytes have been written or the end of string is reached, whichever comes first.

Tags
inheritDoc
Return values
int|false

        

Search results