Property | Type | Description | |
---|---|---|---|
$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). |
Method | Description | |
---|---|---|
__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 ) |
public __construct ( $Configuration, $Type, $Source, $Group, $Settings ) | ||
$Configuration | ||
$Type | ||
$Source | ||
$Group | ||
$Settings |
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 |
return | Gdn_ConfigurationSource |
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 |
return | Gdn_ConfigurationSource |
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. |
return | mixed | The configuration value. |
public massImport ( type $Data ) | ||
$Data | type |
public static parseString ( $String, $Name ) : boolean | ||
$String | ||
$Name | ||
return | boolean |
protected $Configuration |
protected $Dirty |
protected $Group |
protected $Initial |
protected $Settings |
protected $Source |