SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class FilesBackendDirectory

Backend for the files module which stores files in a local directory

Functions

NameVisibilityDescription
absUrlpublicReturns the absolute URL for a given file id, including domain.
cleanupLocalCopypublicRemove a local copy of a file
createLocalCopypublicCreate a copy of the file in a temporary directory.
deletepublicDelete a file
existspublicReturns TRUE if the file exists, and FALSE if it does not
getStringpublicReturns file content as a string. Basically the same as file_get_contents
globpublicReturns all files which match the specified mask.
imageSizepublicReturns the size of an image, or false on failure.
moveUploadpublicMoves an uploaded file into the repository.
mtimepublicReturns the modified time, in unix timestamp format, of the specified file
putExistingpublicSaves file content from an existing file
putStreampublicSaves file content from a stream. Basically just fopen/stream_copy_to_stream/fclose
putStringpublicSaves file content as a string. Basically the same as file_put_contents
readfilepublicThis is the equivalent of the php readfile function
relUrlpublicReturns the relative URL for a given file.
resizeUrlpublicReturns the relative URL for a dynamically resized image.
sizepublicReturns the size, in bytes, of the specified file
touchpublicSets access and modification time of file

public absUrl

string $FilesBackendDirectory->absUrl ( int $id );

Returns the absolute URL for a given file id, including domain.

public cleanupLocalCopy

void $FilesBackendDirectory->cleanupLocalCopy ( string $temp_filename );

Remove a local copy of a file

public createLocalCopy

string $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 delete

unknown $FilesBackendDirectory->delete ( mixed $filename );

Delete a file

public exists

unknown $FilesBackendDirectory->exists ( mixed $filename );

Returns TRUE if the file exists, and FALSE if it does not

public getString

unknown $FilesBackendDirectory->getString ( mixed $filename );

Returns file content as a string. Basically the same as file_get_contents

public glob

unknown $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 imageSize

unknown $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 moveUpload

unknown $FilesBackendDirectory->moveUpload ( mixed $src , mixed $filename );

Moves an uploaded file into the repository.
Returns TRUE on success, FALSE on failure.

public mtime

unknown $FilesBackendDirectory->mtime ( mixed $filename );

Returns the modified time, in unix timestamp format, of the specified file

public putExisting

unknown $FilesBackendDirectory->putExisting ( mixed $filename , mixed $existing );

Saves file content from an existing file

public putStream

unknown $FilesBackendDirectory->putStream ( mixed $filename , mixed $stream );

Saves file content from a stream. Basically just fopen/stream_copy_to_stream/fclose

public putString

unknown $FilesBackendDirectory->putString ( mixed $filename , mixed $content );

Saves file content as a string. Basically the same as file_put_contents

public readfile

unknown $FilesBackendDirectory->readfile ( mixed $filename );

This is the equivalent of the php readfile function

public relUrl

string $FilesBackendDirectory->relUrl ( int $id );

Returns the relative URL for a given file.

Use for content areas.

public resizeUrl

string $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 size

unknown $FilesBackendDirectory->size ( mixed $filename );

Returns the size, in bytes, of the specified file

public touch

bool $FilesBackendDirectory->touch ( mixed $filename );

Sets access and modification time of file