Shout: Add VFS initialization for voice prompts
authorBen Klang <ben@alkaloid.net>
Tue, 16 Mar 2010 20:44:27 +0000 (16:44 -0400)
committerBen Klang <ben@alkaloid.net>
Wed, 17 Mar 2010 16:25:30 +0000 (12:25 -0400)
shout/config/conf.xml
shout/lib/Application.php

index 869af71..9138f8d 100644 (file)
    </configswitch>
   </configsection>
  </configtab>
+ <configtab name="vfs" desc="IVR Prompt Storage">
+  <configsection name="vfs">
+   <configheader>IVR Prompt Storage Settings</configheader>
+   <configvfs switchname="type"/>
+  </configsection>
+ </configtab>
 </configuration>
 
index cdbaaa4..9b230d6 100644 (file)
@@ -65,6 +65,11 @@ class Shout_Application extends Horde_Registry_Application
     /**
      * TODO
      */
+    public $vfs = null;
+
+    /**
+     * TODO
+     */
     static protected $_perms = array();
 
     /**
@@ -74,12 +79,14 @@ class Shout_Application extends Horde_Registry_Application
      */
     protected function _init()
     {
-        $this->storage = Shout_Driver::factory('storage');
-        $this->extensions = Shout_Driver::factory('extensions');
-        $this->devices = Shout_Driver::factory('devices');
-        $this->dialplan = Shout_Driver::factory('dialplan');
-
         try {
+            $this->storage = Shout_Driver::factory('storage');
+            $this->extensions = Shout_Driver::factory('extensions');
+            $this->devices = Shout_Driver::factory('devices');
+            $this->dialplan = Shout_Driver::factory('dialplan');
+            $conf = $GLOBALS['conf'];
+            $this->vfs = VFS::singleton($conf['vfs']['driver'], $conf['vfs']['params']);
+
             $accounts = $this->storage->getAccounts();
         } catch (Shout_Exception $e) {
             $GLOBALS['notification']->push($e);