PHP 클래스 Gdn_ConfigurationSource, vanilla

상속: extends Gdn_Pluggable
파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$Callback Save callback.
$CallbackOptions Save callback options.
$Configuration Top level configuration object to reference.
$Dirty Whether this config source has been modified since loading.
$Group Group name for this config source (e.g. Configuration).
$Initial Settings as they were when loaded (to facilitate logging config change diffs).
$Settings Current array of live config settings for this source.
$Source Name of source (e.g. filename, or string source tag).
$Splitting Allow key splitting on dots.
$Type Type of source (e.g. file or string).

공개 메소드들

메소드 설명
__construct ( $Configuration, $Type, $Source, $Group, $Settings )
assignCallback ( callback $Callback, array $Options = null ) : boolean Set a save callback
export ( ) : array
fromArray ( Gdn_Configuration $Parent, array $ConfigData, string $Tag, string $Name = 'Configuration' ) : Gdn_ConfigurationSource Load config data from an array
fromFile ( Gdn_Configuration $Parent, string $File, string $Name = 'Configuration' ) : Gdn_ConfigurationSource Load config data from a file.
fromString ( Gdn_Configuration $Parent, string $String, string $Tag, string $Name = 'Configuration' ) : Gdn_ConfigurationSource Load config data from a string
get ( string $Name, mixed $DefaultValue = false ) : mixed Gets a setting from the configuration array. Returns $DefaultValue if the value isn't found.
group ( ) : string
identify ( ) : string
import ( $Settings )
massImport ( type $Data ) Import a large pre-formatted set of configs efficiently
parseString ( $String, $Name ) : boolean
remove ( string $Name ) : boolean Removes the specified key from the config (if it exists).
save ( ) : boolean | null
set ( $Name, null $Value = null, boolean $Overwrite = true )
shutdown ( )
splitting ( boolean $Splitting = true )
toFile ( $File )

메소드 상세

__construct() 공개 메소드

public __construct ( $Configuration, $Type, $Source, $Group, $Settings )
$Configuration
$Type
$Source
$Group
$Settings

assignCallback() 공개 메소드

Set a save callback
public assignCallback ( callback $Callback, array $Options = null ) : boolean
$Callback callback
$Options array Callback options
리턴 boolean

export() 공개 메소드

public export ( ) : array
리턴 array

fromArray() 공개 정적인 메소드

Load config data from an array
public static fromArray ( Gdn_Configuration $Parent, array $ConfigData, string $Tag, string $Name = 'Configuration' ) : Gdn_ConfigurationSource
$Parent Gdn_Configuration Parent config object
$ConfigData array Config data array
$Tag string Internal friendly name
$Name string Optional setting name
리턴 Gdn_ConfigurationSource

fromFile() 공개 정적인 메소드

Load config data from a file.
public static fromFile ( Gdn_Configuration $Parent, string $File, string $Name = 'Configuration' ) : Gdn_ConfigurationSource
$Parent Gdn_Configuration Parent config object
$File string Path to config file to load
$Name string Optional setting name
리턴 Gdn_ConfigurationSource

fromString() 공개 정적인 메소드

Load config data from a string
public static fromString ( Gdn_Configuration $Parent, string $String, string $Tag, string $Name = 'Configuration' ) : Gdn_ConfigurationSource
$Parent Gdn_Configuration Parent config object
$String string Config data string
$Tag string Internal friendly name
$Name string Optional setting name
리턴 Gdn_ConfigurationSource

get() 공개 메소드

Gets a setting from the configuration array. Returns $DefaultValue if the value isn't found.
public get ( string $Name, mixed $DefaultValue = false ) : mixed
$Name string The name of the configuration setting to get. If the setting is contained within an associative array, use dot denomination to get the setting. ie. $this->Get('Database.Host') would retrieve $Configuration[$Group]['Database']['Host'].
$DefaultValue mixed If the parameter is not found in the group, this value will be returned.
리턴 mixed The configuration value.

group() 공개 메소드

public group ( ) : string
리턴 string

identify() 공개 메소드

public identify ( ) : string
리턴 string

import() 공개 메소드

public import ( $Settings )
$Settings

massImport() 공개 메소드

NOTE: ONLY WORKS WHEN SPLITTING IS OFF!
public massImport ( type $Data )
$Data type

parseString() 공개 정적인 메소드

public static parseString ( $String, $Name ) : boolean
$String
$Name
리턴 boolean

remove() 공개 메소드

Returns false if the key is not found for removal, true otherwise.
public remove ( string $Name ) : boolean
$Name string The name of the configuration setting with dot notation.
리턴 boolean Whether or not the key was found.

save() 공개 메소드

public save ( ) : boolean | null
리턴 boolean | null

set() 공개 메소드

public set ( $Name, null $Value = null, boolean $Overwrite = true )
$Name
$Value null
$Overwrite boolean

shutdown() 공개 메소드

public shutdown ( )

splitting() 공개 메소드

public splitting ( boolean $Splitting = true )
$Splitting boolean

toFile() 공개 메소드

public toFile ( $File )
$File

프로퍼티 상세

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

Save callback.
protected $Callback

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

Save callback options.
protected $CallbackOptions

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

Top level configuration object to reference.
protected $Configuration

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

Whether this config source has been modified since loading.
protected $Dirty

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

Group name for this config source (e.g. Configuration).
protected $Group

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

Settings as they were when loaded (to facilitate logging config change diffs).
protected $Initial

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

Current array of live config settings for this source.
protected $Settings

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

Name of source (e.g. filename, or string source tag).
protected $Source

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

Allow key splitting on dots.
protected $Splitting

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

Type of source (e.g. file or string).
protected $Type