This is an abstract class for platform specific filesystem implementations you have to implement each method in the platform specific filesystem implementation classes Your local filesytem implementation must extend this class.
You should also use this class as a template to write your local implementation Some native PHP filesystem specific methods are abstracted here as well. Anyway you must always use this methods via a PhingFile object (that by nature uses the *FileSystem drivers to access the real filesystem via this class using natives.
FIXME: - Error handling reduced to min fallthrough runtime exceptions more precise errorhandling is done by the PhingFile class
author | Charlie Killian |
---|---|
author | Hans Lellelid |
version | $Id: bc979767c07b19eafeb3fc6f6efa938dd73bde18 $ |
package | phing.system.io |
canDelete(\PhingFile $f) : boolean
canonicalize(string $strPath) : mixed
string
mixed
Canonical path or false if the file doesn't exist.checkAccess(\PhingFile $f, boolean $write)
If the second argument is false, then a check for read access is made; if the second argument is true, then a check for write (not read-write) access is made. Return false if access is denied or an I/O error occurs.
\PhingFile
boolean
chgrp(string $pathname, string $group) : void
string
Path and name of file or directory.
string
The group of the file or directory. See http://us.php.net/chgrp
\IOException |
if operation failed. |
---|
chmod(string $pathname, int $mode) : void
string
Path and name of file or directory.
int
The mode (permissions) of the file or directory. If using octal add leading 0. eg. 0777. Mode is affected by the umask system setting.
\IOException |
if operation failed. |
---|
chown(string $pathname, string $user) : void
string
Path and name of file or directory.
string
The user name or number of the file or directory. See http://us.php.net/chown
\Exception |
if operation failed. |
---|
compare(\PhingFile $f1, \PhingFile $f2)
compareMTimes(\file1 $file1, \file2 $file2) : \Int.
\file1
String. Path and name of file1.
\file2
String. Path and name of file2.
\Exception |
- if cannot get modified time of either file. |
---|
\Int.
1 if file1 is newer.
-1 if file2 is newer.
0 if files have the same time.
Err object on failure.copy(\PhingFile $src, \PhingFile $dest) : void
copyr(string $source, string $dest) : bool
author | Aidan Lister |
---|---|
version | 1.0.1 |
link | http://aidanlister.com/repos/v/function.copyr.php |
string
Source path
string
Destination path
bool
Returns TRUE on success, FALSE on failurecreateDirectory(\PhingFile $f, int $mode) : boolean
NOTE: umask() is reset to 0 while executing mkdir(), and restored afterwards
\PhingFile
int
boolean
createNewFile(string $strPathname) : boolean
Return true if the file was created and false if a file or directory with the given pathname already exists. Throw an IOException if an I/O error occurs.
string
Path of the file to be created.
\IOException |
---|
boolean
delete(\PhingFile $f, boolean $recursive) : void
deleteOnExit(\PhingFile $f)
fromURIPath(string $path)
This is used on win32, e.g., to transform "/c:/foo" into "c:/foo". The path string still has slash separators; code in the PhingFile class will translate them after this method returns.
string
getBooleanAttributes(\PhingFile $f)
\PhingFile
getDefaultParent()
getFileSystem() : \FileSystem
getLastModifiedTime(\PhingFile $f) : int
getLength(\PhingFile $f) : int
getPathSeparator()
getSeparator()
isAbsolute(\PhingFile $f)
\PhingFile
listDir(\PhingFile $f)
Return an array of strings naming the elements of the directory if successful; otherwise, return
null
.
\PhingFile
listRoots()
\IOException |
---|
lock(\PhingFile $f) : void
normalize(string $strPath)
If the string is already in normal form then it is simply returned.
string
prefixLength(string $pathname)
The pathname string must be in normal form.
string
rename(\PhingFile $f1, \PhingFile $f2) : void
resolve(string $parent, string $child)
Both strings must be in normal form, and the result will be a string in normal form.
string
string
resolveFile(\PhingFile $f)
Invoked by the getAbsolutePath and getCanonicalPath methods in the PhingFile class.
\PhingFile
rmdir(\dir $dir, \children $children) : void
\dir
String. Path and/or name of directory to delete.
\children
Boolean. False: don't delete directory contents. True: delete directory contents.
setLastModifiedTime(\PhingFile $f, int $time) : void
setReadOnly(\PhingFile $f)
symlink(string $target, string $link) : void
Currently symlink is not implemented on Windows. Don't use if the application is to be portable.
string
Path and/or name of file to link.
string
Path and/or name of link to be created.
touch(string $file, int $time) : void
string
Path and/or name of file to touch.
int
umask(\mode $mode) : void
\mode
Int. Permissions ususally in ocatal. Use leading 0 for octal. Number between 0 and 0777.
\Exception |
if there is an error performing operation. |
---|
unlink(string $file) : void
string
Path and/or name of file to delete.
\IOException |
- if an error is encountered. |
---|
unlock(\PhingFile $f) : void
$fs : \FileSystem
BA_DIRECTORY : int
BA_EXISTS : int
BA_HIDDEN : int
BA_REGULAR : int