FileSharing
extends FileSharingLib
in package
FileSharing
Tags
Table of Contents
Properties
- $objTemplate : object
- Template object
- $files : array<string|int, mixed>
- $objUrl : object
- $uriParams : array<string|int, mixed>
Methods
- __construct() : mixed
- PHP5 Constructor
- cleanUp() : mixed
- clean up the database and shared files deletes expired files and none existing files
- createCheck() : string
- create check code
- createHash() : string
- create the hash code
- FileSharing() : mixed
- Constructor
- getDeleteLink() : string
- getDownloadLink() : string
- getPage() : string
- get the page
- getTemporaryFilePaths() : array<string|int, mixed>
- isShared() : bool
- sendMail() : mixed
- send a mail to the email with the message
- initUploader() : int
- Init the uploader which is directly included in the webpage
- showDeleteConfirmation() : mixed
- Show the delete confirmation form view
- deleteFile() : bool
- delete a file with hash and check code
- downloadFile() : mixed
- download a file by hash
- getFileList() : mixed
- parse the file list
- getForm() : mixed
- parse the upload form
- getSharedFiles() : array<string|int, mixed>
- get the shared files by upload id
- loadImage() : mixed
- displays the image by hash
- uploadPage() : mixed
- creates the upload page for the frontend
Properties
$objTemplate
Template object
protected
object
$objTemplate
Tags
$files
private
array<string|int, mixed>
$files
uploaded files
$objUrl
private
object
$objUrl
the url object
$uriParams
private
array<string|int, mixed>
$uriParams
the parameters of the uri
Methods
__construct()
PHP5 Constructor
public
__construct(string $pageContent) : mixed
Parameters
- $pageContent : string
-
page content from content manager
cleanUp()
clean up the database and shared files deletes expired files and none existing files
public
static cleanUp() : mixed
Tags
createCheck()
create check code
public
static createCheck(string $hash) : string
Parameters
- $hash : string
-
the hash of the file
Tags
Return values
string —the check code
createHash()
create the hash code
public
static createHash() : string
Tags
Return values
string —the hash code
FileSharing()
Constructor
public
FileSharing(string $pageContent) : mixed
Parameters
- $pageContent : string
-
page content from content manager
getDeleteLink()
public
static getDeleteLink(int $fileId) : string
Parameters
- $fileId : int
Tags
Return values
string —the download link
getDownloadLink()
public
static getDownloadLink(int $fileId) : string
Parameters
- $fileId : int
Tags
Return values
string —the download link
getPage()
get the page
public
getPage() : string
Tags
Return values
string —html code of the page
getTemporaryFilePaths()
public
static getTemporaryFilePaths(int $uploadId) : array<string|int, mixed>
Parameters
- $uploadId : int
-
the upload id of the active upload
Return values
array<string|int, mixed>isShared()
public
static isShared([int $fileId = null ][, mixed $fileSource = null ]) : bool
Parameters
- $fileId : int = null
-
file id
- $fileSource : mixed = null
Tags
Return values
bool —is shared or not
sendMail()
send a mail to the email with the message
public
static sendMail(int $uploadId, string $subject, mixed $emails[, null|string $message = null ]) : mixed
Parameters
- $uploadId : int
-
the upload id
- $subject : string
-
the subject of the mail for the recipient
- $emails : mixed
- $message : null|string = null
-
the message for the recipient
Tags
initUploader()
Init the uploader which is directly included in the webpage
protected
initUploader() : int
Return values
int —the uploader id
showDeleteConfirmation()
Show the delete confirmation form view
protected
showDeleteConfirmation(array<string|int, mixed> $file) : mixed
Parameters
- $file : array<string|int, mixed>
-
file data (source, filename, id, check)
deleteFile()
delete a file with hash and check code
private
deleteFile(string $hash, string $check) : bool
Parameters
- $hash : string
-
the hash code of the file which should be deleted
- $check : string
-
the check code of the file which should be deleted
Return values
bool —delete already successful (true), confirmation form is shown (false)
downloadFile()
download a file by hash
private
downloadFile(string $hash) : mixed
Parameters
- $hash : string
-
the hash code of the file which should be downloaded
Tags
getFileList()
parse the file list
private
getFileList() : mixed
Tags
getForm()
parse the upload form
private
getForm() : mixed
Tags
getSharedFiles()
get the shared files by upload id
private
getSharedFiles(int $uploadId) : array<string|int, mixed>
Parameters
- $uploadId : int
-
the upload id of the upload
Tags
Return values
array<string|int, mixed> —with files of the last upload
loadImage()
displays the image by hash
private
loadImage(string $hash) : mixed
Parameters
- $hash : string
-
the hash of the file whose image should be displayed
Tags
uploadPage()
creates the upload page for the frontend
private
uploadPage() : mixed