YANA 4 PHP Framework
Docs For Class DirStream
Manipulate a directory
This class represents a directory. You may use this to get a list of contents, or remove, or create a directory.
Located in /includes/class_dirstream.php
Object | --InputStream | --DirStream
Name | Type | Description |
---|---|---|
$path | string |
Create a new instance of this class.
Name | Type | Description |
---|---|---|
$mode | int | access mode |
Tries to create the directory. Check the developer's cookbook for an example to this function.
Name | Type | Description |
---|---|---|
$is_recursive | bool | triggers wether to remove directories even if they are not empty, default = false |
By option you may choose to also recursivly remove all files and subdirectories inside. Otherwise the directory will only be removed if it is empty.
Returns bool(true) on success and bool(false) on error.
Name | Type | Description |
---|---|---|
$filter | string |
The argument $filter may contain multiple file extension, use a pipe '|' sign to seperate them. Example: "*.xml|*.html" will find all xml- and html-files
Returns bool(true) on success and bool(false) otherwise.
Redefinition of: InputStream::exists()
NOTE: will only return filenames with the path stripped
Redefinition of: InputStream::get()
Name | Type | Description |
---|---|---|
$directory | string | directory name |
$includeSubDirs | bool | on / off |
$useCache | bool | on / off |
Returns the size of $directory in bytes.
This function gets the sum of the sizes of all files in a directory.
If $directory is not provided or NULL, the current directory is used. If $includeSubDirs is not provided or true, the result will include all subdirectories.
If $useCache is not provided or true, the result is cached for the current directory.
Returns bool(false) if the directory does not exist and issues an E_USER_WARNING.
Returns bool(true) if there are no files that match the current filter and bool(false) if there is at least 1 file that matches.
This returns a positive integer. Note that this functions counts the files in respect to the currently set file filter. So the number of files reported here and the number in total may vary.
Returns a string with the contents of this directory. Entries are seperated by line-breaks.
Redefinition of: Object::toString()
Inherited From InputStream
Inherited From Object
Documentation generated on Sun, 11 Mar 2007 15:02:28 +0100 by phpDocumentor 1.3.1