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');
파일 보기 프로젝트 열기: contao/core-bundle 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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