File
class File (View source)
Methods
Enables/disable case-sensitive file and directory existence checks performed by
the framework in most methods of the File class. If disabled, case sensitivity
is determined by the operating system or the underlying file system.
Checks whether a file or directory exists using case-sensitive path
matching, helping developers maintain consistent behavior across
Windows development environments and Unix-like production systems
Note: File::exists() method is not affected by this configuration
Get file/directory permissions in a format more readable.
Show file in output, if use ob_start is auto used ob_flush
Reads file into a string, starting at the specified offset up to length bytes
Note: Same behavior as file_get_contents, but case-sensitive in development mode
Read lines from a file
Clear state files and clear info files from permissions()
Details
static bool
strict(bool|null $enable = null)
Enables/disable case-sensitive file and directory existence checks performed by
the framework in most methods of the File class. If disabled, case sensitivity
is determined by the operating system or the underlying file system.
static bool
exists(string $path)
Checks whether a file or directory exists using case-sensitive path
matching, helping developers maintain consistent behavior across
Windows development environments and Unix-like production systems
Note: File::exists() method is not affected by this configuration
static string|false
permissions(string $path, bool $full = false, bool $link = false)
Get file/directory permissions in a format more readable.
Return false if file is not found
static bool
output(string $path, int $length = 0, int $delay = 0)
Show file in output, if use ob_start is auto used ob_flush
static string|false
portion(string $path, int $offset = 0, int $length = 1024)
Reads file into a string, starting at the specified offset up to length bytes
Note: Same behavior as file_get_contents, but case-sensitive in development mode
static array|false
lines(string $path, int $offset = 0, int $length = 100)
Read lines from a file
static
clearstat()
Clear state files and clear info files from permissions()