Config
in package
Application Configuration
PHP Mini Framework
Tags
Table of Contents
- $appPath : string
- Path to app folder - relative to system base path. e.g `/var/www/html/app` (Without leading or trailing slash)
- $cacheLimiter : string
- Cache Limiter
- $cachePath : string
- Path to cache folder (Without trailing slash)
- $configPath : string
- Path to custom config folder - relative to system base path or app folder.
- $cookieDomain : string
- Cookie Domain
- $cookieDuration : int
- Cookie Duration in seconds
- $cookieEncrypt : bool
- Cookie should be encyrpted
- $cookieHttpOnly : bool
- Cookie Http Only: Use with HTTP requests only - can't be accessed via browser script
- $cookiePath : string
- Cookie Path
- $cookiePrefix : string|null
- Cookie Prefix
- $cookieSameSite : string
- Cookie Same Site Policy
- $cookieSecure : bool
- Cookie Secure: Use with secure HTTPS connections only
- $encryptionKey : string|null
- App encryption Key
- $files : array<string|int, mixed>
- Custom config files
- $httpAllowAnyCorsDomain : bool
- CORS Allow Any Domain Set to TRUE to enable Cross-Origin Resource Sharing (CORS) from any source domain
- $httpAllowedCorsHeaders : array<string|int, mixed>
- CORS Allowable Headers If using CORS checks, set the allowable headers here
- $httpAllowedCorsMethods : array<string|int, mixed>
- CORS Allowable Methods If using CORS checks, you can set the methods you want to be allowed
- $httpAllowedCorsOrigins : array<string|int, mixed>
- CORS Allowable Domains Set the allowable domains within the array e.g. ['http://www.example.com', 'https://spa.example.com']
- $httpCheckCors : bool
- CORS Check Set to TRUE to enable Cross-Origin Resource Sharing (CORS). Useful if you are hosting your API on a different domain from the application that will access it through a browser
- $httpCorsMaxAge : int
- CORS Max Age How long in seconds to cache CORS preflight response in browser.
- $httpExposedCorsHeaders : array<string|int, mixed>
- CORS Exposed Headers If using CORS checks, set the headers permitted to be sent to client here
- $httpResponseFormat : string
- HTPP default response format
- $httpSendAndContinue : bool
- Send HTTP response without exiting. `json`|`xml`
- $httpSessionAutoStart : bool
- Auto start session for HTTP request
- $loggerVerborsity : int
- Logger verbosity
- $name : string
- App name
- $sessionPath : string
- Path to session folder (Without trailing slash)
- $tempPath : string
- Path to temporary folder (Without trailing slash)
- $uploadPath : string
- Path to upload folder (Without trailing slash)
- $version : string
- App version
- $viewPath : string
- Path to view folder - relative to system base path or app folder.
- $custom : array<string|int, mixed>
- Custom configs
- __construct() : mixed
- addFile() : self
- Add custom config file
- addFiles() : self
- Add custom config files
- get() : mixed
- Get custom config
- set() : mixed
- Set custom config
- setAppPath() : self
- Set path to app folder - relative to system base path. e.g `/var/www/html/app`
- setCacheLimiter() : self
- Set cache Limiter
- setCachePath() : self
- Set (Without trailing slash)
- setConfigPath() : self
- Set path to custom config files - relative to system base path or app folder. e.g `/var/www/html/config` or `config` ('/var/www/html/app/config')
- setCookieDomain() : self
- Set cookie domain
- setCookieDuration() : self
- Set cookie duration
- setCookieEncrypt() : self
- Set cookie should be encyrpted
- setCookieHttpOnly() : self
- Set cookie Http Only: Use with HTTP requests only - can't be accessed via browser script
- setCookiePath() : self
- Set cookie path
- setCookiePrefix() : self
- Set cookie prefix
- setCookieSameSite() : self
- Set cookie Same Site Policy
- setCookieSecure() : self
- Cookie Secure: Use with secure HTTPS connections only
- setEncryptionKey() : self
- Set encryption Key
- setHttpAllowAnyCorsDomain() : self
- Set source domain
- setHttpAllowedCorsHeaders() : self
- Set if using CORS checks, set the allowable headers here
- setHttpAllowedCorsMethods() : self
- Set if using CORS checks, you can set the methods you want to be allowed
- setHttpAllowedCorsOrigins() : self
- Set e.g. ['http://www.example.com', 'https://spa.example.com']
- setHttpCheckCors() : self
- Set will access it through a browser
- setHttpCorsMaxAge() : self
- Set -1 for disabling caching.
- setHttpExposedCorsHeaders() : self
- Set if using CORS checks, set the headers permitted to be sent to client here
- setHttpResponseFormat() : self
- Set HTPP default response format
- setHttpSendAndContinue() : self
- Set send HTTP response without exiting
- setHttpSessionAutoStart() : self
- Set auto start session for HTTP request
- setLoggerVerborsity() : self
- Set logger verbosity
- setName() : self
- Set app name
- setSessionPath() : self
- Set (Without trailing slash)
- setTempPath() : self
- Set (Without trailing slash)
- setUploadPath() : self
- Set (Without trailing slash)
- setVersion() : self
- Set app version
- setViewPath() : self
- Set path to view folder - relative to system base path or app folder. e.g `/var/www/html/view` or `view` ('/var/www/html/app/view')
Properties
$appPath
Path to app folder - relative to system base path. e.g `/var/www/html/app` (Without leading or trailing slash)
public
string
$appPath
= ''
Tags
$cacheLimiter
Cache Limiter
public
string
$cacheLimiter
= \Busarm\PhpMini\Enums\CacheLimiter::NO_CACHE
Tags
$cachePath
Path to cache folder (Without trailing slash)
public
string
$cachePath
= ''
Tags
$configPath
Path to custom config folder - relative to system base path or app folder.
public
string
$configPath
= ''
(Without leading or trailing slash)
Tags
$cookieDomain
Cookie Domain
public
string
$cookieDomain
= ''
Tags
$cookieDuration
Cookie Duration in seconds
public
int
$cookieDuration
= 3600
Tags
$cookieEncrypt
Cookie should be encyrpted
public
bool
$cookieEncrypt
= true
Tags
$cookieHttpOnly
Cookie Http Only: Use with HTTP requests only - can't be accessed via browser script
public
bool
$cookieHttpOnly
= false
Tags
$cookiePath
Cookie Path
public
string
$cookiePath
= '/'
Tags
$cookiePrefix
Cookie Prefix
public
string|null
$cookiePrefix
= NULL
Tags
$cookieSameSite
Cookie Same Site Policy
public
string
$cookieSameSite
= \Busarm\PhpMini\Enums\SameSite::LAX
Tags
$cookieSecure
Cookie Secure: Use with secure HTTPS connections only
public
bool
$cookieSecure
= false
Tags
$encryptionKey
App encryption Key
public
string|null
$encryptionKey
= NULL
Tags
$files
Custom config files
public
array<string|int, mixed>
$files
= []
Tags
$httpAllowAnyCorsDomain
CORS Allow Any Domain Set to TRUE to enable Cross-Origin Resource Sharing (CORS) from any source domain
public
bool
$httpAllowAnyCorsDomain
= false
Tags
$httpAllowedCorsHeaders
CORS Allowable Headers If using CORS checks, set the allowable headers here
public
array<string|int, mixed>
$httpAllowedCorsHeaders
= []
Tags
$httpAllowedCorsMethods
CORS Allowable Methods If using CORS checks, you can set the methods you want to be allowed
public
array<string|int, mixed>
$httpAllowedCorsMethods
= []
Tags
$httpAllowedCorsOrigins
CORS Allowable Domains Set the allowable domains within the array e.g. ['http://www.example.com', 'https://spa.example.com']
public
array<string|int, mixed>
$httpAllowedCorsOrigins
= []
Tags
$httpCheckCors
CORS Check Set to TRUE to enable Cross-Origin Resource Sharing (CORS). Useful if you are hosting your API on a different domain from the application that will access it through a browser
public
bool
$httpCheckCors
= false
Tags
$httpCorsMaxAge
CORS Max Age How long in seconds to cache CORS preflight response in browser.
public
int
$httpCorsMaxAge
= -1
-1 for disabling caching.
Tags
$httpExposedCorsHeaders
CORS Exposed Headers If using CORS checks, set the headers permitted to be sent to client here
public
array<string|int, mixed>
$httpExposedCorsHeaders
= []
Tags
$httpResponseFormat
HTPP default response format
public
string
$httpResponseFormat
= \Busarm\PhpMini\Enums\ResponseFormat::JSON
Tags
$httpSendAndContinue
Send HTTP response without exiting. `json`|`xml`
public
bool
$httpSendAndContinue
= false
Tags
$httpSessionAutoStart
Auto start session for HTTP request
public
bool
$httpSessionAutoStart
= true
Tags
$loggerVerborsity
Logger verbosity
public
int
$loggerVerborsity
= \Busarm\PhpMini\Enums\Verbose::DEBUG
Tags
$name
App name
public
string
$name
= 'PHP Mini'
Tags
$sessionPath
Path to session folder (Without trailing slash)
public
string
$sessionPath
= ''
Tags
$tempPath
Path to temporary folder (Without trailing slash)
public
string
$tempPath
= ''
Tags
$uploadPath
Path to upload folder (Without trailing slash)
public
string
$uploadPath
= ''
Tags
$version
App version
public
string
$version
= '1.0.0'
Tags
$viewPath
Path to view folder - relative to system base path or app folder.
public
string
$viewPath
= ''
(Without leading or trailing slash)
Tags
$custom
Custom configs
protected
array<string|int, mixed>
$custom
= []
Tags
Methods
__construct()
public
__construct() : mixed
Tags
Return values
mixed —addFile()
Add custom config file
public
addFile(string $config) : self
Parameters
- $config : string
-
Config file name/path relative to Config Path (@see
self::setConfigPath)
Tags
Return values
self —addFiles()
Add custom config files
public
addFiles([array<string|int, mixed> $configs = array() ]) : self
Parameters
- $configs : array<string|int, mixed> = array()
-
List of config file name/path relative to Config Path (@see
self::setConfigPath)
Tags
Return values
self —get()
Get custom config
public
get(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
Tags
Return values
mixed —Returns config value or default
set()
Set custom config
public
set(string $name[, mixed $value = null ]) : mixed
Parameters
- $name : string
- $value : mixed = null
Tags
Return values
mixed —Returns value
setAppPath()
Set path to app folder - relative to system base path. e.g `/var/www/html/app`
public
setAppPath(string $appPath) : self
Parameters
- $appPath : string
-
(Without leading or trailing slash)
Tags
Return values
self —setCacheLimiter()
Set cache Limiter
public
setCacheLimiter(string $cacheLimiter) : self
Parameters
- $cacheLimiter : string
-
Cache Limiter
Tags
Return values
self —setCachePath()
Set (Without trailing slash)
public
setCachePath(string $cachePath) : self
Parameters
- $cachePath : string
-
(Without trailing slash)
Tags
Return values
self —setConfigPath()
Set path to custom config files - relative to system base path or app folder. e.g `/var/www/html/config` or `config` ('/var/www/html/app/config')
public
setConfigPath(string $configPath) : self
Parameters
- $configPath : string
-
(Without leading or trailing slash)
Tags
Return values
self —setCookieDomain()
Set cookie domain
public
setCookieDomain(string $cookieDomain) : self
Parameters
- $cookieDomain : string
Tags
Return values
self —setCookieDuration()
Set cookie duration
public
setCookieDuration(string $cookieDuration) : self
Parameters
- $cookieDuration : string
Tags
Return values
self —setCookieEncrypt()
Set cookie should be encyrpted
public
setCookieEncrypt(bool $cookieEncrypt) : self
Parameters
- $cookieEncrypt : bool
-
Cookie should be encyrpted
Tags
Return values
self —setCookieHttpOnly()
Set cookie Http Only: Use with HTTP requests only - can't be accessed via browser script
public
setCookieHttpOnly(bool $cookieHttpOnly) : self
Parameters
- $cookieHttpOnly : bool
-
Cookie Http Only: Use with HTTP requests only - can't be accessed via browser script
Tags
Return values
self —setCookiePath()
Set cookie path
public
setCookiePath(mixed $cookiePath) : self
Parameters
- $cookiePath : mixed
Tags
Return values
self —setCookiePrefix()
Set cookie prefix
public
setCookiePrefix(string $cookiePrefix) : self
Parameters
- $cookiePrefix : string
Tags
Return values
self —setCookieSameSite()
Set cookie Same Site Policy
public
setCookieSameSite(string $cookieSameSite) : self
Parameters
- $cookieSameSite : string
-
Cookie Same Site Policy
Tags
Return values
self —setCookieSecure()
Cookie Secure: Use with secure HTTPS connections only
public
setCookieSecure(bool $cookieSecure) : self
Parameters
- $cookieSecure : bool
-
Cookie Secure: Use with secure HTTPS connections only
Tags
Return values
self —setEncryptionKey()
Set encryption Key
public
setEncryptionKey(string $encryptionKey) : self
Parameters
- $encryptionKey : string
Tags
Return values
self —setHttpAllowAnyCorsDomain()
Set source domain
public
setHttpAllowAnyCorsDomain(bool $httpAllowAnyCorsDomain) : self
Parameters
- $httpAllowAnyCorsDomain : bool
-
source domain
Tags
Return values
self —setHttpAllowedCorsHeaders()
Set if using CORS checks, set the allowable headers here
public
setHttpAllowedCorsHeaders(array<string|int, mixed> $httpAllowedCorsHeaders) : self
Parameters
- $httpAllowedCorsHeaders : array<string|int, mixed>
-
If using CORS checks, set the allowable headers here
Tags
Return values
self —setHttpAllowedCorsMethods()
Set if using CORS checks, you can set the methods you want to be allowed
public
setHttpAllowedCorsMethods(array<string|int, mixed> $httpAllowedCorsMethods) : self
Parameters
- $httpAllowedCorsMethods : array<string|int, mixed>
-
If using CORS checks, you can set the methods you want to be allowed
Tags
Return values
self —setHttpAllowedCorsOrigins()
Set e.g. ['http://www.example.com', 'https://spa.example.com']
public
setHttpAllowedCorsOrigins(array<string|int, mixed> $httpAllowedCorsOrigins) : self
Parameters
- $httpAllowedCorsOrigins : array<string|int, mixed>
-
e.g. ['http://www.example.com', 'https://spa.example.com']
Tags
Return values
self —setHttpCheckCors()
Set will access it through a browser
public
setHttpCheckCors(bool $httpCheckCors) : self
Parameters
- $httpCheckCors : bool
-
will access it through a browser
Tags
Return values
self —setHttpCorsMaxAge()
Set -1 for disabling caching.
public
setHttpCorsMaxAge(int $httpCorsMaxAge) : self
Parameters
- $httpCorsMaxAge : int
-
-1 for disabling caching.
Tags
Return values
self —setHttpExposedCorsHeaders()
Set if using CORS checks, set the headers permitted to be sent to client here
public
setHttpExposedCorsHeaders(array<string|int, mixed> $httpExposedCorsHeaders) : self
Parameters
- $httpExposedCorsHeaders : array<string|int, mixed>
-
If using CORS checks, set the headers permitted to be sent to client here
Tags
Return values
self —setHttpResponseFormat()
Set HTPP default response format
public
setHttpResponseFormat(string $httpResponseFormat) : self
Parameters
- $httpResponseFormat : string
-
HTPP default response format.
json|xml
Tags
Return values
self —setHttpSendAndContinue()
Set send HTTP response without exiting
public
setHttpSendAndContinue(bool $httpSendAndContinue) : self
Parameters
- $httpSendAndContinue : bool
-
Send HTTP response without exiting
Tags
Return values
self —setHttpSessionAutoStart()
Set auto start session for HTTP request
public
setHttpSessionAutoStart(bool $httpSessionAutoStart) : self
Parameters
- $httpSessionAutoStart : bool
-
Auto start session for HTTP request
Tags
Return values
self —setLoggerVerborsity()
Set logger verbosity
public
setLoggerVerborsity(int $loggerVerborsity) : self
Parameters
- $loggerVerborsity : int
-
Logger verbosity
Tags
Return values
self —setName()
Set app name
public
setName(string $name) : self
Parameters
- $name : string
-
App name
Tags
Return values
self —setSessionPath()
Set (Without trailing slash)
public
setSessionPath(string $sessionPath) : self
Parameters
- $sessionPath : string
-
(Without trailing slash)
Tags
Return values
self —setTempPath()
Set (Without trailing slash)
public
setTempPath(string $tempPath) : self
Parameters
- $tempPath : string
-
(Without trailing slash)
Tags
Return values
self —setUploadPath()
Set (Without trailing slash)
public
setUploadPath(string $uploadPath) : self
Parameters
- $uploadPath : string
-
(Without trailing slash)
Tags
Return values
self —setVersion()
Set app version
public
setVersion(string $version) : self
Parameters
- $version : string
-
App version
Tags
Return values
self —setViewPath()
Set path to view folder - relative to system base path or app folder. e.g `/var/www/html/view` or `view` ('/var/www/html/app/view')
public
setViewPath(string $viewPath) : self
Parameters
- $viewPath : string
-
(Without leading or trailing slash)