PHP Class Contao\Folder

Usage: $folder = new Folder('test'); if (!$folder->isEmpty()) { $folder->purge(); }
Inheritance: extends System
Afficher le fichier Open project: contao/core-bundle Class Usage Examples

Protected Properties

Свойство Type Description
$arrPathinfo array Pathinfo
$objModel FilesModel Files model
$strFolder string Folder name

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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

Method Details

__construct() public méthode

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

__get() public méthode

Return an object property
public __get ( string $strKey ) : mixed
$strKey string The property name
Résultat mixed The property value

chmod() public méthode

Set the folder permissions
public chmod ( string $intChmod ) : boolean
$intChmod string The CHMOD settings
Résultat boolean True if the operation was successful

clear() public méthode

Purge the folder
Deprecation: Deprecated since Contao 4.0, to be removed in Contao 5.0. Use $this->purge() instead.
public clear ( )

copyTo() public méthode

Copy the folder
public copyTo ( string $strNewName ) : boolean
$strNewName string The target path
Résultat boolean True if the operation was successful

delete() public méthode

Delete the folder
public delete ( )

getHash() protected méthode

Return the MD5 hash of the folder
protected getHash ( ) : string
Résultat string The MD5 has

getModel() public méthode

Return the files model
public getModel ( ) : FilesModel
Résultat FilesModel The files model

getPathinfo() protected méthode

Return the path info (binary-safe)
See also: https://github.com/PHPMailer/PHPMailer/blob/master/class.phpmailer.php#L3520
protected getPathinfo ( ) : array
Résultat array The path info

getSize() protected méthode

Return the size of the folder
protected getSize ( ) : integer
Résultat integer The folder size in bytes

isEmpty() public méthode

Return true if the folder is empty
public isEmpty ( ) : boolean
Résultat boolean True if the folder is empty

protect() public méthode

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

purge() public méthode

Purge the folder
public purge ( )

renameTo() public méthode

Rename the folder
public renameTo ( string $strNewName ) : boolean
$strNewName string The new path
Résultat boolean True if the operation was successful

shouldBeSynchronized() public méthode

Check if the folder should be synchronized with the database
Deprecation: Use Dbafs::shouldBeSynchronized() instead
public shouldBeSynchronized ( ) : boolean
Résultat boolean True if the folder needs to be synchronized with the database

unprotect() public méthode

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

Property Details

$arrPathinfo protected_oe property

Pathinfo
protected array $arrPathinfo
Résultat array

$objModel protected_oe property

Files model
protected FilesModel,contao $objModel
Résultat FilesModel

$strFolder protected_oe property

Folder name
protected string $strFolder
Résultat string