PHP Class JonathanTorres\Construct\Helpers\Filesystem

Datei anzeigen Open project: jonathantorres/construct Class Usage Examples

Public Methods

Method Description
copy ( string $path, string $target ) : boolean Copy the given file a new location.
get ( string $path ) : string Get the contents of a file.
getDefaultConfigurationFile ( ) : string Get the default construct configuration file.
getHomeDirectory ( $os = PHP_OS ) : string Get the home directory.
hasDefaultConfigurationFile ( ) : boolean Determine if system has a default configuration file.
isDirectory ( string $path ) : boolean Check if the path is a directory.
isFile ( string $path ) : boolean Check if the path is a file.
isReadable ( string $path ) : boolean Check if the path is readable.
makeDirectory ( string $path, boolean $recursive = false ) : boolean Create a directory
move ( string $path, string $target ) : boolean Move the given file to a new location.
put ( string $path, string $contents ) : integer Write the contents of a file.

Method Details

copy() public method

Copy the given file a new location.
public copy ( string $path, string $target ) : boolean
$path string
$target string
return boolean

get() public method

Get the contents of a file.
public get ( string $path ) : string
$path string
return string

getDefaultConfigurationFile() public method

Get the default construct configuration file.

getHomeDirectory() public method

Get the home directory.
public getHomeDirectory ( $os = PHP_OS ) : string
return string

hasDefaultConfigurationFile() public method

Determine if system has a default configuration file.
public hasDefaultConfigurationFile ( ) : boolean
return boolean boolean

isDirectory() public method

Check if the path is a directory.
public isDirectory ( string $path ) : boolean
$path string
return boolean

isFile() public method

Check if the path is a file.
public isFile ( string $path ) : boolean
$path string
return boolean

isReadable() public method

Check if the path is readable.
public isReadable ( string $path ) : boolean
$path string
return boolean

makeDirectory() public method

Create a directory
public makeDirectory ( string $path, boolean $recursive = false ) : boolean
$path string
$recursive boolean Defaults to false.
return boolean

move() public method

Move the given file to a new location.
public move ( string $path, string $target ) : boolean
$path string
$target string
return boolean

put() public method

Write the contents of a file.
public put ( string $path, string $contents ) : integer
$path string
$contents string
return integer