Configuration
in package
Configuration
parses configuration file, ensures default values present
Table of Contents
- $_configuration : array<string|int, mixed>
- parsed configuration
- $_defaults : array<string|int, mixed>
- default configuration
- __construct() : mixed
- parse configuration file and ensure default configuration values are present
- get() : array<string|int, mixed>
- get configuration as array
- getDefaults() : array<string|int, mixed>
- get default configuration as array
- getKey() : mixed
- get a key from the configuration, typically the main section or all keys
- getSection() : mixed
- get a section from the configuration, must exist
Properties
$_configuration
parsed configuration
private
array<string|int, mixed>
$_configuration
$_defaults
default configuration
private
static array<string|int, mixed>
$_defaults
= array('main' => array('name' => 'PrivateBin', 'basepath' => '', 'discussion' => true, 'opendiscussion' => false, 'password' => true, 'fileupload' => false, 'burnafterreadingselected' => false, 'defaultformatter' => 'plaintext', 'syntaxhighlightingtheme' => '', 'sizelimit' => 10485760, 'template' => 'bootstrap', 'info' => 'More information on the <a href=\'https://privatebin.info/\'>project page</a>.', 'notice' => '', 'languageselection' => false, 'languagedefault' => '', 'urlshortener' => '', 'qrcode' => true, 'icon' => 'identicon', 'cspheader' => 'default-src \'none\'; base-uri \'self\'; form-action \'none\'; manifest-src \'self\'; connect-src * blob:; script-src \'self\' \'unsafe-eval\'; style-src \'self\'; font-src \'self\'; frame-ancestors \'none\'; img-src \'self\' data: blob:; media-src blob:; object-src blob:; sandbox allow-same-origin allow-scripts allow-forms allow-popups allow-modals allow-downloads', 'zerobincompatibility' => false, 'httpwarning' => true, 'compression' => 'zlib'), 'expire' => array('default' => '1week'), 'expire_options' => array('5min' => 300, '10min' => 600, '1hour' => 3600, '1day' => 86400, '1week' => 604800, '1month' => 2592000, '1year' => 31536000, 'never' => 0), 'formatter_options' => array('plaintext' => 'Plain Text', 'syntaxhighlighting' => 'Source Code', 'markdown' => 'Markdown'), 'traffic' => array('limit' => 10, 'header' => '', 'exempted' => '', 'creators' => ''), 'purge' => array('limit' => 300, 'batchsize' => 10), 'model' => array('class' => 'Filesystem'), 'model_options' => array('dir' => 'data'), 'yourls' => array('signature' => '', 'apiurl' => ''))
Methods
__construct()
parse configuration file and ensure default configuration values are present
public
__construct() : mixed
Tags
Return values
mixed —get()
get configuration as array
public
get() : array<string|int, mixed>
Return values
array<string|int, mixed> —getDefaults()
get default configuration as array
public
static getDefaults() : array<string|int, mixed>
Return values
array<string|int, mixed> —getKey()
get a key from the configuration, typically the main section or all keys
public
getKey(string $key[, string $section = 'main' ]) : mixed
Parameters
- $key : string
- $section : string = 'main'
-
defaults to main
Tags
Return values
mixed —getSection()
get a section from the configuration, must exist
public
getSection(string $section) : mixed
Parameters
- $section : string