class MediaLibrary

MediaLibrary Class

Traits

Singleton trait.

Properties

static protected $instance from  Singleton
static protected $cacheKey
protected $storageDisk
protected $storagePath
protected $storageFolder
protected $ignoreNames
protected $ignorePatterns
protected $storageFolderNameLength
protected $config

Methods

static 
instance()

Create a new instance of this singleton.

static 
forgetInstance()

Forget this singleton's instance if it exists

__construct()

Constructor.

initialize()

No description

__clone()

No description

__wakeup()

No description

listFolderContents($fullPath, $methodName, $recursive = false)

No description

listAllFolders($path = null, array $exclude = [])

No description

listFolders($path = null, array $exclude = [], $recursive = false)

No description

fetchFiles($path, $sortBy = [], $options = null)

No description

get($path, $stream = false)

No description

put($path, $contents)

No description

makeFolder($name)

No description

copyFile($srcPath, $destPath)

No description

moveFile($path, $newPath)

No description

rename($path, $newPath)

No description

deleteFiles($paths)

No description

deleteFolder($path)

No description

exists($path)

No description

validatePath($path, $stripTrailingSlash = false)

No description

getMediaUrl($path)

No description

getMediaPath($path)

No description

getMediaThumb($path, $options)

No description

getDefaultThumbPath($thumbPath, $default = null)

No description

getMediaRelativePath($path)

No description

getConfig($key = null, $default = null)

No description

getAllowedExtensions()

No description

isAllowedExtension($filename)

No description

resetCache()

No description

folderSize($path)

No description

scanFolderContents($fullPath, $methodName, $recursive = false)

No description

isVisible($path)

No description

sortFiles($files, $sortBy)

No description

filterFiles($files, $filterBy)

No description

searchFiles($files, $filter)

No description

getThumbDirectory()

No description

getStorageDisk()

No description

initMediaItem($path, $itemType)

No description

pathMatchesSearch($path, $words)

No description

getMediaThumbFile($filePath, $options)

No description

ensureDirectoryExists($path)

No description

Details

in Singleton at line 18
final static instance()

Create a new instance of this singleton.

in Singleton at line 28
final static forgetInstance()

Forget this singleton's instance if it exists

in Singleton at line 36
final protected __construct()

Constructor.

at line 38
initialize()

No description

in Singleton at line 48
__clone()

No description

in Singleton at line 53
__wakeup()

No description

at line 55
listFolderContents($fullPath, $methodName, $recursive = false)

No description

Parameters

$fullPath
$methodName
$recursive

at line 83
listAllFolders($path = null, array $exclude = [])

No description

Parameters

$path
array $exclude

at line 88
listFolders($path = null, array $exclude = [], $recursive = false)

No description

Parameters

$path
array $exclude
$recursive

at line 118
fetchFiles($path, $sortBy = [], $options = null)

No description

Parameters

$path
$sortBy
$options

at line 138
get($path, $stream = false)

No description

Parameters

$path
$stream

at line 150
put($path, $contents)

No description

Parameters

$path
$contents

at line 158
makeFolder($name)

No description

Parameters

$name

at line 167
copyFile($srcPath, $destPath)

No description

Parameters

$srcPath
$destPath

at line 178
moveFile($path, $newPath)

No description

Parameters

$path
$newPath

at line 189
rename($path, $newPath)

No description

Parameters

$path
$newPath

at line 200
deleteFiles($paths)

No description

Parameters

$paths

at line 211
deleteFolder($path)

No description

Parameters

$path

at line 220
exists($path)

No description

Parameters

$path

at line 228
validatePath($path, $stripTrailingSlash = false)

No description

Parameters

$path
$stripTrailingSlash

at line 236
getMediaUrl($path)

No description

Parameters

$path

at line 246
getMediaPath($path)

No description

Parameters

$path

at line 254
getMediaThumb($path, $options)

No description

Parameters

$path
$options

at line 296
getDefaultThumbPath($thumbPath, $default = null)

No description

Parameters

$thumbPath
$default

at line 306
getMediaRelativePath($path)

No description

Parameters

$path

at line 316
getConfig($key = null, $default = null)

No description

Parameters

$key
$default

at line 324
getAllowedExtensions()

No description

at line 329
isAllowedExtension($filename)

No description

Parameters

$filename

at line 340
resetCache()

No description

at line 345
folderSize($path)

No description

Parameters

$path

at line 360
protected scanFolderContents($fullPath, $methodName, $recursive = false)

No description

Parameters

$fullPath
$methodName
$recursive

at line 379
protected isVisible($path)

No description

Parameters

$path

at line 394
protected sortFiles($files, $sortBy)

No description

Parameters

$files
$sortBy

at line 420
protected filterFiles($files, $filterBy)

No description

Parameters

$files
$filterBy

at line 436
protected searchFiles($files, $filter)

No description

Parameters

$files
$filter

at line 450
protected getThumbDirectory()

No description

at line 455
protected getStorageDisk()

No description

at line 465
protected initMediaItem($path, $itemType)

No description

Parameters

$path
$itemType

at line 485
protected pathMatchesSearch($path, $words)

No description

Parameters

$path
$words

at line 501
protected getMediaThumbFile($filePath, $options)

No description

Parameters

$filePath
$options

at line 516
protected ensureDirectoryExists($path)

No description

Parameters

$path