/usr/share/php/Horde/Service/Facebook/Videos.php is in php-horde-service-facebook 2.0.10-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | <?php
/**
* Videos methods
*
* Copyright 2009-2017 Horde LLC (http://www.horde.org/)
*
* @author Michael J. Rubinsky <mrubinsk@horde.org>
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Videos extends Horde_Service_Facebook_Base
{
/**
* Uploads a video.
*
* @param array $params The parameter array.
* - file: (string) A local path to the file to upload.
* DEFAULT: none REQUIRED
* - caption: (string) The photo caption.
* DEFAULT: None.
* - uid: (string) The Facebook UID of where to post the video to. Normally
* a user id.
* DEFAULT: None (Will upload on behalf of the current user).
* @return array An array of user objects
*/
public function upload(array $params = array())
{
// Requires either a owner_uid or a session_key
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'photos.addTag requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
if (empty($params['file'])) {
throw new InvalidArgumentException('Missing required file parameter.');
}
// Build the data to send.
$data = array(
'message' => empty($params['caption']) ? '' : $params['caption']
);
$uid = empty($params['uid']) ? 'me/videos' : $params['uid'] . '/videos';
$request = new Horde_Service_Facebook_Request_Graph($this->_facebook, $uid);
return $request->upload(array('params' => $data, 'file' => $params['file']));
}
}
|