\App\CoreModule\ModelsFileManager

Tool for reading and writing text files

Summary

Methods
Properties
Constants
__construct()
getDirectory()
delete()
exists()
read()
write()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
fixPermissions()
$directory
$commandManager
N/A

Properties

$directory

$directory : string

Type

normal — Directory with files

$commandManager

$commandManager : \App\CoreModule\Models\CommandManager

Type

normal — Command manager

Methods

__construct()

__construct(string  $directory, \App\CoreModule\Models\CommandManager  $commandManager) : mixed

Constructor

Parameters

string $directory

Directory with files

\App\CoreModule\Models\CommandManager $commandManager

Command managers

Returns

mixed

getDirectory()

getDirectory() : string

Returns the directory with files

Returns

string —

Directory with files

delete()

delete(string  $fileName) : void

Deletes the file

Parameters

string $fileName

File name

Throws

\Nette\IOException

exists()

exists(string  $fileName) : bool

Checks if the file exists

Parameters

string $fileName

File name

Returns

bool —

Is file exists?

read()

read(string  $fileName) : mixed

Reads the file

Parameters

string $fileName

File name

Throws

\Nette\IOException

Returns

mixed —

File content

write()

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

Writes into the file

Parameters

string $fileName

File name

mixed $content

File content

Throws

\Nette\IOException

fixPermissions()

fixPermissions(string  $fileName) : void

Fixes the permissions

Parameters

string $fileName

File name