-
Docs
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Exception
- Backend
-
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Contracts
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
Controllers
-
Database
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
router
-
template
-
theme
-
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Cookie
-
Middleware
-
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Cms
- Classes
- MediaLibrary
Cms\Classes\MediaLibrary
Source: ~/modules/cms/classes/MediaLibrary.php
Extends:
Provides abstraction level for the Media Library operations. Implements the library caching features and security checks.
Protected properties
There are no protected properties in the class.
Show inherited protected properties
Inherited protected properties
- protected string $cacheKey - defined in System\Classes\MediaLibrary. Cache key.
- protected string $storagePath - defined in System\Classes\MediaLibrary. Relative or absolute URL of the Library root folder.
- protected string $storageFolder - defined in System\Classes\MediaLibrary. The root Library folder path.
- protected mixed $storageDisk - defined in System\Classes\MediaLibrary. A reference to the Media Library disk.
- protected array $ignoreNames - defined in System\Classes\MediaLibrary. Contains a list of files and directories to ignore.
- protected array $ignorePatterns - defined in System\Classes\MediaLibrary. Contains a list of regex patterns to ignore in files and directories.
- protected int $storageFolderNameLength - defined in System\Classes\MediaLibrary. Cache for the storage folder name length.
- protected static $instance - defined in System\Classes\MediaLibrary.
Public methods
Inherited public methods
- public void __clone() - defined in System\Classes\MediaLibrary.
- public void __wakeup() - defined in System\Classes\MediaLibrary.
- public boolean copyFolder(string $originalPath, string $newPath) - defined in System\Classes\MediaLibrary. Copies a folder.
- public void deleteFiles(array $paths) - defined in System\Classes\MediaLibrary. Deletes a file from the Library.
- public void deleteFolder(string $path) - defined in System\Classes\MediaLibrary. Deletes a folder from the Library.
- public boolean exists(string $path) - defined in System\Classes\MediaLibrary. Determines if a file with the specified path exists in the library.
- public array findFiles(string $searchTerm, mixed $sortBy='title', string $filter=NULL) - defined in System\Classes\MediaLibrary. Finds files in the Library.
- public boolean folderExists(string $path) - defined in System\Classes\MediaLibrary. Determines if a folder with the specified path exists in the library.
- public static void forgetInstance() - defined in System\Classes\MediaLibrary. Forget this singleton's instance if it exists.
- public string get(string $path) - defined in System\Classes\MediaLibrary. Returns a file contents.
- public string getCacheKey() - defined in System\Classes\MediaLibrary. Get the cache key.
- public string getPathUrl(string $path) - defined in System\Classes\MediaLibrary. Returns a public file URL.
- public static void instance() - defined in System\Classes\MediaLibrary. Create a new instance of this singleton.
- public array listAllDirectories(array $exclude=array()) - defined in System\Classes\MediaLibrary. Returns a list of all directories in the Library, optionally excluding some of them.
- public array listFolderContents(string $folder='/', mixed $sortBy='title', string $filter=NULL, boolean $ignoreFolders=false) - defined in System\Classes\MediaLibrary. Returns a list of folders and files in a Library folder.
- public boolean makeFolder(string $path) - defined in System\Classes\MediaLibrary. Creates a folder.
- public boolean moveFile(string $oldPath, string $newPath, $isRename=false) - defined in System\Classes\MediaLibrary. Moves a file to another location.
- public boolean moveFolder(string $originalPath, string $newPath) - defined in System\Classes\MediaLibrary. Moves a folder.
- public boolean put(string $path, string $contents) - defined in System\Classes\MediaLibrary. Puts a file to the library.
- public void resetCache() - defined in System\Classes\MediaLibrary. Resets the Library cache.
- public void setCacheKey(string $cacheKey) - defined in System\Classes\MediaLibrary. Set the cache key.
- public static string url(string $file) - defined in System\Classes\MediaLibrary. Helper that makes a URL for a media file.
- public static string validatePath(string $path, boolean $normalizeOnly=false) - defined in System\Classes\MediaLibrary. Checks if file path doesn't contain any substrings that would pose a security threat.
Protected methods
protected void init()
Initialize this singleton.
Show inherited protected methods
Inherited protected methods
- protected void __construct() - defined in System\Classes\MediaLibrary. Constructor.
- protected void filterItemList(array &$itemList, string $filter) - defined in System\Classes\MediaLibrary. Filters item list by file type.
- protected void generateRandomTmpFolderName($location) - defined in System\Classes\MediaLibrary.
- protected integer getFolderItemCount(string $path) - defined in System\Classes\MediaLibrary. Returns a number of items on a folder.
- protected string getMediaPath(string $path) - defined in System\Classes\MediaLibrary. Returns a file or folder path with the prefixed storage folder.
- protected string getMediaRelativePath(string $path) - defined in System\Classes\MediaLibrary. Returns path relative to the Library root folder.
- protected mixed getStorageDisk() - defined in System\Classes\MediaLibrary. Initializes and returns the Media Library disk.
- protected mixed initLibraryItem(string $path, string $itemType) - defined in System\Classes\MediaLibrary. Initializes a library item from a path and item type.
- protected boolean isVisible(string $path) - defined in System\Classes\MediaLibrary. Determines if the path should be visible (not ignored).
- protected boolean pathMatchesSearch(string $path, array $words) - defined in System\Classes\MediaLibrary. Determines if file path contains all words form the search term.
- protected array scanFolderContents(string $fullFolderPath) - defined in System\Classes\MediaLibrary. Fetches the contents of a folder from the Library.
- protected void sortItemList(array &$itemList, mixed $sortSettings) - defined in System\Classes\MediaLibrary. Sorts the item list by title, size or last modified date.