tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Config_Loader_File

Source Location: /core/config_loader_file.class.php

Class Config_Loader_File

Class Overview

Loads configuration data from file.

Loads configuration data from file. According to Tangra Filenames Convention (TODO - provide link) configuration files has *.conf extention.

Located in /core/config_loader_file.class.php [line 32]

Tangra_Class
   |
   --Config_Loader
      |
      --Config_Loader_File

Properties

Methods

[ Top ]
Descendants
Child Class Description
DB_Config_Loader_File Loads configuration from file and populates DB_Config object

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Config_Loader

Config_Loader::$pairs

Inherited From Config_Loader

Config_Loader::__construct()
It is supposed loading of the configuration from external resource as file or DB to be performed at construction time of Config_Loader objects.
Config_Loader::add_pair()
Adds new key-value pair
Config_Loader::expand()
Expands keys that are present in values
Config_Loader::extract_key()
Extracts single key that start at position $start in string $value
Config_Loader::extract_keys()
Extracts all keys (delimited by % from both sides)
Config_Loader::get_conf_value()
Gets coresponding to $key configuration value.
Config_Loader::get_pairs()
Returns all key-value pairs
Config_Loader::set_pairs()
Auxiliary method that may be used to set the internal private $pairs variable.

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Method Summary
Config_Loader_File   __construct()   Loads the configuration file and parses it. Ater construction object is ready for use (calls to get_conf_value() method)
void   import_file()  
boolean   load_file()   Loads
void   parse_command_line()   Parses line that contains command, e.g. starting with "!"
array   parse_conf_arr()   Parses array returned by $this->parse_file_arr. Populates $this->pairs.
array   parse_file_arr()   Parses array loaded by $this->load_file(). Skips rows that are commets or missformed (i.e. starting with blank space)

[ Top ]
Properties
mixed   $imports = array() [line 33]
API Tags:
Access:  private


[ Top ]
Methods
Constructor __construct  [line 40]

  Config_Loader_File __construct( string $file  )

Loads the configuration file and parses it. Ater construction object is ready for use (calls to get_conf_value() method)

Parameters:
string   $file:  - full path to fconfiguration file


Redefinition of:
Config_Loader::__construct()
It is supposed loading of the configuration from external resource as file or DB to be performed at construction time of Config_Loader objects.

[ Top ]
import_file  [line 165]

  void import_file( $file, $config_dir  )

Parameters:
   $file: 
   $config_dir: 

API Tags:
Access:  private


[ Top ]
load_file  [line 78]

  boolean load_file( $string $file  )

Loads

Parameters:
$string   $file: 

API Tags:
Return:  - returns file contents as array one element per row
Access:  private


[ Top ]
parse_command_line  [line 140]

  void parse_command_line( string $line, $line_no  )

Parses line that contains command, e.g. starting with "!"

Parameters:
string   $line: 
   $line_no: 

API Tags:
Access:  private


[ Top ]
parse_conf_arr  [line 120]

  array parse_conf_arr( unknown_type $conf_arr  )

Parses array returned by $this->parse_file_arr. Populates $this->pairs.

Parameters:
unknown_type   $conf_arr: 

API Tags:
Return:  simple associative array that may be used (and it is used in __construct) for setting $this->pairs
Access:  private


[ Top ]
parse_file_arr  [line 91]

  array parse_file_arr( array $file_arr  )

Parses array loaded by $this->load_file(). Skips rows that are commets or missformed (i.e. starting with blank space)

Parameters:
array   $file_arr: 

API Tags:
Return:  simple associative array that contain just "valid" rows
Access:  private


[ Top ]