mediatekformation

Stream extends File
in package

A PHP stream of unknown size.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

__construct()  : mixed
Constructs a new file from the given path.
getContent()  : string
getMimeType()  : string|null
Returns the mime type of the file.
getSize()  : int|false
{@inheritdoc}
guessExtension()  : string|null
Returns the extension based on the mime type.
move()  : self
Moves the file to a new location.
getName()  : string
Returns locale independent base name of the given path.
getTargetFile()  : self

Methods

__construct()

Constructs a new file from the given path.

public __construct(string $path[, bool $checkPath = true ]) : mixed
Parameters
$path : string

The path to the file

$checkPath : bool = true

Whether to check the path or not

Tags
throws
FileNotFoundException

If the given path is not a file

Return values
mixed —

getContent()

public getContent() : string
Return values
string —

getMimeType()

Returns the mime type of the file.

public getMimeType() : string|null

The mime type is guessed using a MimeTypeGuesserInterface instance, which uses finfo_file() then the "file" system binary, depending on which of those are available.

Tags
see
MimeTypes
Return values
string|null —

getSize()

{@inheritdoc}

public getSize() : int|false
Return values
int|false —

guessExtension()

Returns the extension based on the mime type.

public guessExtension() : string|null

If the mime type is unknown, returns null.

This method uses the mime type as guessed by getMimeType() to guess the file extension.

Tags
see
MimeTypes
see
getMimeType()
Return values
string|null —

move()

Moves the file to a new location.

public move(string $directory[, string $name = null ]) : self
Parameters
$directory : string
$name : string = null
Tags
throws
FileException

if the target file could not be created

Return values
self —

getName()

Returns locale independent base name of the given path.

protected getName(string $name) : string
Parameters
$name : string
Return values
string —

getTargetFile()

protected getTargetFile(string $directory[, string $name = null ]) : self
Parameters
$directory : string
$name : string = null
Return values
self —

Search results