File
class File
File
Methods
Load json file and return decoded array
Get php classes defined in file
Check if file exists
Return true if file is writtable
Set file writtable
Return file size
Get file size text.
Create directory
Undocumented function
Write encoded file
Write file
Get file base name from path
Return file extension
Delete file or durectiry
Return true if direcotry is empty
Delete directory and all sub directories
Read file
Return true if MIME type is image
Get file mime type
Copy file, symlink or directory
Get directory files
Details
at line 27
static array|false
readJsonFile(string $fileName, array|null $vars = null)
Load json file and return decoded array
at line 50
static array|false
getClassesInFile(string $fileName)
Get php classes defined in file
at line 66
static bool
exists(string $fileName)
Check if file exists
at line 77
static bool
isWritable(string $fileName)
Return true if file is writtable
at line 88
static bool
setWritable(string $fileName)
Set file writtable
at line 103
static integer|false
getSize(string $fileName)
Return file size
at line 116
static string|array
getSizeText(integer $size, array $labels = null, boolean $asText = true)
Get file size text.
at line 129
static bool
makeDir(string $path, integer $mode = 0755, bool $recursive = true)
Create directory
at line 143
static boolean
writeUplaodedFile(array $file, string $path, integer $mode = null, integer $flags = 0)
Undocumented function
at line 163
static bool
writeEncoded(string $fileName, mixed $encodedData, integer $flags = 0)
Write encoded file
at line 178
static bool
write(string $fileName, mixed $data, integer $flags = 0)
Write file
at line 192
static string|null
baseName(string|null $path, string $suffix = '')
Get file base name from path
at line 207
static string
getExtension(string $fileName)
Return file extension
at line 218
static bool
delete(string $fileName)
Delete file or durectiry
at line 233
static bool
isEmpty(string $path)
Return true if direcotry is empty
at line 245
static bool
deleteDirectory(string $path, bool $skipMainFolder = true)
Delete directory and all sub directories
at line 286
static mixed|null
read(string $fileName)
Read file
at line 297
static boolean
isImageMimeType(string $mimeType)
Return true if MIME type is image
at line 308
static string|false
getMimetype(string $fileName)
Get file mime type
at line 321
static bool
copy(string $from, string $to, bool $overwrite = true)
Copy file, symlink or directory
at line 361
static array
scanDir(string $path, array $skip = ['..', '.'])
Get directory files