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/ccapiclient.php b/src/bb-modules/Servicecentovacast/ccapiclient.php old mode 100755 new mode 100644 similarity index 98% rename from src/bb-modules/Servicecentovacast/ccapiclient/ccapiclient.php rename to src/bb-modules/Servicecentovacast/ccapiclient.php index 94cf54c2f..6cc5872ee --- a/src/bb-modules/Servicecentovacast/ccapiclient/ccapiclient.php +++ b/src/bb-modules/Servicecentovacast/ccapiclient.php @@ -12,7 +12,9 @@ * calls to what would be the public methods of each class. * */ -require_once(dirname(__FILE__).'/class_HTTPRetriever.php'); +namespace Box\Mod\Servicecentovacast; + +require_once(dirname(__FILE__) . '/class_HTTPRetriever.php'); // This library was originally designed to support object overloading, but // PHP's support for this appears to be flaky and prone to segfaulting @@ -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/ccapiclient/class_HTTPRetriever.php b/src/bb-modules/Servicecentovacast/class_HTTPRetriever.php old mode 100755 new mode 100644 similarity index 99% rename from src/bb-modules/Servicecentovacast/ccapiclient/class_HTTPRetriever.php rename to src/bb-modules/Servicecentovacast/class_HTTPRetriever.php index 171c2db69..2113c3bb7 --- a/src/bb-modules/Servicecentovacast/ccapiclient/class_HTTPRetriever.php +++ b/src/bb-modules/Servicecentovacast/class_HTTPRetriever.php @@ -1,4 +1,5 @@