Class Config
A simple class to manage configuration for workflows
Currently, there are three handlers that are available: json
, sqlite
, and
ini
. These correspond to their obvious data storage types. To use, do something
simple like:
<pre><span class="php-var">$config</span> = <span class="php-keyword1">new</span> Alphred\Config( <span class="php-quote">'ini'</span> );
<span class="php-var">$config</span>->set( <span class="php-quote">'username'</span>, <span class="php-quote">'shawn patrick rice'</span> );</pre>
To get it later, just use:
<pre><span class="php-var">$username</span> = <span class="php-var">$config</span>->read( <span class="php-quote">'username'</span> );</pre>
You can store arrays and more complex data with the json
and ini
handlers.
Currently, the SQLite3 handler is a bit primitive.
Methods summary
public
|
|
private
boolean
|
|
private
string
|
|
private
boolean
|
|
public
boolean
|
|
public
mixed
|
|
public
boolean
|
|
private
boolean
|
|
private
boolean
|
|
private
mixed
|
|
private
boolean
|
|
private
boolean
|
|
private
boolean
|
|
private
boolean
|
|
private
mixed
|
|
private
boolean
|
|
private
boolean
|
|
private
|
|
private
mixed
|
|
private
boolean
|
Magic methods summary
Properties summary
private
array
|
$handlers
A list of valid handlers and their file extensions |
#
[
// as file_extension => handler_name
'json' => 'json',
'sqlite3' => 'sqlite',
'ini' => 'ini',
]
|