Alpha Framework 3.1.0 API Documentation

ConfigProvider

A singleton config class.

Tags
since
1.0
author

John Collins dev@alphaframework.org

license

http://www.opensource.org/licenses/bsd-license.php The BSD License

copyright

Copyright (c) 2018, John Collins (founder of Alpha Framework). All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the
following conditions are met:

* Redistributions of source code must retain the above
  copyright notice, this list of conditions and the
  following disclaimer.
* Redistributions in binary form must reproduce the above
  copyright notice, this list of conditions and the
  following disclaimer in the documentation and/or other
  materials provided with the distribution.
* Neither the name of the Alpha Framework nor the names
  of its contributors may be used to endorse or promote
  products derived from this software without specific
  prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Table of Contents

$configVars  : array<string|int, mixed>
Array to store the config variables.
$environment  : string
The config environment (dev, pro, test).
$instance  : ConfigProvider
The config object singleton.
get()  : string
Get config value.
getEnvironment()  : string
Get the configuration environment for this application.
getInstance()  : ConfigProvider|ConfigCallbacks
Get the config object instance.
reloadConfig()  : mixed
Reloads the config from the relevent .ini file, dependant upon the current environment (hostname).
set()  : mixed
Set config value.
__construct()  : mixed
Private constructor means the class cannot be instantiated from elsewhere.
loadConfig()  : mixed
Loads the config from the relevent .ini file, dependant upon the current environment (hostname).
setRootPath()  : mixed
Sets the root directory of the application.

Properties

$configVars

Array to store the config variables.

private array<string|int, mixed> $configVars = array()
Tags
since
1.0

$environment

The config environment (dev, pro, test).

private string $environment
Tags
since
2.0

Methods

getEnvironment()

Get the configuration environment for this application.

public getEnvironment() : string
Tags
since
2.0
Return values
string

reloadConfig()

Reloads the config from the relevent .ini file, dependant upon the current environment (hostname).

public reloadConfig() : mixed
Tags
since
2.0.1
Return values
mixed

set()

Set config value.

public set( $key,  $val) : mixed
Parameters
$key :

string

$val :

string

Tags
since
1.0
Return values
mixed

__construct()

Private constructor means the class cannot be instantiated from elsewhere.

private __construct() : mixed
Tags
since
1.0
Return values
mixed

loadConfig()

Loads the config from the relevent .ini file, dependant upon the current environment (hostname).

private loadConfig() : mixed
Tags
throws
PHPException
since
1.0
Return values
mixed

setRootPath()

Sets the root directory of the application.

private setRootPath() : mixed
Tags
since
1.0
Return values
mixed

Search results