Class CriticalI_Project_ConfigFileWriter

Description

Handles writing new default values to a config.php file

Located in /Core/lib/CriticalI/Project/ConfigFileWriter.php (line 9)


	
			
Variable Summary
 mixed $data
 mixed $filename
 mixed $origRaw
 mixed $rawFile
 mixed $rawSuffix
 mixed $skipWrite
Method Summary
 CriticalI_Project_ConfigFileWriter __construct ( $filename)
 void assign_expr ( $keys)
 void expand_raw_value ( $matches)
 void load_config ()
 void revert_file ()
 boolean set_default (string $key, string $value)
 void set_value (string $key, string $value)
 string slash (string $value)
 void write_file ()
Variables
mixed $data (line 13)
  • access: protected
mixed $filename (line 11)
  • access: protected
mixed $origRaw (line 14)
  • access: protected
mixed $rawFile (line 15)
  • access: protected
mixed $rawSuffix (line 16)
  • access: protected
mixed $skipWrite (line 12)
  • access: protected
Methods
Constructor __construct (line 21)

Constructor

  • access: public
CriticalI_Project_ConfigFileWriter __construct ( $filename)
  • $filename
assign_expr (line 140)

Returns an assignment expression for a given array of keys to use in the output file.

  • access: protected
void assign_expr ( $keys)
  • $keys
expand_raw_value (line 162)

Handles {...} expansion in values

  • access: protected
void expand_raw_value ( $matches)
  • $matches
load_config (line 176)

Load the configuration data from the file

  • access: protected
void load_config ()
revert_file (line 131)

Writes back the original file content (as it was loaded when this class was created).

  • access: public
void revert_file ()
set_default (line 35)

If no corresponding key in the configuration is set, defines a new value for it.

  • return: Returns true if a value was set, false otherwise
  • access: public
boolean set_default (string $key, string $value)
  • string $key: The key to (potentially) set a default value for
  • string $value: The new default value
set_value (line 73)

Set the key to a new value, irrespective of any existing values.

  • access: public
void set_value (string $key, string $value)
  • string $key: The key to set the value for
  • string $value: The new value
slash (line 152)

Adds slashes needed to enclose a value safely in double quotes in PHP.

  • access: protected
string slash (string $value)
  • string $value: The value to escape
write_file (line 122)

Writes any changes made out to the file

  • access: public
void write_file ()

Documentation generated on Wed, 25 Apr 2012 09:46:42 -0700 by phpDocumentor 1.4.3