PHP Class KamranAhmed\Smasher\Path

Responsible for managing everything related to Paths
Show file Open project: kamranahmedse/smasher

Public Methods

Method Description
__construct ( string $path = '' ) Path constructor.
createItem ( array $detail = [] ) Creates the path based upon the type of it
getDetail ( ) : array Gets the detail about the currently set path
getFileContent ( ) : string If the set path is file, it returns the contents of the file
getGroup ( ) : array Returns the detail of the path group
getLastModified ( ) : string Gets the last date when the path was modified
getMode ( ) : string Returns the permission that the path has
getName ( ) : mixed Gets the name of the currently set path
getOwner ( ) : array Returns the detail of the path owner
getPath ( ) : string Gets the path which is being operated
getRealPath ( ) : string Gets the real path for the path
getSize ( ) : integer Returns the size of the path in bytes
getType ( ) : string Gets the type of path i.e. whether it is file, link or dir
saveFileContent ( $content ) : integer Writes content to the specified path
setPath ( $path ) Sets the path to operate on
validate ( ) : boolean Validates whether the path exists or not

Method Details

__construct() public method

Path constructor.
public __construct ( string $path = '' )
$path string

createItem() public method

Creates the path based upon the type of it
public createItem ( array $detail = [] )
$detail array

getDetail() public method

Gets the detail about the currently set path
public getDetail ( ) : array
return array

getFileContent() public method

If the set path is file, it returns the contents of the file
public getFileContent ( ) : string
return string

getGroup() public method

Returns the detail of the path group
public getGroup ( ) : array
return array

getLastModified() public method

Gets the last date when the path was modified
public getLastModified ( ) : string
return string

getMode() public method

Returns the permission that the path has
public getMode ( ) : string
return string

getName() public method

Gets the name of the currently set path
public getName ( ) : mixed
return mixed

getOwner() public method

Returns the detail of the path owner
public getOwner ( ) : array
return array

getPath() public method

Gets the path which is being operated
public getPath ( ) : string
return string

getRealPath() public method

Gets the real path for the path
public getRealPath ( ) : string
return string

getSize() public method

Returns the size of the path in bytes
public getSize ( ) : integer
return integer

getType() public method

Gets the type of path i.e. whether it is file, link or dir
public getType ( ) : string
return string

saveFileContent() public method

Writes content to the specified path
public saveFileContent ( $content ) : integer
$content
return integer

setPath() public method

Sets the path to operate on
public setPath ( $path )
$path

validate() public method

Validates whether the path exists or not
public validate ( ) : boolean
return boolean