IQRF PHP file manager

IFileManager

File manager interface

Table of Contents

Methods

chmod()  : void
Changes the permissions of a file or directory
createSymLink()  : void
Creates the symbolic link
delete()  : void
Deletes the file
exists()  : bool
Checks if the file exists
getBasePath()  : string
Returns Base directory path
isSymLink()  : bool
Checks if the file is symbolic link
listDirectories()  : array<string|int, string>
Returns list of subdirectories in directory
listFiles()  : array<string|int, string>
Returns list of files in directory
read()  : string
Reads the file
readIni()  : array<string, mixed>
Reads an INI file and decodes contents to array
readJson()  : mixed
Reads a JSON file and decode contents to array
readNeon()  : mixed
Reads a NEON file and decodes contents to array
write()  : void
Writes into the file
writeIni()  : void
Encodes content from array into INI and writes to file
writeJson()  : void
Encodes content from array into JSON and writes to file
writeNeon()  : void
Encodes content from array into NEON and writes to file

Methods

chmod()

Changes the permissions of a file or directory

public chmod(string|null $path, int $mode[, bool $recursive = false ]) : void
Parameters
$path : string|null

Path to the file or directory

$mode : int

File mode

$recursive : bool = false

Indicates whether the mode should be changed recursively

Creates the symbolic link

public createSymLink(string $target, string $link) : void
Parameters
$target : string

Target of the symbolic link

$link : string

Symbolic link name

delete()

Deletes the file

public delete(string $fileName) : void
Parameters
$fileName : string

File name

Tags
throws
IOException

exists()

Checks if the file exists

public exists(string $fileName) : bool
Parameters
$fileName : string

File name

Return values
bool

Is file exists?

getBasePath()

Returns Base directory path

public getBasePath() : string
Return values
string

Base directory path

Checks if the file is symbolic link

public isSymLink(string $fileName) : bool
Parameters
$fileName : string

File name

Return values
bool

Is symbolic link?

listDirectories()

Returns list of subdirectories in directory

public listDirectories([string|null $subdirectory = null ]) : array<string|int, string>
Parameters
$subdirectory : string|null = null

Relative path to subdirectory

Return values
array<string|int, string>

List of directories

listFiles()

Returns list of files in directory

public listFiles([string|null $subdirectory = null ]) : array<string|int, string>
Parameters
$subdirectory : string|null = null

Relative path to subdirectory

Return values
array<string|int, string>

List of files

read()

Reads the file

public read(string $fileName) : string
Parameters
$fileName : string

File name

Tags
throws
IOException
Return values
string

File content

readIni()

Reads an INI file and decodes contents to array

public readIni(string $fileName) : array<string, mixed>
Parameters
$fileName : string

File name

Tags
throws
IOException
Return values
array<string, mixed>

Decoded INI file

readJson()

Reads a JSON file and decode contents to array

public readJson(string $fileName[, bool $forceArray = true ]) : mixed
Parameters
$fileName : string

File name

$forceArray : bool = true

Force object to array conversion

Tags
throws
IOException
throws
JsonException
Return values
mixed

Decoded JSON data

readNeon()

Reads a NEON file and decodes contents to array

public readNeon(string $fileName) : mixed
Parameters
$fileName : string

File name

Tags
throws
IOException
throws
Exception
Return values
mixed

Decoded NEON file

write()

Writes into the file

public write(string $fileName, mixed $content) : void
Parameters
$fileName : string

File name

$content : mixed

File content

Tags
throws
IOException

writeIni()

Encodes content from array into INI and writes to file

public writeIni(string $fileName, array<string, mixed> $content) : void
Parameters
$fileName : string

File name

$content : array<string, mixed>

Array to encode

Tags
throws
IOException

writeJson()

Encodes content from array into JSON and writes to file

public writeJson(string $fileName, mixed $content) : void
Parameters
$fileName : string

File name

$content : mixed

JSON data to encode

Tags
throws
IOException
throws
JsonException

writeNeon()

Encodes content from array into NEON and writes to file

public writeNeon(string $fileName, mixed $content) : void
Parameters
$fileName : string

File name

$content : mixed

NEON data to encode

Tags
throws
IOException
throws
Exception

        
On this page

Search results