PHP Класс Gdn_ConfigurationSource, vanilla

Наследование: extends Gdn_Pluggable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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