diff --git a/lib/classes/Bridge/Api/Dailymotion.php b/lib/classes/Bridge/Api/Dailymotion.php index 91b5227d20..9c5cec2529 100644 --- a/lib/classes/Bridge/Api/Dailymotion.php +++ b/lib/classes/Bridge/Api/Dailymotion.php @@ -278,7 +278,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I break; default: - throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); + throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object); break; } } @@ -378,7 +378,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I $result = $this->_api->call($url, $params, $this->oauth_token); break; default: - throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); + throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object); break; } @@ -402,7 +402,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I return $playlist["id"]; break; default: - throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); + throw new Bridge_Exception_ElementUnknown('Unknown element ' . $container_type); break; } } @@ -437,7 +437,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I return $this->get_container_from_id(self::CONTAINER_TYPE_PLAYLIST, $container_id); break; default: - throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $container); + throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $element_type); break; } break; @@ -582,7 +582,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I { switch ($record->get_type()) { case self::ELEMENT_TYPE_VIDEO : - $url_file = $this->_api->uploadFile($record->get_hd_file()->getRealPath(), $this->oauth_token); + $url_file = $this->_api->sendFile($record->get_hd_file()->getRealPath(), $this->oauth_token); $options = array_merge(array('url' => $url_file), $options); $video = $this->_api->call('POST /me/videos', $options, $this->oauth_token); diff --git a/lib/classes/Bridge/Api/Flickr.php b/lib/classes/Bridge/Api/Flickr.php index 64466833c2..25145109bc 100644 --- a/lib/classes/Bridge/Api/Flickr.php +++ b/lib/classes/Bridge/Api/Flickr.php @@ -205,9 +205,9 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf throw new Bridge_Exception_ApiConnectorRequestFailed('Unable to retrieve photoset infos for ' . $object); $xml = $response->getXml(); - $primary_photo = $this->get_element_from_id((string) $child['primary'], self::ELEMENT_TYPE_PHOTO); + $primary_photo = $this->get_element_from_id((string) $xml->photo['id'], self::ELEMENT_TYPE_PHOTO); - return new Bridge_Api_Flickr_Container($xml, $this->get_user_id(), $type, $primary_photo->get_thumbnail()); + return new Bridge_Api_Flickr_Container($xml, $this->get_user_id(), $object, $primary_photo->get_thumbnail()); break; default: throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object); @@ -288,7 +288,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf break; default: - throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); + throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object); break; } diff --git a/lib/classes/Bridge/Api/Interface.php b/lib/classes/Bridge/Api/Interface.php index 6036c33411..eb5c3b9a91 100644 --- a/lib/classes/Bridge/Api/Interface.php +++ b/lib/classes/Bridge/Api/Interface.php @@ -10,7 +10,7 @@ */ use Symfony\Component\Routing\Generator\UrlGenerator; - +use Symfony\Component\HttpFoundation\Request; /** * * @package Bridge diff --git a/lib/classes/Bridge/Api/Youtube.php b/lib/classes/Bridge/Api/Youtube.php index 9a166f0a64..2a64602b2f 100644 --- a/lib/classes/Bridge/Api/Youtube.php +++ b/lib/classes/Bridge/Api/Youtube.php @@ -327,7 +327,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter break; default: - throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); + throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object); break; } @@ -348,7 +348,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter $container_title = $request->get('f_container_title'); $new_playlist = $this->_api->newPlaylistListEntry(); - if (trim($description) !== '') + if (trim($container_desc) !== '') $new_playlist->description = $this->_api->newDescription()->setText($container_desc); $new_playlist->title = $this->_api->newTitle()->setText($container_title); @@ -359,7 +359,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter break; default: - throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type); + throw new Bridge_Exception_ElementUnknown('Unknown element ' . $container_type); break; } } @@ -389,7 +389,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter return new Bridge_Api_Youtube_Container($playlistEntry, $destination, null); break; default: - throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $container); + throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $destination); break; } break; diff --git a/lib/classes/DailymotionWithoutOauth2.php b/lib/classes/DailymotionWithoutOauth2.php index e14d496741..159381bb2b 100644 --- a/lib/classes/DailymotionWithoutOauth2.php +++ b/lib/classes/DailymotionWithoutOauth2.php @@ -75,7 +75,7 @@ class DailymotionWithoutOauth2 extends Dailymotion * * @return String the resulting URL */ - public function uploadFile($filePath, $oauth_token) + public function sendFile($filePath, $oauth_token) { $result = $this->call('file.upload', array(), $oauth_token); $timeout = $this->timeout;