Abstract class for a backend storage for the database-managed files
This is the code documentation for the SproutCMS project
Search documentation |
class FilesBackendAbstract class for a backend storage for the database-managed files
Functions
public absUrlvoid $FilesBackend->absUrl ( mixed $filename ); Returns the public URL for a given file, including domain. public cleanupLocalCopyvoid $FilesBackend->cleanupLocalCopy ( string $temp_filename ); Remove a local copy of a file public createLocalCopystring $FilesBackend->createLocalCopy ( string $filename ); Create a copy of the file in a temporary directory. Don't forget to File::destroy_local_copy($temp_filename) when you're done! public deletevoid $FilesBackend->delete ( mixed $filename ); Delete a file public existsvoid $FilesBackend->exists ( mixed $filename ); Returns TRUE if the file exists, and FALSE if it does not public getStringvoid $FilesBackend->getString ( mixed $filename ); Returns file content as a string. Basically the same as file_get_contents public globvoid $FilesBackend->glob ( mixed $mask ); Returns all files which match the specified mask. I have a feeling this returns other sizes (e.g. .small) as well - which may not be ideal. public imageSizevoid $FilesBackend->imageSize ( mixed $filename ); Returns the size of an image, or false on failure. Output format is the same as getimagesize, but will be at a minimum: [0] => width, [1] => height, [2] => type public moveUploadvoid $FilesBackend->moveUpload ( mixed $src , mixed $filename ); Moves an uploaded file into the repository. Returns TRUE on success, FALSE on failure. public mtimevoid $FilesBackend->mtime ( mixed $filename ); Returns the modified time, in unix timestamp format, of the specified file public putExistingvoid $FilesBackend->putExisting ( mixed $filename , mixed $existing ); Saves file content from an existing file public putStreamvoid $FilesBackend->putStream ( mixed $filename , mixed $stream ); Saves file content from a stream. Basically just fopen/stream_copy_to_stream/fclose public putStringvoid $FilesBackend->putString ( mixed $filename , mixed $content ); Saves file content as a string. Basically the same as file_put_contents public readfilevoid $FilesBackend->readfile ( mixed $filename ); This is the equivalent of the php readfile function public relUrlvoid $FilesBackend->relUrl ( mixed $filename ); Returns the relative public URL for a given file. Doesn't contain ROOT/ or domain. Use for content areas. public resizeUrlvoid $FilesBackend->resizeUrl ( mixed $filename , mixed $size ); Returns the URL for a resized image. Does not include domain. Size should be 'rWIDTHxHEIGHT' or 'cWIDTHxHEIGHT'. public sizevoid $FilesBackend->size ( mixed $filename ); Returns the size, in bytes, of the specified file public touchvoid $FilesBackend->touch ( mixed $filename ); Sets access and modification time of file |
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Wednesday, 5th August, 2026 at 03:31 pm |
|