Properties

$_dir

$_dir : 

Type

$_fileName

$_fileName : 

Type

$_mimeType

$_mimeType : 

Type

$_properties

$_properties : 

Type

$_uri

$_uri : 

Type

$_realName

$_realName : string

Used for temporary file to store the original file name.

Type

string

Methods

__construct()

__construct(string  $path, null|string  $mimeType = null) 

Constructor

Parameters

string $path
null|string $mimeType

setMimeType()

setMimeType(string  $mimeType) : void

Sets mime

Parameters

string $mimeType

getMimeType()

getMimeType() : null|string

Gets mime

Returns

null|string

hasMimeType()

hasMimeType() : boolean

Has mime

Returns

boolean

getPath()

getPath() : null

Gets path

Returns

null

getDir()

getDir() : null

Gets dir

Returns

null

getFileName()

getFileName() : null

Gets file name

Returns

null

getFileNameWithoutExtension()

getFileNameWithoutExtension(boolean  $realName = false) : null|string

Gets file name without extension

Parameters

boolean $realName

Returns

null|string

getExtension()

getExtension(boolean  $realName = false) : string

Gets file extension

Parameters

boolean $realName

Returns

string

getRealName()

getRealName() : null|string

Gets real name

Returns

null|string

setRealName()

setRealName(string  $name) : void

Sets real name

Parameters

string $name

getLastModified()

getLastModified() : integer

Gets file last modified

Returns

integer

getSize()

getSize() : integer

Gets size

Returns

integer

setProperties()

setProperties(array  $properties) 

Sets properties

Parameters

array $properties

addProperty()

addProperty(string  $key, string  $value) : void

Add a property

Parameters

string $key
string $value

getProperty()

getProperty(string  $key) : null|string|object

Gets a property Key may be point delimited to address deeper values

Parameters

string $key

Returns

null|string|object

hasProperty()

hasProperty(string  $key) : boolean

Has property

Parameters

string $key

Returns

boolean

getProperties()

getProperties() : array

Gets properties

Returns

array

setUri()

setUri(string  $uri) : void

Sets file uri

Parameters

string $uri

getUri()

getUri() : null|string

Gets file uri

Returns

null|string

exists()

exists() : boolean

File exists

Returns

boolean

__clone()

__clone() : \Fuman_File

Clone file

Returns

\Fuman_File

copyTo()

copyTo(string  $path) : \Fuman_File|null

Copies file to

Parameters

string $path

Returns

\Fuman_File|null —

Returns a new instance of Fuman_File or null when copying fails.

mkDir()

mkDir() : void

Makes parent directories for files

moveTo()

moveTo(string  $path) : \Fuman_File|null

Moves file to

Parameters

string $path

Returns

\Fuman_File|null

rename()

rename(string  $newName) : boolean

Renames file

Parameters

string $newName

Returns

boolean

delete()

delete() : boolean

Deletes file and add property "deleted"

Returns

boolean

getCacheHash()

getCacheHash() : null|string

Gets cache hash of file

Returns

null|string

deleteCache()

deleteCache() : void

Deletes cache of file

getCache()

getCache() : null|\Fuman_File_Cache

Gets cache

Returns

null|\Fuman_File_Cache

cache()

cache(string  $cacheKey, null|\stdClass  $metaData = null) : null

Creates cache file

Parameters

string $cacheKey
null|\stdClass $metaData

Returns

null

initFromCache()

initFromCache(string  $cacheKey, boolean  $writeCacheDataIntoFile = false) : boolean

Initializes file from cache

Parameters

string $cacheKey
boolean $writeCacheDataIntoFile

Returns

boolean

getContents()

getContents() : string

Get file contents

Returns

string

writeContents()

writeContents(string  $contents) : boolean

Write file contents

Parameters

string $contents

Returns

boolean

_init()

_init(string  $path) : void

Init file

Parameters

string $path

_setDir()

_setDir(string  $path) 

Sets directory path

Parameters

string $path

_setFileName()

_setFileName(string  $path) 

Sets file name

Parameters

string $path

_copyTo()

_copyTo(\Fuman_File  $newFile) : null|\Fuman_File

Copies file to

Parameters

\Fuman_File $newFile

Returns

null|\Fuman_File

_hasLoadedCache()

_hasLoadedCache() : boolean

Does the file has a valid cache

Returns

boolean