PHP Класс Contao\Folder

Usage: $folder = new Folder('test'); if (!$folder->isEmpty()) { $folder->purge(); }
Наследование: extends System
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$arrPathinfo array Pathinfo
$objModel FilesModel Files model
$strFolder string Folder name

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

Метод Описание
__construct ( string $strFolder ) Check whether the folder exists
__get ( string $strKey ) : mixed Return an object property
chmod ( string $intChmod ) : boolean Set the folder permissions
clear ( ) Purge the folder
copyTo ( string $strNewName ) : boolean Copy the folder
delete ( ) Delete the folder
getModel ( ) : FilesModel Return the files model
isEmpty ( ) : boolean Return true if the folder is empty
protect ( ) Protect the folder by removing the .public file
purge ( ) Purge the folder
renameTo ( string $strNewName ) : boolean Rename the folder
shouldBeSynchronized ( ) : boolean Check if the folder should be synchronized with the database
unprotect ( ) Unprotect the folder by adding a .public file

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

Метод Описание
getHash ( ) : string Return the MD5 hash of the folder
getPathinfo ( ) : array Return the path info (binary-safe)
getSize ( ) : integer Return the size of the folder

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

__construct() публичный Метод

Check whether the folder exists
public __construct ( string $strFolder )
$strFolder string The folder path

__get() публичный Метод

Return an object property
public __get ( string $strKey ) : mixed
$strKey string The property name
Результат mixed The property value

chmod() публичный Метод

Set the folder permissions
public chmod ( string $intChmod ) : boolean
$intChmod string The CHMOD settings
Результат boolean True if the operation was successful

clear() публичный Метод

Purge the folder
Устаревший: Deprecated since Contao 4.0, to be removed in Contao 5.0. Use $this->purge() instead.
public clear ( )

copyTo() публичный Метод

Copy the folder
public copyTo ( string $strNewName ) : boolean
$strNewName string The target path
Результат boolean True if the operation was successful

delete() публичный Метод

Delete the folder
public delete ( )

getHash() защищенный Метод

Return the MD5 hash of the folder
protected getHash ( ) : string
Результат string The MD5 has

getModel() публичный Метод

Return the files model
public getModel ( ) : FilesModel
Результат FilesModel The files model

getPathinfo() защищенный Метод

Return the path info (binary-safe)
См. также: https://github.com/PHPMailer/PHPMailer/blob/master/class.phpmailer.php#L3520
protected getPathinfo ( ) : array
Результат array The path info

getSize() защищенный Метод

Return the size of the folder
protected getSize ( ) : integer
Результат integer The folder size in bytes

isEmpty() публичный Метод

Return true if the folder is empty
public isEmpty ( ) : boolean
Результат boolean True if the folder is empty

protect() публичный Метод

Protect the folder by removing the .public file
public protect ( )

purge() публичный Метод

Purge the folder
public purge ( )

renameTo() публичный Метод

Rename the folder
public renameTo ( string $strNewName ) : boolean
$strNewName string The new path
Результат boolean True if the operation was successful

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

Check if the folder should be synchronized with the database
Устаревший: Use Dbafs::shouldBeSynchronized() instead
public shouldBeSynchronized ( ) : boolean
Результат boolean True if the folder needs to be synchronized with the database

unprotect() публичный Метод

Unprotect the folder by adding a .public file
public unprotect ( )

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

$arrPathinfo защищенное свойство

Pathinfo
protected array $arrPathinfo
Результат array

$objModel защищенное свойство

Files model
protected FilesModel,contao $objModel
Результат FilesModel

$strFolder защищенное свойство

Folder name
protected string $strFolder
Результат string