public | |
public staticAlo\FileSystem\File | #file( ) Instantiates the class ReturnsAuthor |
public static string | #convertSize(integer$size) Converts a filesize for display Converts a filesize for display Parameters- $size
integer $size The file size in bytes
Returnsstring The file size in its largest form, e.g. 1024 bytes become 1KB;
Author |
public boolean | #append( ) Appends the file contents on the disc Appends the file contents on the disc Returnsboolean
ThrowsAuthor |
protectedAlo\FileSystem\File | #doWrite(string$mode) Performs a write operation Performs a write operation Parameters- $mode
string $mode The write mode - see class constants
ReturnsThrowsAuthor |
protectedAlo\FileSystem\File | #checkParams( ) Checks if the dir and name are set Checks if the dir and name are set ReturnsThrowsAuthor |
public string | #getExtension(integer$depth=1,boolean$onlyThatMember=false) Gets the file extension based on the currently set filename Gets the file extension based on the currently set filename Parameters- $depth
integer $depth The depth to search for, e.g. if the file name is foo.tar.gz, depth=1 would return "gz" while depth=2 would return .tar.gz- $onlyThatMember
boolean $onlyThatMember Only effective if $depth > 1. If FALSE and the extension is tar.gz, will return "tar.gz", if TRUE, will return "tar".
Returnsstring
AuthorUsesself::get_extension()
|
public static string | #getExtensionStatically(string$filename,integer$depth=1,boolean$onlyThatMember=false) Gets the file extension based on name Gets the file extension based on name Parameters- $filename
string $filename The file name- $depth
integer $depth The depth to search for, e.g. if the file name is foo.tar.gz, depth=1 would return "gz" while depth=2 would return .tar.gz- $onlyThatMember
boolean $onlyThatMember Only effective if $depth > 1. If FALSE and the extension is tar.gz, will return "tar.gz", if TRUE, will return "tar".
Returnsstring
Author |
public boolean | #delete( ) Alias for self::unlink() Returnsboolean
AuthorUses |
public boolean | #unlink( ) Deletes the file Returnsboolean
ThrowsAuthorUsed by |
public boolean | #gzipContent(integer$level=9) Gzip-encodes the fetched content Gzip-encodes the fetched content Parameters- $level
integer $level Compression strength (0-9)
Returnsboolean
ThrowsAuthor |
public boolean | #fileExists( ) Checks whether the file exists at the set path Checks whether the file exists at the set path Returnsboolean
ThrowsAuthor |
public boolean | #read( ) Reads the file contents into $this->content Reads the file contents into $this->content Returnsboolean
ThrowsAuthor |
public boolean | #ungzipContent( ) Gzip-decodes the fetched content Gzip-decodes the fetched content Returnsboolean
ThrowsAuthor |
publicAlo\FileSystem\File | #write( ) Overwrites the file contents on the disc Overwrites the file contents on the disc ReturnsThrowsAuthor |
public string | #__toString( ) Returns a string representation of the object data Returns a string representation of the object data Returnsstring
Author |
public string | #getFilePath( ) Returns the file's path in the system Returns the file's path in the system Returnsstring
Author |
publicAlo\FileSystem\File |string | #name(string$name='') If no argument is passed, gets the file name, otherwise sets it If no argument is passed, gets the file name, otherwise sets it Parameters- $name
string $name The name
ReturnsThrowsAuthor |
protectedAlo\FileSystem\File | #updatePath( ) Updates the file path when the directory or file name are changed Updates the file path when the directory or file name are changed ReturnsAuthor |
publicAlo\FileSystem\File |string | #dir(string$dir='') If no argument is passed, gets the directory name, otherwise sets it If no argument is passed, gets the directory name, otherwise sets it Parameters- $dir
string $dir The directory
ReturnsThrowsAuthor |
public array | #scandir( ) Scans the directory for files Scans the directory for files Returnsarray
Author |
publicAlo\FileSystem\File |string | #content(string$content='~none~') If no argument is passed, gets the currently set content, otherwise sets it If no argument is passed, gets the currently set content, otherwise sets it Parameters- $content
string $content Content to set
ReturnsThrowsAuthor |
publicAlo\FileSystem\File | |
publicAlo\FileSystem\File | #addContent(string$c) Appends the file content ParametersReturnsAuthor |
string | M_READ_EXISTING_BEGIN | 'r' | #Open for reading only; place the file pointer at the beginning of the file. Open for reading only; place the file pointer at the beginning of the file. |
string | M_RW_EXISTING_BEGIN | 'r+' | #Open for reading and writing; place the file pointer at the beginning of the file. Open for reading and writing; place the file pointer at the beginning of the file. |
string | M_WRITE_TRUNCATE_BEGIN | 'w' | #Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. |
string | M_RW_TRUNCATE_BEGIN | 'w+' | #Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it. |
string | M_WRITE_END | 'a' | #Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it. Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it. |
string | M_RW_END | 'a+' | #Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. |
string | M_WRITE_NONEXIST_BEGIN | 'x' | #Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. |
string | M_RW_NONEXIST_BEGIN | 'x+' | #Create and open for reading and writing; otherwise it has the same behavior as M_WRITE_NONEXIST_BEGIN Create and open for reading and writing; otherwise it has the same behavior as M_WRITE_NONEXIST_BEGIN See |
string | M_WRITE_BEGIN | 'c' | #Open the file for writing only. If the file does not exist, it is created. If it exists, it is neither truncated (as opposed to M_WRITE_TRUNCATE_BEGIN), nor the call to this function fails (as is the case with M_WRITE_NONEXIST_BEGIN). The file pointer is positioned on the beginning of the file. This may be useful if it's desired to get an advisory lock (see flock()) before attempting to modify the file, as using M_WRITE_NONEXIST_BEGIN could truncate the file before the lock was obtained (if truncation is desired, ftruncate() can be used after the lock is requested). Open the file for writing only. If the file does not exist, it is created. If it exists, it is neither truncated (as opposed to M_WRITE_TRUNCATE_BEGIN), nor the call to this function fails (as is the case with M_WRITE_NONEXIST_BEGIN). The file pointer is positioned on the beginning of the file. This may be useful if it's desired to get an advisory lock (see flock()) before attempting to modify the file, as using M_WRITE_NONEXIST_BEGIN could truncate the file before the lock was obtained (if truncation is desired, ftruncate() can be used after the lock is requested). See |
string | M_RW_BEGIN | 'c+' | #Open the file for reading and writing; otherwise it has the same behavior as M_WRITE_BEGIN. Open the file for reading and writing; otherwise it has the same behavior as M_WRITE_BEGIN. Seeself::M_WRITE_BEGIN;
|