FileHandling
Table of Contents
- $file : string
- File.
- $modes : array<string|int, mixed>
- Modes of file.
- $resource : object
- Resource.
- addCustomMode() : void
- Add custom mode.
- close() : void
- Close the file resource.
- delete() : bool
- Delete the file.
- open() : resource
- Open the file.
- read() : mixed
- Read the file.
- write() : bool
- Write on file.
Properties
$file
File.
private
string
$file
Tags
$modes
Modes of file.
private
array<string|int, mixed>
$modes
= ['readOnly' => 'r', 'readWrite' => 'r+', 'writeOnly' => 'w', 'writeMaster' => 'w+', 'writeAppend' => 'a', 'readWriteAppend' => 'a+', 'writeOverride' => 'wa+']
Tags
$resource
Resource.
private
object
$resource
Tags
Methods
addCustomMode()
Add custom mode.
public
addCustomMode((string) $name, mixed $value) : void
Parameters
- $name : (string)
-
Valid name. .@param (string) $value Valid mode.
- $value : mixed
Tags
Return values
void —close()
Close the file resource.
public
close() : void
Tags
Return values
void —delete()
Delete the file.
public
delete((string) $file) : bool
Parameters
- $file : (string)
-
File to be deleted.
Tags
Return values
bool —open()
Open the file.
public
open((string) $file, (string) $mode) : resource
Parameters
- $file : (string)
-
Name of file with oath.
- $mode : (string)
-
Mode of file.
Tags
Return values
resource —read()
Read the file.
public
read() : mixed
Tags
Return values
mixed —write()
Write on file.
public
write((mixed) $data) : bool
Parameters
- $data : (mixed)
-
Data that you want write on file