3 * StatusNet - the distributed open-source microblogging tool
\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
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
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
18 * Extends the configuration class (Phergie_Config) to allow passing config
\r
19 * array instead of loading from file
\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
28 class Phergie_Extended_Config extends Phergie_Config {
\r
30 * Incorporates an associative array of settings into the current
\r
31 * configuration settings.
\r
33 * @param array $array Array of settings
\r
35 * @return Phergie_Config Provides a fluent interface
\r
36 * @throws Phergie_Config_Exception
\r
38 public function readArray($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
47 $this->settings += $settings;
\r