PHP Class Pop\File\Dir

Author: Nick Sagona, III ([email protected])
Exibir arquivo Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$dirs boolean Flag to include base sub directory listings or just the files.
$files array The files within the directory
$full boolean Flag to store the full path.
$objects array The files within the directory as objects
$path string The directory path
$rec boolean Flag to dig recursively.
$tree array The nested tree map of the directory and its files

Public Methods

Method Description
__construct ( string $dir, boolean $full = false, boolean $rec = false, boolean $dirs = true ) : Dir Constructor
emptyDir ( string $path = null, boolean $del = false ) : void Empty an entire directory.
getFiles ( ) : array Get the files.
getGroup ( ) : array Get the owner of the file. Works on POSIX file systems only
getObjects ( ) : array Get the files as objects.
getOwner ( ) : array Get the owner of the file. Works on POSIX file systems only
getPath ( ) : string Get the path.
getPermissions ( ) : string Get the permissions of the directory.
getSystemTemp ( ) : string Static method to return the system temp directory.
getTree ( ) : array Get the tree.
getUploadTemp ( ) : string Static method to return the upload temp directory.
getUser ( ) : array Get current user. Works on POSIX file systems only
isDir ( ) : boolean Is dir object.
isFile ( ) : boolean Is file object.
setPermissions ( integer $mode ) : Dir Change the permissions of the directory.

Protected Methods

Method Description
buildTree ( DirectoryIterator $it ) : array Empty an entire directory.

Method Details

__construct() public method

Instantiate a directory object
public __construct ( string $dir, boolean $full = false, boolean $rec = false, boolean $dirs = true ) : Dir
$dir string
$full boolean
$rec boolean
$dirs boolean
return Dir

buildTree() protected method

Empty an entire directory.
protected buildTree ( DirectoryIterator $it ) : array
$it DirectoryIterator
return array

emptyDir() public method

Empty an entire directory.
public emptyDir ( string $path = null, boolean $del = false ) : void
$path string
$del boolean
return void

getFiles() public method

Get the files.
public getFiles ( ) : array
return array

getGroup() public method

Get the owner of the file. Works on POSIX file systems only
public getGroup ( ) : array
return array

getObjects() public method

Get the files as objects.
public getObjects ( ) : array
return array

getOwner() public method

Get the owner of the file. Works on POSIX file systems only
public getOwner ( ) : array
return array

getPath() public method

Get the path.
public getPath ( ) : string
return string

getPermissions() public method

Get the permissions of the directory.
public getPermissions ( ) : string
return string

getSystemTemp() public static method

Static method to return the system temp directory.
public static getSystemTemp ( ) : string
return string

getTree() public method

Get the tree.
public getTree ( ) : array
return array

getUploadTemp() public static method

Static method to return the upload temp directory.
public static getUploadTemp ( ) : string
return string

getUser() public method

Get current user. Works on POSIX file systems only
public getUser ( ) : array
return array

isDir() public method

Is dir object.
public isDir ( ) : boolean
return boolean

isFile() public method

Is file object.
public isFile ( ) : boolean
return boolean

setPermissions() public method

Change the permissions of the directory.
public setPermissions ( integer $mode ) : Dir
$mode integer
return Dir

Property Details

$dirs protected_oe property

Flag to include base sub directory listings or just the files.
protected bool $dirs
return boolean

$files protected_oe property

The files within the directory
protected array $files
return array

$full protected_oe property

Flag to store the full path.
protected bool $full
return boolean

$objects protected_oe property

The files within the directory as objects
protected array $objects
return array

$path protected_oe property

The directory path
protected string $path
return string

$rec protected_oe property

Flag to dig recursively.
protected bool $rec
return boolean

$tree protected_oe property

The nested tree map of the directory and its files
protected array $tree
return array