class vB_Library_Filedata extends vB_Library

Class to manage FileData. At the moment the only thing it does is to move filedata between the database and filesystem.

Traits

Constants

ATTACH_AS_DB

Supported types of storage

These should match the legacy defines at the top of core/includes/functions_file.php

ATTACH_AS_FILES_OLD

ATTACH_AS_FILES_NEW

Properties

static protected $instance from vB_Library
protected string $storage Storage Type
protected $filePath

Methods

__sleep()

No description

__wakeup()

No description

__construct()

No description

static vB_PageCache
instance($class)

Returns singleton instance of self.

static 
getLibraryClassNameInternal($controller)

No description

static 
getContentInstance($contenttypeid)

No description

static 
clearCache()

No description

array
moveToFs($filedata = false, $filedataid = false, $resize = array())

moves one record from the database to the filesystem

array
moveToDb($filedata = false, $filedataid = false, $resize = array())

moves one record from the filesystem to the database

cleanFileParams($filedata = false, $filedataid = false)

No description

string
fetchAttachmentPath(int $userid, int $storageType)

Get the path for a user and make sure it exists

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 44
protected __construct()

in vB_Library at line 35
static vB_PageCache instance($class)

Returns singleton instance of self.

Parameters

$class

Return Value

vB_PageCache
  • Reference to singleton instance of the cache handler

in vB_Library at line 52
static protected getLibraryClassNameInternal($controller)

Parameters

$controller

in vB_Library at line 91
static getContentInstance($contenttypeid)

Parameters

$contenttypeid

in vB_Library at line 99
static clearCache()

at line 61
array moveToFs($filedata = false, $filedataid = false, $resize = array())

moves one record from the database to the filesystem

Parameters

$filedata
$filedataid
$resize

Return Value

array has either 'success' or 'error'

at line 112
array moveToDb($filedata = false, $filedataid = false, $resize = array())

moves one record from the filesystem to the database

Parameters

$filedata
$filedataid
$resize

Return Value

array has either 'success' or 'error'

at line 182
protected cleanFileParams($filedata = false, $filedataid = false)

Parameters

$filedata
$filedataid

at line 213
string fetchAttachmentPath(int $userid, int $storageType)

Get the path for a user and make sure it exists

Parameters

int $userid
int $storageType Attachment storage type to use to generate the path

Return Value

string path to user's storage.