From 14bee92e0106133167160147c633ecfb0a740a06 Mon Sep 17 00:00:00 2001 From: Michael Kimsal Date: Wed, 7 Jul 2010 22:13:15 -0400 Subject: [PATCH] adding url and twilio initializers --- application/bootstrap.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/application/bootstrap.php b/application/bootstrap.php index 3d4be5b..aa57b3e 100644 --- a/application/bootstrap.php +++ b/application/bootstrap.php @@ -36,6 +36,23 @@ public function _initView() return $view; } + public function _initBase() + { +// need a better way - $_SERVER data isn't available in phpunit mode - config vars? +// Zend_Registry::set("baseUrl","http://".$_SERVER['HTTP_HOST'].Zend_Controller_Front::getInstance()->getBaseUrl()); + Zend_Registry::set("baseUrl","http://zfkit.com/twilio/public".Zend_Controller_Front::getInstance()->getBaseUrl()); + } + + public function _initTwilio() + { + $config = $this->getOption("twilio"); + Zend_Registry::set("twilioBaseUrl", $config['endpoint']."/Accounts/".$config['accountSid']); + Zend_Registry::set("twilioConfig", $config); + $w = new Zend_Log_Writer_Stream($config['outlog']); + $log = new Zend_Log($w); + Zend_Registry::set("twiliolog", $log); + } + /** * if you want true zend-framework 'rest'-style URLs * with all that entails, uncomment this method