Files Class provided by System to register folders and serve files.
| package |
SYSTEM\FILES |
|---|
delete(string $cat, string $id) : boolean
stringCategory of the File
stringID of the File
booleanReturns true or false or throws an Error.
file_get_contents_chunked(string $file, integer $chunk_size, \SYSTEM\FILES\function $callback) : boolean
stringPath of the File
integerSize of the Chunks
\SYSTEM\FILES\functionCallback function which is called for every chunk
booleanReturns true.
get(string $cat = null, string $id = null, boolean $returnasjson = false) : mixed
stringCategory to query or null
stringFile to query or null
booleanDetermines if you recieve Arrays or JSON results
mixedReturns List of Folders if cat is null, List of Files of id is null or Streams the requested File.
getFolder(string $folder) : array
stringPath to the Folder
arrayReturns a list of Files in the directory.
getURL(string $cat, string $id = null) : string
stringCategory of the File
stringID of the File
stringReturns URL of the File.
put(string $cat, string $id, \SYSTEM\FILES\ressource $contents) : boolean
stringCategory for the File
stringID for the File
\SYSTEM\FILES\ressourceUploaded File Ressource
booleanReturns true or false or throws an Error.
registerFolder(string $path, string $cat) : null
stringPath of the Folder
stringCategory to register that folder to
nullReturns null.
rename(string $cat, string $id, string $newid) : boolean
stringCategory of the File
stringID of the File
stringID of the renamed File
booleanReturns true or false or throws an Error.
folders :