Files
extends Base
in package
Files
Tags
Table of Contents
Properties
- $author : mixed
- $debug_log : mixed
- $debugger : mixed
- $name : mixed
- $url : mixed
- $vars : mixed
- $verbose : mixed
- $version : mixed
Methods
- __construct() : mixed
- currentFileName() : string
- currentFileName
- file_close() : bool
- file_close
- file_delete() : bool
- file_delete
- file_is_empty() : bool
- file_is_empty
- file_read() : string|null
- file_read
- file_write() : string|bool
- file_write
- file_write_access() : bool
- file_write_access
- include_folder() : mixed
- include_folder
- is_file() : bool
- is_file
- preventDirect() : void
- preventDirect
Properties
$author
public
mixed
$author
= "Darknetzz"
$debug_log
public
mixed
$debug_log
= []
$debugger
public
mixed
$debugger
$name
public
mixed
$name
= "PHPUtils"
$url
public
mixed
$url
= "https://github.com/Darknetzz"
$vars
public
mixed
$vars
$verbose
public
mixed
$verbose
= \true
$version
public
mixed
$version
= "1.0.0"
Methods
__construct()
public
__construct() : mixed
currentFileName()
currentFileName
public
currentFileName([bool $ext = True ]) : string
Get the current file name
Parameters
- $ext : bool = True
-
Whether to include the file extension. Defaults to true
Return values
string —The current file name
file_close()
file_close
public
file_close(mixed $handle[, mixed $attempts = 3 ]) : bool
Close a file handle
Parameters
- $handle : mixed
-
The file handle to close
- $attempts : mixed = 3
-
The number of attempts to close the file handle
Return values
bool —True if the file handle was closed, false otherwise
file_delete()
file_delete
public
file_delete(mixed $fullpath) : bool
Delete a file
Parameters
- $fullpath : mixed
-
The full path to the file
Return values
bool —True if the file was deleted, false otherwise
file_is_empty()
file_is_empty
public
file_is_empty(mixed $fullpath) : bool
Check if a file is empty
Parameters
- $fullpath : mixed
-
The full path to the file
Return values
bool —True if the file is empty, false otherwise
file_read()
file_read
public
file_read(mixed $fullpath) : string|null
Read a file
Parameters
- $fullpath : mixed
-
The full path to the file
Return values
string|null —The contents of the file, or null if the file is empty
file_write()
file_write
public
file_write(mixed $fullpath, mixed $content[, mixed $create = true ]) : string|bool
Write to a file
Parameters
- $fullpath : mixed
-
The full path to the file
- $content : mixed
-
The content to write to the file
- $create : mixed = true
-
Whether to create the file if it does not exist. Defaults to true
Return values
string|bool —The content written to the file, or false if the file does not exist and $create is false
file_write_access()
file_write_access
public
file_write_access(mixed $fullpath) : bool
Check if a file has write access
Parameters
- $fullpath : mixed
-
The full path to the file
Return values
bool —True if the file has write access, false otherwise
include_folder()
include_folder
public
include_folder(mixed $fullpath, mixed $except) : mixed
Include all files in a folder, except those in the $except array
Parameters
- $fullpath : mixed
-
The full path to the folder
- $except : mixed
-
An array of files to exclude
is_file()
is_file
public
is_file(mixed $fullpath) : bool
Check if a file exists and is a file
Parameters
- $fullpath : mixed
-
The full path to the file
Return values
bool —True if the file exists and is a file, false otherwise
preventDirect()
preventDirect
public
preventDirect([mixed $exceptions = [] ][, mixed &$pagevar = null ][, mixed $callback = null ]) : void
Prevents direct invokation of a script - except $exceptions
Parameters
- $exceptions : mixed = []
- $pagevar : mixed = null
- $callback : mixed = null