Documentation

File extends Node
in package
implements IFile

File class.

Tags
copyright

Copyright (C) fruux GmbH (https://fruux.com/)

author

Evert Pot (http://evertpot.com/)

license

http://sabre.io/license/ Modified BSD License

Interfaces, Classes and Traits

IFile
This interface represents a file in the directory tree.

Table of Contents

$overrideName  : string
The overridden name of the node.
$path  : string
The path to the current node.
__construct()  : mixed
Sets up the node, expects a full path name.
delete()  : mixed
Delete the current file.
get()  : resource
Returns the data.
getContentType()  : mixed
Returns the mime-type for a file.
getETag()  : mixed
Returns the ETag for a file.
getLastModified()  : int
Returns the last modification time, as a unix timestamp.
getName()  : string
Returns the name of the node.
getSize()  : int
Returns the size of the node, in bytes.
put()  : string|null
Updates the data.
setName()  : mixed
Renames the node.

Properties

$overrideName

The overridden name of the node.

protected string $overrideName

$path

The path to the current node.

protected string $path

Methods

__construct()

Sets up the node, expects a full path name.

public __construct(string $path[, string $overrideName = null ]) : mixed

If $overrideName is set, this node shows up in the tree under a different name. In this case setName() will be disabled.

Parameters
$path : string
$overrideName : string = null
Return values
mixed

delete()

Delete the current file.

public delete() : mixed
Return values
mixed

get()

Returns the data.

public get() : resource
Return values
resource

getContentType()

Returns the mime-type for a file.

public getContentType() : mixed

If null is returned, we'll assume application/octet-stream

Return values
mixed

getETag()

Returns the ETag for a file.

public getETag() : mixed

An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change. The ETag is an arbitrary string, but MUST be surrounded by double-quotes.

Return null if the ETag can not effectively be determined

Return values
mixed

getLastModified()

Returns the last modification time, as a unix timestamp.

public getLastModified() : int
Return values
int

getName()

Returns the name of the node.

public getName() : string
Return values
string

getSize()

Returns the size of the node, in bytes.

public getSize() : int
Return values
int

put()

Updates the data.

public put(resource $data) : string|null
Parameters
$data : resource
Return values
string|null

setName()

Renames the node.

public setName(string $name) : mixed
Parameters
$name : string

The new name

Return values
mixed

Search results