]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Irc/extlib/phergie/Phergie/ExtendedConfig.php
4ae6b0293cef31744e635ca85e5687028447fadc
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / ExtendedConfig.php
1 <?php\r
2 /**\r
3  * StatusNet - the distributed open-source microblogging tool\r
4  *\r
5  * This program is free software: you can redistribute it and/or modify\r
6  * it under the terms of the GNU Affero General Public License as published by\r
7  * the Free Software Foundation, either version 3 of the License, or\r
8  * (at your option) any later version.\r
9  *\r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU Affero General Public License for more details.\r
14  *\r
15  * You should have received a copy of the GNU Affero General Public License\r
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
17  *\r
18  * Extends the configuration class (Phergie_Config) to allow passing config\r
19  * array instead of loading from file\r
20  *\r
21  * @category  Phergie\r
22  * @package   Phergie_Extended_Config\r
23  * @author    Luke Fitzgerald <lw.fitzgerald@googlemail.com>\r
24  * @copyright 2010 StatusNet, Inc.\r
25  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0\r
26  * @link      http://status.net/\r
27  */\r
28 class Phergie_Extended_Config extends Phergie_Config {\r
29     /**\r
30      * Incorporates an associative array of settings into the current\r
31      * configuration settings.\r
32      *\r
33      * @param array $array Array of settings\r
34      *\r
35      * @return Phergie_Config Provides a fluent interface\r
36      * @throws Phergie_Config_Exception\r
37      */\r
38     public function readArray($array) {\r
39         $settings = $array;\r
40         if (!is_array($settings)) {\r
41             throw new Phergie_Config_Exception(\r
42                 'Parameter is not an array',\r
43                 Phergie_Config_Exception::ERR_ARRAY_NOT_RETURNED\r
44             );\r
45         }\r
46 \r
47         $this->settings += $settings;\r
48 \r
49         return $this;\r
50     }\r
51 }\r