Fix timeobjects' facebook driver, use binder
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 3 Jul 2010 17:09:40 +0000 (13:09 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 3 Jul 2010 17:11:18 +0000 (13:11 -0400)
framework/Core/lib/Horde/Registry.php
horde/services/facebook.php
timeobjects/lib/Driver/FacebookEvents.php

index d11d423..f9316b5 100644 (file)
@@ -259,6 +259,7 @@ class Horde_Registry
             'Horde_Prefs_Identity' => new Horde_Core_Binder_Identity(),
             // 'Horde_Registry' - initialized below
             'Horde_Secret' => new Horde_Core_Binder_Secret(),
+            'Horde_Service_Facebook' => new Horde_Core_Binder_Facebook(),
             'Horde_Service_Twitter' => new Horde_Core_Binder_Twitter(),
             'Horde_SessionHandler' => new Horde_Core_Binder_SessionHandler(),
             'Horde_Share' => new Horde_Core_Binder_Share(),
index fd46c5d..87d73bf 100644 (file)
@@ -13,9 +13,8 @@
 require_once dirname(__FILE__) . '/../lib/Application.php';
 Horde_Registry::appInit('horde');
 
-$GLOBALS['injector']->addBinder('Facebook', new Horde_Core_Binder_Facebook());
 try {
-    $facebook = $GLOBALS['injector']->getInstance('Facebook');
+    $facebook = $GLOBALS['injector']->getInstance('Horde_Service_Facebook');
 } catch (Horde_Exception $e) {
     $horde_url = Horde::url($registry->get('webroot', 'horde') . '/index.php');
     header('Location: ' . $horde_url);
index 790e1fb..0419d70 100644 (file)
@@ -84,11 +84,7 @@ class TimeObjects_Driver_FacebookEvents
             }
         }
 
-        $context = array('http_client' => new Horde_Http_Client(),
-                         'http_request' => new Horde_Controller_Request_Http());
-        $facebook = new Horde_Service_Facebook($conf['facebook']['key'],
-                                               $conf['facebook']['secret'],
-                                               $context);
+        $facebook = $GLOBALS['injector']->getInstance('Horde_Service_Facebook');
         $facebook->auth->setUser($this->_fb_session['uid'],
                                         $this->_fb_session['sid'],
                                         0);