PHP 클래스 Bart\Configuration\Configuration

All children are required to define a README method which can be used to see how each class expects its conf files to look.
파일 보기 프로젝트 열기: box/bart 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$configurations array
$logger Logger

공개 메소드들

메소드 설명
README ( ) : string
__construct ( ) Instantiate instance configured to load configurations based on called class name
configure ( string $path )

보호된 메소드들

메소드 설명
configsPath ( ) : string
getArray ( $section, $key, array $default = [], $required = true ) : string[]
getBool ( $section, $key, $default = null, $required = true ) : boolean
getCurrentPassword ( string $prompt ) : string Prompt user for their user account's password
getCurrentUsername ( ) : string
getNumeric ( $section, $key, $default = null, $required = true ) http://stackoverflow.com/questions/12650802/php-equivalent-of-javascripts-parseint-function
getSecret ( string $section, string $key, string $prompt ) : string Prompt the user for secret input. Secret is cached in $section.$key for later retrieval.
getValue ( string $section, string $key, mixed $default = null, boolean $required = true ) : mixed
loadParsedIni ( string $filePath, string $subclass ) : array

비공개 메소드들

메소드 설명
load ( ) : array Load the configurations from the config file for subclass
updateRuntimeConfiguration ( string $section, string $key, string $value ) Set in memory configs for $section[$key] = $value; this is used exclusively for caching secrets

메소드 상세

README() 추상적인 공개 메소드

abstract public README ( ) : string
리턴 string Sample of how configuration is intended to be defined

__construct() 공개 메소드

Instantiate instance configured to load configurations based on called class name
public __construct ( )

configsPath() 보호된 메소드

protected configsPath ( ) : string
리턴 string Path to configurations

configure() 공개 정적인 메소드

public static configure ( string $path )
$path string Root path to all configuration

getArray() 보호된 메소드

protected getArray ( $section, $key, array $default = [], $required = true ) : string[]
$default array
리턴 string[] String list of value split by comma

getBool() 보호된 메소드

protected getBool ( $section, $key, $default = null, $required = true ) : boolean
리턴 boolean If the value equals the literal string "true"

getCurrentPassword() 보호된 메소드

Prompt user for their user account's password
protected getCurrentPassword ( string $prompt ) : string
$prompt string Text to prompt the user
리턴 string Current user's password

getCurrentUsername() 보호된 메소드

protected getCurrentUsername ( ) : string
리턴 string User name of effective user

getNumeric() 보호된 메소드

http://stackoverflow.com/questions/12650802/php-equivalent-of-javascripts-parseint-function
protected getNumeric ( $section, $key, $default = null, $required = true )

getSecret() 보호된 메소드

Prompt the user for secret input. Secret is cached in $section.$key for later retrieval.
protected getSecret ( string $section, string $key, string $prompt ) : string
$section string Section in which to use key to save secret in cache only
$key string Key name to associate with secret in cache only
$prompt string Text to prompt user input
리턴 string Secret input from user

getValue() 보호된 메소드

protected getValue ( string $section, string $key, mixed $default = null, boolean $required = true ) : mixed
$section string Configuration section in file
$key string Configuration key in section
$default mixed If not required, the default to use
$required boolean If an exception should be raised when value is missing
리턴 mixed Configured value or default

loadParsedIni() 보호된 메소드

protected loadParsedIni ( string $filePath, string $subclass ) : array
$filePath string Absolute path to file containing configurations
$subclass string Name of the configuration class
리턴 array Contents of configuration parsed as INI with sections

프로퍼티 상세

$configurations 보호되어 있는 프로퍼티

protected array $configurations
리턴 array

$logger 보호되어 있는 프로퍼티

protected Logger $logger
리턴 Logger