summaryrefslogtreecommitdiff
path: root/plugins/Irc/extlib
diff options
context:
space:
mode:
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>2010-07-09 02:43:40 -0700
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>2010-07-09 02:43:40 -0700
commit80516cba2f550f8f6a4243adb536f3b4aaab0b5f (patch)
tree94836ce5e518243c5f4ee661580864eb4a01e481 /plugins/Irc/extlib
parent9080fdd56ee63b6bff8636b9f4a81d96bc290547 (diff)
Extended Phergie_Config to allow passing config array instead of loading from file
Diffstat (limited to 'plugins/Irc/extlib')
-rw-r--r--plugins/Irc/extlib/phergie/Phergie/ExtendedConfig.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/Irc/extlib/phergie/Phergie/ExtendedConfig.php b/plugins/Irc/extlib/phergie/Phergie/ExtendedConfig.php
new file mode 100644
index 000000000..ea7368adf
--- /dev/null
+++ b/plugins/Irc/extlib/phergie/Phergie/ExtendedConfig.php
@@ -0,0 +1,26 @@
+<?php
+class Phergie_Extended_Config extends Phergie_Config {
+ /**
+ * Incorporates an associative array of settings into the current
+ * configuration settings.
+ *
+ * @param array $array Array of settings
+ *
+ * @return Phergie_Config Provides a fluent interface
+ * @throws Phergie_Config_Exception
+ */
+ public function readArray($array) {
+ $settings = $array;
+ if (!is_array($settings)) {
+ throw new Phergie_Config_Exception(
+ 'Parameter is not an array',
+ Phergie_Config_Exception::ERR_ARRAY_NOT_RETURNED
+ );
+ }
+
+ $this->files[$file] = array_keys($settings);
+ $this->settings += $settings;
+
+ return $this;
+ }
+}