\PhoolFile

Summary

Methods
Properties
Constants
suffix()
fileSuffix()
combinePath()
trailingSepar()
isAbsolutePath()
mkAbsolutePath()
readFile()
scandir()
atomicWrite()
pathUniqueID()
recursiveCopy()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$simul_inode_array
$simul_inode_index
N/A

Properties

$simul_inode_array

$simul_inode_array : 

Computes a string uniquely identifying a given path on this host.

Mount point unicity is based on a combination of device+inode+mtime.

On systems which don't supply a valid inode number (eg Windows), we maintain a fake inode table, whose unicity is based on the path filtered through realpath(). It is not perfect because I am not sure that realpath really returns a unique 'canonical' path, but this is best solution I have found so far.

Type

$simul_inode_index

$simul_inode_index : 

Type

Methods

suffix()

suffix(  $filename) 

Parameters

$filename

fileSuffix()

fileSuffix(  $filename) 

Parameters

$filename

combinePath()

combinePath(string  $base, string|null  $path, boolean  $separ = false) : string

Combines a base path with another path

The base path can be relative or absolute.

The 2nd path can also be relative or absolute. If absolute, it is returned as-is. If it is a relative path, it is combined to the base path.

Uses '/' as separator (to be compatible with stream-wrapper URIs).

Parameters

string $base

The base path

string|null $path

The path to combine

boolean $separ

true: add trailing sep, false: remove it

Returns

string —

The resulting path

trailingSepar()

trailingSepar(string  $path,   $separ) : boolean

Adds or removes a trailing separator in a path

Parameters

string $path

Input

$separ

Returns

boolean —

The result path

isAbsolutePath()

isAbsolutePath(string  $path) : boolean

Determines if a given path is absolute or relative

Parameters

string $path

The path to check

Returns

boolean —

True if the path is absolute, false if relative

mkAbsolutePath()

mkAbsolutePath(string  $path, boolean  $separ = false) : string

Build an absolute path from a given (absolute or relative) path

If the input path is relative, it is combined with the current working directory.

Parameters

string $path

The path to make absolute

boolean $separ

True if the resulting path must contain a trailing separator

Returns

string —

The resulting absolute path

readFile()

readFile(  $path) 

Parameters

$path

scandir()

scandir(  $path) 

Parameters

$path

atomicWrite()

atomicWrite(  $path,   $data) 

Parameters

$path
$data

pathUniqueID()

pathUniqueID(  $prefix,   $path,   $mtime) 

Parameters

$prefix
$path
$mtime

recursiveCopy()

recursiveCopy(  $src,   $dst) 

Parameters

$src
$dst