Documentation

FileSharing extends FileSharingLib

FileSharing

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

CLOUDREXX Development Team info@cloudrexx.com

subpackage

module_filesharing

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
getDeleteLink()  : string
getDownloadLink()  : string
getPage()  : string
get the page
getTemporaryFilePaths()  : array<string|int, mixed>
isShared()  : bool
sendMailById()  : mixed
Send an email about a shared file
sendMailByUploadId()  : mixed
Send an email about the newly uploaded files
getLockName()  : string
Get name of database lock to be used for an upload ID.
getUploadLock()  : bool
Acquire a database lock for an upload.
initUploader()  : int
Init the uploader which is directly included in the webpage
releaseUploadLock()  : void
sendMail()  : mixed
Send an email about shared files
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
access

private

$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
static

createCheck()

create check code

public static createCheck(string $hash) : string
Parameters
$hash : string

the hash of the file

Tags
static
Return values
string

the check code

createHash()

create the hash code

public static createHash() : string
Tags
static
Return values
string

the hash code

public static getDeleteLink(int $fileId) : string
Parameters
$fileId : int
Tags
static
Return values
string

the download link

public static getDownloadLink(int $fileId) : string
Parameters
$fileId : int
Tags
static
Return values
string

the download link

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
static
Return values
bool

is shared or not

sendMailById()

Send an email about a shared file

public static sendMailById(int $id, string $subject, array<string|int, mixed> $emails[, string $message = '' ]) : mixed
Parameters
$id : int

The ID of a shared file

$subject : string

The subject of the mail

$emails : array<string|int, mixed>
$message : string = ''

The message for the recipient

sendMailByUploadId()

Send an email about the newly uploaded files

public static sendMailByUploadId(string $uploadId, string $subject, array<string|int, mixed> $emails[, string $message = '' ]) : mixed
Parameters
$uploadId : string

The upload ID (from Uploader::generateId())

$subject : string

The subject of the mail

$emails : array<string|int, mixed>
$message : string = ''

The message for the recipient

getLockName()

Get name of database lock to be used for an upload ID.

protected getLockName(string $uploadId) : string
Parameters
$uploadId : string

ID of upload to get the name of the lock.

Tags
todo

This should be merged together with Session::getLockName() and put into Db

Return values
string

Name of lock to be used in database.

getUploadLock()

Acquire a database lock for an upload.

protected getUploadLock(string $uploadId) : bool
Parameters
$uploadId : string
Tags
todo

This should be merged together with Session::getLock() and put into Db

Return values
bool

Whether acquiring the lock was successful.

initUploader()

Init the uploader which is directly included in the webpage

protected initUploader() : int
Return values
int

the uploader id

releaseUploadLock()

protected releaseUploadLock(string $uploadId) : void
Parameters
$uploadId : string

ID of upload to release the database lock of.

Tags
todo

This should be merged together with Session::releaseLock() and put into Db

sendMail()

Send an email about shared files

protected static sendMail(array<string|int, mixed> $files, string $subject, array<string|int, mixed> $emails, string $message) : mixed
Parameters
$files : array<string|int, mixed>

IDs of shared files to list in the email

$subject : string

The subject of the mail for the recipient

$emails : array<string|int, mixed>
$message : string

The message for the recipient

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
throws
FileSharingException

getFileList()

parse the file list

private getFileList() : mixed
Tags
access

private

getForm()

parse the upload form

private getForm() : mixed
Tags
access

private

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
access

private

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
access

private

uploadPage()

creates the upload page for the frontend

private uploadPage() : mixed

        
On this page

Search results