PHP Класс Contao\Dbafs

The class provides static methods to add, move, copy and delete resources as well as a method to synchronize the file system and the database. Usage: $file = Dbafs::addResource('files/james-wilson.jpg');
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$arrShouldBeSynchronized array Synchronize the database

Открытые методы

Метод Описание
addResource ( string $strResource, boolean $blnUpdateFolders = true ) : FilesModel Adds a file or folder with its parent folders
copyResource ( string $strSource, string $strDestination ) : FilesModel Copies a file or folder to a new location
deleteResource ( string $strResource ) : null Removes a file or folder
moveResource ( string $strSource, string $strDestination ) : FilesModel Moves a file or folder to a new location
shouldBeSynchronized ( string $strPath ) : boolean Check if the current resource should be synchronized with the database
syncFiles ( ) : string Synchronize the file system with the database
updateFolderHashes ( mixed $varResource ) Update the hashes of all parent folders of a resource

Защищенные методы

Метод Описание
isFileSyncExclude ( string $strPath ) : boolean Check if a file or folder is excluded from synchronization

Описание методов

addResource() публичный статический Метод

Adds a file or folder with its parent folders
public static addResource ( string $strResource, boolean $blnUpdateFolders = true ) : FilesModel
$strResource string The path to the file or folder
$blnUpdateFolders boolean If true, the parent folders will be updated
Результат FilesModel The files model

copyResource() публичный статический Метод

Copies a file or folder to a new location
public static copyResource ( string $strSource, string $strDestination ) : FilesModel
$strSource string The source path
$strDestination string The target path
Результат FilesModel The files model

deleteResource() публичный статический Метод

Removes a file or folder
public static deleteResource ( string $strResource ) : null
$strResource string The path to the file or folder
Результат null Explicitly return null

isFileSyncExclude() защищенный статический Метод

Check if a file or folder is excluded from synchronization
protected static isFileSyncExclude ( string $strPath ) : boolean
$strPath string The relative path
Результат boolean True if the file or folder is excluded from synchronization

moveResource() публичный статический Метод

Moves a file or folder to a new location
public static moveResource ( string $strSource, string $strDestination ) : FilesModel
$strSource string The source path
$strDestination string The target path
Результат FilesModel The files model

shouldBeSynchronized() публичный статический Метод

Check if the current resource should be synchronized with the database
public static shouldBeSynchronized ( string $strPath ) : boolean
$strPath string The relative path
Результат boolean True if the current resource needs to be synchronized with the database

syncFiles() публичный статический Метод

Synchronize the file system with the database
public static syncFiles ( ) : string
Результат string The path to the synchronization log file

updateFolderHashes() публичный статический Метод

Update the hashes of all parent folders of a resource
public static updateFolderHashes ( mixed $varResource )
$varResource mixed A path or an array of paths to update

Описание свойств

$arrShouldBeSynchronized защищенное статическое свойство

Synchronize the database
protected static array $arrShouldBeSynchronized
Результат array