11<?php
22
33namespace Phalcon ;
4+
45/**
56 * Phalcon\Config
7+ *
68 * Phalcon\Config is designed to simplify the access to, and the use of, configuration data within applications.
79 * It provides a nested object property based user interface for accessing this configuration data within
810 * application code.
11+ *
912 * <code>
1013 * $config = new \Phalcon\Config(
11- * [
12- * "database" => [
13- * "adapter" => "Mysql",
14- * "host" => "localhost",
15- * "username" => "scott",
16- * "password" => "cheetah",
17- * "dbname" => "test_db",
18- * ],
19- * "phalcon" => [
20- * "controllersDir" => "../app/controllers/",
21- * "modelsDir" => "../app/models/",
22- * "viewsDir" => "../app/views/",
23- * ],
24- * ]
14+ * [
15+ * "database" => [
16+ * "adapter" => "Mysql",
17+ * "host" => "localhost",
18+ * "username" => "scott",
19+ * "password" => "cheetah",
20+ * "dbname" => "test_db",
21+ * ],
22+ * "phalcon" => [
23+ * "controllersDir" => "../app/controllers/",
24+ * "modelsDir" => "../app/models/",
25+ * "viewsDir" => "../app/views/",
26+ * ],
27+ * ]
2528 * );
2629 * </code>
2730 */
@@ -37,9 +40,10 @@ public function __construct(array $arrayConfig = null) {}
3740
3841 /**
3942 * Allows to check whether an attribute is defined using the array-syntax
43+ *
4044 * <code>
4145 * var_dump(
42- * isset($config["database"])
46+ * isset($config["database"])
4347 * );
4448 * </code>
4549 *
@@ -51,6 +55,7 @@ public function offsetExists($index) {}
5155 /**
5256 * Gets an attribute from the configuration, if the attribute isn't defined returns null
5357 * If the value is exactly null or is not defined the default value will be used instead
58+ *
5459 * <code>
5560 * echo $config->get("controllersDir", "../app/controllers/");
5661 * </code>
@@ -63,9 +68,10 @@ public function get($index, $defaultValue = null) {}
6368
6469 /**
6570 * Gets an attribute using the array-syntax
71+ *
6672 * <code>
6773 * print_r(
68- * $config["database"]
74+ * $config["database"]
6975 * );
7076 * </code>
7177 *
@@ -76,9 +82,10 @@ public function offsetGet($index) {}
7682
7783 /**
7884 * Sets an attribute using the array-syntax
85+ *
7986 * <code>
8087 * $config["database"] = [
81- * "type" => "Sqlite",
88+ * "type" => "Sqlite",
8289 * ];
8390 * </code>
8491 *
@@ -89,6 +96,7 @@ public function offsetSet($index, $value) {}
8996
9097 /**
9198 * Unsets an attribute using the array-syntax
99+ *
92100 * <code>
93101 * unset($config["database"]);
94102 * </code>
@@ -99,14 +107,16 @@ public function offsetUnset($index) {}
99107
100108 /**
101109 * Merges a configuration into the current one
110+ *
102111 * <code>
103112 * $appConfig = new \Phalcon\Config(
104- * [
105- * "database" => [
106- * "host" => "localhost",
107- * ],
108- * ]
113+ * [
114+ * "database" => [
115+ * "host" => "localhost",
116+ * ],
117+ * ]
109118 * );
119+ *
110120 * $globalConfig->merge($appConfig);
111121 * </code>
112122 *
@@ -117,9 +127,10 @@ public function merge(Config $config) {}
117127
118128 /**
119129 * Converts recursively the object to an array
130+ *
120131 * <code>
121132 * print_r(
122- * $config->toArray()
133+ * $config->toArray()
123134 * );
124135 * </code>
125136 *
@@ -129,10 +140,13 @@ public function toArray() {}
129140
130141 /**
131142 * Returns the count of properties set in the config
143+ *
132144 * <code>
133145 * print count($config);
134146 * </code>
147+ *
135148 * or
149+ *
136150 * <code>
137151 * print $config->count();
138152 * </code>
@@ -152,8 +166,11 @@ public static function __set_state(array $data) {}
152166 /**
153167 * Helper method for merge configs (forwarding nested config instance)
154168 *
169+ *
170+ * @param Config instance = null
171+ *
155172 * @param Config $config
156- * @param Config $instance = null
173+ * @param mixed $instance
157174 * @return Config
158175 */
159176 protected final function _merge (Config $ config , $ instance = null ) {}
0 commit comments