PHP Class Bolt\Filesystem\FilePermissions

Author: Benjamin Georgeault ([email protected])
Show file Open project: bolt/bolt Class Usage Examples

Protected Properties

Property Type Description
$allowed Regex list represented editable resources.
$allowedPrefixes List of Filesystem prefixes that are editable.
$blocked Regex list represented resources forbidden for edition.
$config Bolt\Config
$maxUploadSize Maximum upload size allowed by PHP, in bytes.

Public Methods

Method Description
__construct ( Config $config ) Constructor, initialize filters rules.
allowedUpload ( string $originalFilename ) : boolean Checks if a given file is acceptable for upload.
authorized ( string $prefix, string $path ) : boolean Check if you can do something with the given file or directory.
getAllowedUploadExtensions ( ) : array Get the array of configured acceptable file extensions.
getMaxUploadSize ( ) : double Get the maximum upload size the server is configured to accept.
getMaxUploadSizeNice ( ) : string Get the max upload value in a formatted string.

Method Details

__construct() public method

Constructor, initialize filters rules.
public __construct ( Config $config )
$config Bolt\Config

allowedUpload() public method

Checks if a given file is acceptable for upload.
public allowedUpload ( string $originalFilename ) : boolean
$originalFilename string
return boolean

authorized() public method

Check if you can do something with the given file or directory.
public authorized ( string $prefix, string $path ) : boolean
$prefix string
$path string
return boolean

getAllowedUploadExtensions() public method

Get the array of configured acceptable file extensions.
public getAllowedUploadExtensions ( ) : array
return array

getMaxUploadSize() public method

Get the maximum upload size the server is configured to accept.
public getMaxUploadSize ( ) : double
return double

getMaxUploadSizeNice() public method

Get the max upload value in a formatted string.
public getMaxUploadSizeNice ( ) : string
return string

Property Details

$allowed protected property

Regex list represented editable resources.
protected $allowed

$allowedPrefixes protected property

List of Filesystem prefixes that are editable.
protected $allowedPrefixes

$blocked protected property

Regex list represented resources forbidden for edition.
protected $blocked

$config protected property

protected Config,Bolt $config
return Bolt\Config

$maxUploadSize protected property

Maximum upload size allowed by PHP, in bytes.
protected $maxUploadSize