class File (View source)

Methods

static bool
exists(string $path)

Check if file exists using case-sensitive, For help developers who using Windows OS and using unix-like for production

static string|bool
permission(string $path, bool $full = false)

Get file/folder permissions in a format more readable.

static string|bool
mime(string $path)

Get mimetype from file, return false if file is invalid

static bool
encoding(string $path)

Determines whether the file is binary

static void|bool
output(string $path, int $length = 262144, int $delay = 0)

Show file in output, if use ob_start is auto used ob_flush. You can set delay in microseconds for cycles

static string|bool
portion(string $path, int $offset = 0, int $maxLen = 1024)

Read excerpt from a file

static string|bool
lines($path, $offset = 0, $maxLines = 32)

Read lines from a file

static float|bool
size(string $path)

Get file size, support for read files with more of 2GB in 32bit.

static string|bool
clearstat()

Clear state files and clear size files in Inphinit\File::size

Details

static bool exists(string $path)

Check if file exists using case-sensitive, For help developers who using Windows OS and using unix-like for production

Parameters

string $path

Return Value

bool

static string|bool permission(string $path, bool $full = false)

Get file/folder permissions in a format more readable.

Return false if file is not found

Parameters

string $path
bool $full

Return Value

string|bool

static string|bool mime(string $path)

Get mimetype from file, return false if file is invalid

Parameters

string $path

Return Value

string|bool

static bool encoding(string $path)

Determines whether the file is binary

Parameters

string $path

Return Value

bool

Exceptions

Exception

static void|bool output(string $path, int $length = 262144, int $delay = 0)

Show file in output, if use ob_start is auto used ob_flush. You can set delay in microseconds for cycles

Parameters

string $path
int $length
int $delay

Return Value

void|bool

static string|bool portion(string $path, int $offset = 0, int $maxLen = 1024)

Read excerpt from a file

Parameters

string $path
int $offset
int $maxLen

Return Value

string|bool

Exceptions

Exception

static string|bool lines($path, $offset = 0, $maxLines = 32)

Read lines from a file

Parameters

$path
$offset
$maxLines

Return Value

string|bool

Exceptions

Exception

static float|bool size(string $path)

Get file size, support for read files with more of 2GB in 32bit.

Return false if file is not found

Parameters

string $path

Return Value

float|bool

Exceptions

Exception

static string|bool clearstat()

Clear state files and clear size files in Inphinit\File::size

Return Value

string|bool

Exceptions

Exception