YANA 4 PHP Framework
Docs For Class SecureFileStream
checked reading and writing of file sources
This class adds functionality to write changes on the object to the corresponding file.
Located in /includes/class_securefilestream.php
Object | --InputStream | --SecureInputStream | --SecureFileStream
Name | Type | Description |
---|---|---|
$destFile | string | destination to copy the file to |
$overwrite | bool | setting this to false will prevent existing files from getting overwritten |
$isRecursive | bool | setting this to true will automatically, recursively create directories in the $destFile string, if required |
$mode | int | the access restriction that applies to the copied file, defaults to 0766 |
This will create a copy of this file on the filesystem. Bool(true) will be returned on success and bool(false) on error.
Possible errors are:
If the directory the desination file would be place in does not exist, and $isRecursive is set to true, it will automatically, recursively create the missing directories. Newly created directories will be set to access restriction 0766. Note that this is unlike the default behaviour, where there is no restriction at all.
Note: instead of a file name in parameter $destFile, you may also provide the name of a directory. In this case the file the current name of the file will be used. The destination directory needs to be terminated by a forward-slash '/'.
The $destFile parameter must not be any longer than 512 characters. It must not contain any but alphanumeric characters.
If you copy a PHP file, note that for security reasons the $mode parameter defaults to 0766, which means the file will not be executable in a UNIX environment (while it may be executable on windows platforms) until you set the $mode parameter to 0777.
Returns bool(true) on success and bool(false) on error.
Automatically restarts writing if the file-resource is temporarily not available after waiting for 0.5 seconds.
The process is aborted if it failed 3 times.
Returns the size of the file in bytes (from cached value). If an error occurs, bool(false) is returned.
Name | Type | Description |
---|---|---|
$text | scalar |
A file is "writeable" if:
Name | Type | Description |
---|---|---|
$key | string | (optional) |
This function will return bool(true) on success. It issues an E_USER_NOTICE and returns bool(false) on error.
Inherited From SecureInputStream
Inherited From InputStream
Inherited From Object
Documentation generated on Sun, 11 Mar 2007 15:02:43 +0100 by phpDocumentor 1.3.1