class Filesystem (View source)

Methods

static bool
chmod(string $path, int $mode, bool $recursive = false)

Changes mode for files/directories.

static bool
chgrp(string $file, int $group, bool $recursive = false)

Changes group of file.

static bool
copy(string $srcfile, string $destfile)

Copies file.

static bool
delete(string $file, bool $strict = true)

Removes file.

static bool
deleteFiles(array $files, bool $strict = true)

Removes files.

static mixed
glob(string $directory, mixed $pattern = null)

Returns pathnames matching a pattern (for files only & hidden files).

static bool
mkdir(mixed $directory, int $mode = 0777, bool $recursive = false, bool $strict = true)

Create new directory.

static bool
mkdirs(mixed $directories, int $mode = 0777, bool $recursive = false, bool $strict = true)

Create new directories.

static mixed
rmdir(string $directory, bool $strict = true)

Removes a directory.

static mixed
rmdirs(array $directories, bool $strict = true)

Removes a directories.

static bool
rename(string $old_file, string $new_file)

Moves file to different path (rename).

static 
fileWrite($filename, $content, $append = false)

No description

static 
fileContent($filename)

No description

static mixed
tmpfile(string $template = null, bool $resource = false)

Create temporary file.

static mixed
tmpdir(string $template = null)

Create temporary directory.

static bool
dirExists(string $directory, bool $strict = true)

Checks if directory exists;.

static bool
fileExists(string $file, bool $strict = true)

Checks if file exists;.

Details

final static bool chmod(string $path, int $mode, bool $recursive = false)

Changes mode for files/directories.

Parameters

string $path path to the file or file
int $mode mode
bool $recursive recursive file mode change

Return Value

bool

final static bool chgrp(string $file, int $group, bool $recursive = false)

Changes group of file.

Parameters

string $file path to the file
int $group file group
bool $recursive recursive file mode change

Return Value

bool

final static bool copy(string $srcfile, string $destfile)

Copies file.

Parameters

string $srcfile path to the source file
string $destfile path to the destination file

Return Value

bool

final static bool delete(string $file, bool $strict = true)

Removes file.

Parameters

string $file file name
bool $strict strict error checking

Return Value

bool

final static bool deleteFiles(array $files, bool $strict = true)

Removes files.

Parameters

array $files file names
bool $strict strict error checking

Return Value

bool

final static mixed glob(string $directory, mixed $pattern = null)

Returns pathnames matching a pattern (for files only & hidden files).

Parameters

string $directory directory
mixed $pattern pattern (does not support tilde expansion)

Return Value

mixed

final static bool mkdir(mixed $directory, int $mode = 0777, bool $recursive = false, bool $strict = true)

Create new directory.

Parameters

mixed $directory path to the directory
int $mode directory permission mode value (octal)
bool $recursive create directories as needed
bool $strict strict error checking

Return Value

bool

final static bool mkdirs(mixed $directories, int $mode = 0777, bool $recursive = false, bool $strict = true)

Create new directories.

Parameters

mixed $directories path to the directories
int $mode directory permission mode value (octal)
bool $recursive create directories as needed
bool $strict strict error checking

Return Value

bool

final static mixed rmdir(string $directory, bool $strict = true)

Removes a directory.

Parameters

string $directory directory to remove
bool $strict strict error checking

Return Value

mixed

final static mixed rmdirs(array $directories, bool $strict = true)

Removes a directories.

Parameters

array $directories directories to remove
bool $strict strict error checking

Return Value

mixed

final static bool rename(string $old_file, string $new_file)

Moves file to different path (rename).

Parameters

string $old_file path to the old file
string $new_file path to the new file

Return Value

bool

final static fileWrite($filename, $content, $append = false)

Parameters

$filename
$content
$append

final static fileContent($filename)

Parameters

$filename

final static mixed tmpfile(string $template = null, bool $resource = false)

Create temporary file.

Parameters

string $template temporary filename template (default=tmp-XXXXXXXXXXXXXX)
bool $resource request file pointer into temporary file

Return Value

mixed

final static mixed tmpdir(string $template = null)

Create temporary directory.

Parameters

string $template temporary directory template (default=tmpXXXXXXXXXXXXXX)

Return Value

mixed

final static bool dirExists(string $directory, bool $strict = true)

Checks if directory exists;.

Parameters

string $directory directory name
bool $strict strict error checking

Return Value

bool

final static bool fileExists(string $file, bool $strict = true)

Checks if file exists;.

Parameters

string $file file name
bool $strict strict error checking

Return Value

bool