From 13ac007c2a8d5ea17a2d0188ff49b3d3894271d5 Mon Sep 17 00:00:00 2001 From: 4Giedrius <4giedrius@gmail.com> Date: Thu, 22 Jan 2015 11:45:55 +0200 Subject: [PATCH] Service Centovacast fixes --- src/bb-modules/Servicecentovacast/Service.php | 7 ++++--- src/bb-modules/Servicecentovacast/ccapiclient.php | 3 +++ src/bb-modules/Servicecentovacast/class_HTTPRetriever.php | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bb-modules/Servicecentovacast/Service.php b/src/bb-modules/Servicecentovacast/Service.php index 25b1b7b91..9e97e5069 100644 --- a/src/bb-modules/Servicecentovacast/Service.php +++ b/src/bb-modules/Servicecentovacast/Service.php @@ -89,9 +89,9 @@ class Service implements \Box\InjectionAwareInterface if(APPLICATION_ENV == 'testing') { $config = array(); - $config['url'] = 'http://castdemo.centova.com'; + $config['url'] = 'http://castdemo.centova.com:2199'; $config['secret'] = 'example'; - $config['ip'] = '123.123.123'; + $config['ip'] = '123.123.123.123'; $config['hostname'] = 'castdemo.centova.com'; return $config; } @@ -398,10 +398,11 @@ class Service implements \Box\InjectionAwareInterface */ private function _apiSystemCall($server, $method, $params = array()) { - require_once(dirname(__FILE__).'/ccapiclient/ccapiclient.php'); + require_once(dirname(__FILE__).'/ccapiclient.php'); $centovacast_url = $server['url']; $admin_password = $server['secret']; $system = new CCSystemAPIClient($centovacast_url); + $system->cc_initialize($centovacast_url); $system->call($method, $admin_password, $params); if (!$system->success) { diff --git a/src/bb-modules/Servicecentovacast/ccapiclient.php b/src/bb-modules/Servicecentovacast/ccapiclient.php index e73498141..6cc5872ee 100644 --- a/src/bb-modules/Servicecentovacast/ccapiclient.php +++ b/src/bb-modules/Servicecentovacast/ccapiclient.php @@ -12,6 +12,8 @@ * calls to what would be the public methods of each class. * */ +namespace Box\Mod\Servicecentovacast; + require_once(dirname(__FILE__) . '/class_HTTPRetriever.php'); // This library was originally designed to support object overloading, but @@ -51,6 +53,7 @@ class CCBaseAPIClient { function cc_initialize($ccurl) { $this->ccurl = $ccurl; $this->http = new HTTPRetriever(); + $this->http->HTTPRetriever(); $this->http->headers["User-Agent"] = 'CentovaCast PHP API Client'; } diff --git a/src/bb-modules/Servicecentovacast/class_HTTPRetriever.php b/src/bb-modules/Servicecentovacast/class_HTTPRetriever.php index 171c2db69..2113c3bb7 100644 --- a/src/bb-modules/Servicecentovacast/class_HTTPRetriever.php +++ b/src/bb-modules/Servicecentovacast/class_HTTPRetriever.php @@ -1,4 +1,5 @@