Config.php
3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
namespace Phalcon {
/**
* Phalcon\Config
*
* Phalcon\Config is designed to simplify the access to, and the use of, configuration data within applications.
* It provides a nested object property based user interface for accessing this configuration data within
* application code.
*
*<code>
* $config = new Phalcon\Config(array(
* "database" => array(
* "adapter" => "Mysql",
* "host" => "localhost",
* "username" => "scott",
* "password" => "cheetah",
* "dbname" => "test_db"
* ),
* "phalcon" => array(
* "controllersDir" => "../app/controllers/",
* "modelsDir" => "../app/models/",
* "viewsDir" => "../app/views/"
* )
* ));
*</code>
*
*/
class Config implements \ArrayAccess, \Countable {
/**
* \Phalcon\Config constructor
*
* @param array $arrayConfig
*/
public function __construct($arrayConfig=null){ }
/**
* Allows to check whether an attribute is defined using the array-syntax
*
*<code>
* var_dump(isset($config['database']));
*</code>
*
* @param string $index
* @return boolean
*/
public function offsetExists($index){ }
/**
* Gets an attribute from the configuration, if the attribute isn't defined returns null
* If the value is exactly null or is not defined the default value will be used instead
*
*<code>
* echo $config->get('controllersDir', '../app/controllers/');
*</code>
*
* @param string $index
* @param mixed $defaultValue
* @return mixed
*/
public function get($index, $defaultValue=null){ }
/**
* Gets an attribute using the array-syntax
*
*<code>
* print_r($config['database']);
*</code>
*
* @param string $index
* @return string
*/
public function offsetGet($index){ }
/**
* Sets an attribute using the array-syntax
*
*<code>
* $config['database'] = array('type' => 'Sqlite');
*</code>
*
* @param string $index
* @param mixed $value
*/
public function offsetSet($index, $value){ }
/**
* Unsets an attribute using the array-syntax
*
*<code>
* unset($config['database']);
*</code>
*
* @param string $index
*/
public function offsetUnset($index){ }
/**
* Merges a configuration into the current one
*
* @brief void \Phalcon\Config::merge(array|object $with)
*
*<code>
* $appConfig = new \Phalcon\Config(array('database' => array('host' => 'localhost')));
* $globalConfig->merge($config2);
*</code>
*
* @param \Phalcon\Config $config
*/
public function merge($config){ }
/**
* Converts recursively the object to an array
*
* @brief array \Phalcon\Config::toArray(bool $recursive = true);
*
*<code>
* print_r($config->toArray());
*</code>
*
* @return array
*/
public function toArray(){ }
public function count(){ }
public function __wakeup(){ }
/**
* Restores the state of a \Phalcon\Config object
*
* @param array $data
* @return \Phalcon\Config
*/
public static function __set_state($data){ }
public function __get($index){ }
public function __set($index, $value){ }
public function __isset($index){ }
}
}