-
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- EditorExtension
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
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
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Editor
-
Behaviors
-
Classes
-
Controllers
-
VueComponents
- ServiceProvider
-
-
Media
-
Classes
-
Controllers
-
FormWidgets
-
Twig
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
OctoberUtil
- ComposerScript
- OctoberDown
- OctoberFresh
- OctoberMigrate
- OctoberMirror
- OctoberPasswd
- OctoberUp
- OctoberUpdate
- OctoberUtil
- PluginCheck
- PluginDisable
- PluginEnable
- PluginInstall
- PluginList
- PluginRefresh
- PluginRemove
- ProjectSet
- ProjectSync
- ThemeCheck
- ThemeInstall
- ThemeList
- ThemeRemove
- ThemeSync
- ThemeUse
-
-
Controllers
-
Database
-
Facades
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
-
Widgets
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
resizer
-
router
-
template
-
theme
-
-
exception
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
auth
-
form
-
relation
-
/docs/api/model/relation/add
-
/docs/api/model/relation/associate
- attach
-
/docs/api/model/relation/beforeadd
-
/docs/api/model/relation/beforeassociate
- beforeAttach
- beforeDetach
-
/docs/api/model/relation/beforedissociate
-
/docs/api/model/relation/beforeremove
- detach
-
/docs/api/model/relation/dissociate
-
/docs/api/model/relation/remove
-
- afterBoot
- afterCreate
- afterDelete
- afterFetch
- afterRestore
- afterSave
- afterUpdate
- afterValidate
- beforeCreate
- beforeDelete
- beforeFetch
- beforeGetAttribute
- beforeRestore
- beforeSave
- beforeSetAttribute
- beforeUpdate
- beforeValidate
- getAttribute
- saveInternal
- setAttribute
-
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
resizer
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Assetic
-
Asset
-
Cache
-
Exception
-
Factory
-
Filter
- BaseCssFilter
- CallablesFilter
- CssCacheBustingFilter
- CssImportFilter
- CssMinFilter
- CssRewriteFilter
- FilterCollection
- JavascriptImporter
- JSMinFilter
- JSMinPlusFilter
- JSqueezeFilter
- LessCompiler
- LessphpFilter
- MinifyCssCompressorFilter
- PackagerFilter
- PackerFilter
- ScssCompiler
- ScssphpFilter
- StylesheetMinify
-
Util
- README
- AssetManager
- AssetWriter
- FilterManager
-
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- MigrationServiceProvider
- Model
- ModelBehavior
- ModelException
- MorphPivot
- 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
-
Parsedown
-
Syntax
- Bracket
- Ini
- Markdown
- MarkdownData
- ParseServiceProvider
- Twig
- Yaml
-
-
Process
-
Resize
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- System
- Classes
- MediaLibrary
System\Classes\MediaLibrary
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 Media\Classes\MediaLibrary. Cache key.
- protected string $storagePath - defined in Media\Classes\MediaLibrary. Relative or absolute URL of the Library root folder.
- protected string $storageFolder - defined in Media\Classes\MediaLibrary. The root Library folder path.
- protected mixed $storageDisk - defined in Media\Classes\MediaLibrary. A reference to the Media Library disk.
- protected array $ignoreNames - defined in Media\Classes\MediaLibrary. Contains a list of files and directories to ignore.
- protected array $ignorePatterns - defined in Media\Classes\MediaLibrary. Contains a list of regex patterns to ignore in files and directories.
- protected int $storageFolderNameLength - defined in Media\Classes\MediaLibrary. Cache for the storage folder name length.
- protected static $instance - defined in Media\Classes\MediaLibrary.
Public methods
Inherited public methods
- public void __clone() - defined in Media\Classes\MediaLibrary.
- public void __wakeup() - defined in Media\Classes\MediaLibrary.
- public boolean copyFolder(string $originalPath, string $newPath) - defined in Media\Classes\MediaLibrary. Copies a folder.
- public void deleteFiles(array $paths) - defined in Media\Classes\MediaLibrary. Deletes a file from the Library.
- public void deleteFolder(string $path) - defined in Media\Classes\MediaLibrary. Deletes a folder from the Library.
- public boolean exists(string $path) - defined in Media\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 Media\Classes\MediaLibrary. Finds files in the Library.
- public boolean folderExists(string $path) - defined in Media\Classes\MediaLibrary. Determines if a folder with the specified path exists in the library.
- public static void forgetInstance() - defined in Media\Classes\MediaLibrary. Forget this singleton's instance if it exists.
- public string get(string $path) - defined in Media\Classes\MediaLibrary. Returns a file contents.
- public string getCacheKey() - defined in Media\Classes\MediaLibrary. Get the cache key.
- public string getPathUrl(string $path) - defined in Media\Classes\MediaLibrary. Returns a public file URL.
- public static void instance() - defined in Media\Classes\MediaLibrary. Create a new instance of this singleton.
- public array listAllDirectories(array $exclude=array()) - defined in Media\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 Media\Classes\MediaLibrary. Returns a list of folders and files in a Library folder.
- public boolean makeFolder(string $path) - defined in Media\Classes\MediaLibrary. Creates a folder.
- public boolean moveFile(string $oldPath, string $newPath, $isRename=false) - defined in Media\Classes\MediaLibrary. Moves a file to another location.
- public boolean moveFolder(string $originalPath, string $newPath) - defined in Media\Classes\MediaLibrary. Moves a folder.
- public boolean put(string $path, string $contents) - defined in Media\Classes\MediaLibrary. Puts a file to the library.
- public void resetCache() - defined in Media\Classes\MediaLibrary. Resets the Library cache.
- public void setCacheKey(string $cacheKey) - defined in Media\Classes\MediaLibrary. Set the cache key.
- public static string url(string $file) - defined in Media\Classes\MediaLibrary. Helper that makes a URL for a media file.
- public static string validatePath(string $path, boolean $normalizeOnly=false) - defined in Media\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 Media\Classes\MediaLibrary. Constructor.
- protected void filterItemList(array &$itemList, string $filter) - defined in Media\Classes\MediaLibrary. Filters item list by file type.
- protected void generateRandomTmpFolderName($location) - defined in Media\Classes\MediaLibrary.
- protected integer getFolderItemCount(string $path) - defined in Media\Classes\MediaLibrary. Returns a number of items on a folder.
- protected string getMediaPath(string $path) - defined in Media\Classes\MediaLibrary. Returns a file or folder path with the prefixed storage folder.
- protected string getMediaRelativePath(string $path) - defined in Media\Classes\MediaLibrary. Returns path relative to the Library root folder.
- protected mixed getStorageDisk() - defined in Media\Classes\MediaLibrary. Initializes and returns the Media Library disk.
- protected mixed initLibraryItem(string $path, string $itemType) - defined in Media\Classes\MediaLibrary. Initializes a library item from a path and item type.
- protected boolean isVisible(string $path) - defined in Media\Classes\MediaLibrary. Determines if the path should be visible (not ignored).
- protected boolean pathMatchesSearch(string $path, array $words) - defined in Media\Classes\MediaLibrary. Determines if file path contains all words form the search term.
- protected array scanFolderContents(string $fullFolderPath) - defined in Media\Classes\MediaLibrary. Fetches the contents of a folder from the Library.
- protected void sortItemList(array &$itemList, mixed $sortSettings) - defined in Media\Classes\MediaLibrary. Sorts the item list by title, size or last modified date.