Backend for the files module which stores files in a local directory
This is the code documentation for the SproutCMS project
Search documentation |
class FilesBackendDirectoryBackend for the files module which stores files in a local directory
Functions
public absUrlstring $FilesBackendDirectory->absUrl ( int $id ); Returns the absolute URL for a given file id, including domain. public cleanupLocalCopyvoid $FilesBackendDirectory->cleanupLocalCopy ( string $temp_filename ); Remove a local copy of a file public createLocalCopystring $FilesBackendDirectory->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 deleteunknown $FilesBackendDirectory->delete ( mixed $filename ); Delete a file public existsunknown $FilesBackendDirectory->exists ( mixed $filename ); Returns TRUE if the file exists, and FALSE if it does not public getStringunknown $FilesBackendDirectory->getString ( mixed $filename ); Returns file content as a string. Basically the same as file_get_contents public globunknown $FilesBackendDirectory->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 imageSizeunknown $FilesBackendDirectory->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 moveUploadunknown $FilesBackendDirectory->moveUpload ( mixed $src , mixed $filename ); Moves an uploaded file into the repository. Returns TRUE on success, FALSE on failure. public mtimeunknown $FilesBackendDirectory->mtime ( mixed $filename ); Returns the modified time, in unix timestamp format, of the specified file public putExistingunknown $FilesBackendDirectory->putExisting ( mixed $filename , mixed $existing ); Saves file content from an existing file public putStreamunknown $FilesBackendDirectory->putStream ( mixed $filename , mixed $stream ); Saves file content from a stream. Basically just fopen/stream_copy_to_stream/fclose public putStringunknown $FilesBackendDirectory->putString ( mixed $filename , mixed $content ); Saves file content as a string. Basically the same as file_put_contents public readfileunknown $FilesBackendDirectory->readfile ( mixed $filename ); This is the equivalent of the php readfile function public relUrlstring $FilesBackendDirectory->relUrl ( int $id ); Returns the relative URL for a given file. Use for content areas. public resizeUrlstring $FilesBackendDirectory->resizeUrl ( int $id , string $size ); Returns the relative URL for a dynamically resized image. Size formatting is as per File::parseSizeString, e.g. c400x300 public sizeunknown $FilesBackendDirectory->size ( mixed $filename ); Returns the size, in bytes, of the specified file public touchbool $FilesBackendDirectory->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: Tuesday, 15th September, 2026 at 10:26 am |
|