Documentation

File
in package
implements FileInterface

File

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

CLOUDREXX Development Team info@cloudrexx.com

subpackage

lib_filesystem

Table of Contents

Interfaces

FileInterface
FileInterface

Constants

PHP_ACCESS  = 1
UNKNOWN_ACCESS  = 0

Properties

$file  : string
The value of $file that has been passed to the constructor.
$fsFile  : FileSystemFile
$accessMode  : mixed

Methods

__construct()  : mixed
Instanciate a file system file to perform operations on.
append()  : mixed
copy()  : mixed
delete()  : true
Removes file
getAbsoluteFilePath()  : string
Get absolute path of file
getAccessMode()  : mixed
getData()  : mixed
makeWritable()  : true
Sets write access to file's owner
move()  : mixed
rename()  : mixed
touch()  : true
Creates files if it doesn't exists yet
write()  : true
Write data specified by $data to file
getFileInstance()  : FileSystemFile
setAccessMode()  : mixed

Constants

Properties

$file

The value of $file that has been passed to the constructor.

protected string $file = null

$fsFile

protected FileSystemFile $fsFile = null

Local FileSystemFile instance of the instanciated filesystem file. In case access mode is PHP_ACCESS or UNKNOWN_ACCESS then all file operations will be performed directly on this instance.

Methods

__construct()

Instanciate a file system file to perform operations on.

public __construct(string $file) : mixed

By default only the instantiation of files located in one of the following locations is allowed:

  • /images
  • /media
  • /themes
  • /tmp/session-
Parameters
$file : string

Path to file

Tags
throws
FileException

In case $file is not a valid path or $file points to a location this instance is not allowed to access to.

append()

public append(mixed $data) : mixed
Parameters
$data : mixed

copy()

public copy(mixed $dst[, mixed $force = false ]) : mixed
Parameters
$dst : mixed
$force : mixed = false

delete()

Removes file

public delete() : true
Tags
throws
FileSystemException

if removing of file fails

Return values
true

if file has successfully been removed

getAbsoluteFilePath()

Get absolute path of file

public getAbsoluteFilePath() : string
Return values
string

Absolute path of file

makeWritable()

Sets write access to file's owner

public makeWritable() : true
Tags
throws
FileSystemException

if setting write access fails

Return values
true

if file is already writable or setting write access was successful

move()

public move(mixed $dst[, mixed $force = false ]) : mixed
Parameters
$dst : mixed
$force : mixed = false

rename()

public rename(mixed $dst[, mixed $force = false ]) : mixed
Parameters
$dst : mixed
$force : mixed = false

touch()

Creates files if it doesn't exists yet

public touch() : true
Tags
throws
FileSystemException

if file does not exist and creating fails

Return values
true

on success

write()

Write data specified by $data to file

public write(mixed $data) : true
Parameters
$data : mixed
Tags
throws
FileSystemException

if writing to file fails

Return values
true

on sucess

setAccessMode()

private setAccessMode() : mixed

        
On this page

Search results