Overview

Namespaces

  • None
  • Peg
    • Cli
      • Commands
    • Config
    • Custom
      • Command
        • Action
          • Generate
          • Parse
      • CommandLine
      • Config
      • Localization
      • Utilities
    • Lib
      • Definitions
        • Element
      • Generator
      • Lexers
      • Plugins
      • Signals
        • Data
          • Definitions
          • Lexers
        • Type
  • PHP

Classes

  • Base
  • INI
  • JSON
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class Base

Base structure for managing configuration files. Every configuration manager should implement this class.

Direct known subclasses

Peg\Custom\Config\INI, Peg\Custom\Config\JSON
Abstract
Namespace: Peg\Custom\Config
Located at src/Config/Base.php
Methods summary
abstract public
# Load( string $directory, string $configuration_file )

Loads all configuration options of a given file and creates it if does not exists.

Loads all configuration options of a given file and creates it if does not exists.

Parameters

$directory
string
$directory
$configuration_file
string
$configuration_file
abstract public
# Write( )

Writes a configuration file using the settings array.

Writes a configuration file using the settings array.

public boolean
# Get( string $option )

Get an option value.

Get an option value.

Parameters

$option
string
$option

Returns

boolean
public array
# GetAll( )

Get all preferences.

Get all preferences.

Returns

array
public boolean|string
# GetGroupValue( string $group, string $option )

Get the value of an option on a specific configuration group.

Get the value of an option on a specific configuration group.

Parameters

$group
string
$group
$option
string
$option

Returns

boolean|string
public
# Set( type $option, type $value )

Modifies or adds an option value and writes it to the configuration file immediately.

Modifies or adds an option value and writes it to the configuration file immediately.

Parameters

$option
type
$option
$value
type
$value
public
# SetGroupValue( string $group, string $option, string $value )

Edits or creates a new group and option and writes it to the configuration file immediately.

Edits or creates a new group and option and writes it to the configuration file immediately.

Parameters

$group
string
$group
$option
string
$option
$value
string
$value
Properties summary
protected array $preferences
#

All preferences stored on a configuration file.

All preferences stored on a configuration file.

Format of this array for single options: $settings["option"] = "value"

Format of this array for a group of options: $settings["group"] = array( "option" => "value", "option2" => "value2" )

public string $directory
#

Directory of configuration file.

Directory of configuration file.

public string $file
#

Full path of configuration file.

Full path of configuration file.

PEG Api API documentation generated by ApiGen 2.8.0