/** * Get a reference to the Telephony driver currently instantiated * @return Telephony_Driver */ public static function getDriver() { if (!self::$driverName and Kohana::config('telephony.driver')) { Telephony::setDriver(Kohana::config('telephony.driver')); } return self::$driver; }
public function preTransactionBegin(Doctrine_Event $event) { // We get here when a DB transaction is about to occur. Assume a telephony config file might need to be updated and // prepare any related telephony drivers. If no driver is specified, we don't do anything here. // THIS IS WHERE WE INSTANTIATE THE SWITCH-SPECIFIC DRIVER! if (Kohana::config('telephony.driver') && Kohana::config('telephony.diskoutput')) { // Only work on actions that give us a base model $base = Bluebox_Record::getBaseTransactionObject(); if ($base) { Kohana::log('debug', 'Telephony -> Instantiated our telephony driver to handle new transaction'); Telephony::setDriver(Kohana::config('telephony.driver')); TelephonyListener::$changedModels = array(); } } }