HumHub Documentation (unofficial)

StorageManagerInterface

StorageManagerInterface

Tags
version
1.2
author

Luke

Table of Contents

Methods

delete()  : mixed
Deletes a stored file (-variant)
get()  : string
Returns the complete file path to the stored file (variant).
getVariants()  : array<string|int, mixed>
Get file variants
has()  : bool
Checks if the requested file or version exists.
set()  : mixed
Adds or overwrites the file by given UploadedFile in store.
setByPath()  : mixed
Adds or overwrites the file content by given file path
setContent()  : mixed
Adds or overwrites the file content by given string in store
setFile()  : mixed
Sets the file for this storage manager instance

Methods

delete()

Deletes a stored file (-variant)

public delete([string $variant = null ][, array<string|int, string> $except = [] ]) : mixed

If not variant is given, also all file variants will be deleted

Parameters
$variant : string = null

the variant identifier

$except : array<string|int, string> = []

exclude following variants from deletion

get()

Returns the complete file path to the stored file (variant).

public get([string $variant = null ]) : string
Parameters
$variant : string = null

optional the variant string

Return values
string

the complete file path

getVariants()

Get file variants

public getVariants([array<string|int, string> $except = [] ]) : array<string|int, mixed>
Parameters
$except : array<string|int, string> = []

exclude following variants from deletion

Return values
array<string|int, mixed>

Returns the stored variants of the file

has()

Checks if the requested file or version exists.

public has([string $variant = null ]) : bool
Parameters
$variant : string = null

optional the variant string

Return values
bool

set()

Adds or overwrites the file by given UploadedFile in store.

public set(UploadedFile $file[, string $variant = null ]) : mixed
Parameters
$file : UploadedFile
$variant : string = null

the variant identifier

Tags
see
File::setStoredFile()

Use this method to set a new file.

setByPath()

Adds or overwrites the file content by given file path

public setByPath(string $path[, string $variant = null ]) : mixed
Parameters
$path : string

the new file path

$variant : string = null

the variant identifier

setContent()

Adds or overwrites the file content by given string in store

public setContent(string $content[, string $variant = null ]) : mixed
Parameters
$content : string

the new file data

$variant : string = null

the variant identifier

Tags
see
File::setStoredFileContent()

Use this method to set a new file content.


        
On this page

Search results