| [ Index ] |
PHP Cross Reference of moodle-2.8 |
[Source view] [Print] [Project Stats]
Box.net client.
| Author: | James Levy <[email protected]> |
| Copyright: | copyright Box.net 2007 |
| License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
| Version: | 1.0 |
| File Size: | 913 lines (30 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
boxnet_client:: (14 methods):
auth_url()
create_folder()
download_file()
get_file_info()
get_folder_items()
log_out()
make_url()
rename_file()
reset_state()
revoke_url()
share_file()
search()
token_url()
upload_file()
boxclient:: (22 methods):
__construct()
makeRequest()
getTicket()
getAuthToken()
getfiletree()
get_file_info()
buildtree()
getAccountTree()
CreateFolder()
UploadFile()
RenameFile()
RegisterUser()
AddTag()
PublicShare()
GetFriends()
Logout()
_checkForError()
isError()
setError()
getErrorMsg()
getErrorCode()
_clearErrors()
Class: boxnet_client - X-Ref
Box.net client class.| auth_url() X-Ref |
| Return authorize URL. return: string |
| create_folder($foldername, $parentid = 0) X-Ref |
| Create a folder. param: string $foldername The folder name. param: int $parentid The ID of the parent folder. return: array Information about the new folder. |
| download_file($fileid, $path) X-Ref |
| Download the file. param: int $fileid File ID. param: string $path Path to download the file to. return: bool Success or not. |
| get_file_info($fileid) X-Ref |
| Get info of a file. param: int $fileid File ID. return: object |
| get_folder_items($folderid = 0) X-Ref |
| Get a folder content. param: int $folderid Folder ID. return: object |
| log_out() X-Ref |
| Log out. return: void |
| make_url($uri, $params = array() X-Ref |
| Build a request URL. param: string $uri The URI to request. param: array $params Query string parameters. param: bool $uploadapi Whether this works with the upload API or not. return: string |
| rename_file($fileid, $newname) X-Ref |
| Rename a file. param: int $fileid The file ID. param: string $newname The new file name. return: object Box.net file object. |
| reset_state() X-Ref |
| Resets curl for multiple requests. return: void |
| revoke_url() X-Ref |
| Return the revoke URL. return: string |
| share_file($fileid, $businesscheck = true) X-Ref |
| Share a file and return the link to it. param: string $fileid The file ID. param: bool $businesscheck Whether or not to check if the user can share files, has a business account. return: object |
| search($query) X-Ref |
| Search. return: object |
| token_url() X-Ref |
| Return token URL. return: string |
| upload_file(stored_file $storedfile, $parentid = 0) X-Ref |
| Upload a file. Please note that the file is named on Box.net using the path we are providing, and so the file has the name of the stored_file hash. param: stored_file $storedfile A stored_file. param: integer $parentid The ID of the parent folder. return: object Box.net file object. |
| __construct($api_key, $auth_token = '', $debug = false) X-Ref |
param: string $api_key param: string $auth_token param: bool $debug |
| makeRequest($method, $params = array() X-Ref |
| Setup for Functions param: string $method param: array $params return: array |
| getTicket($params = array() X-Ref |
param: array $params return: array |
| getAuthToken($ticket, $username, $password) X-Ref |
| $options['username'] and $options['password'] must be given, we will use them to obtain a valid auth_token To get a token, you should use following code: <code> $box = new boxclient('dmls97d8j3i9tn7av8y71m9eb55vrtj4'); Get a ticket $t = $box->getTicket(); $box->getAuthToken($t['ticket'], array( 'username'=>'[email protected]', 'password'=>'xxx')); </code> param: string $ticket param: string $username param: string $password return: mixed |
| getfiletree($path, $params = array() X-Ref |
param: string $path Unused param: array $params return: array |
| get_file_info($fileid, $timeout = 0) X-Ref |
| Get box.net file info param: string $fileid param: int $timeout request timeout in seconds return: stdClass|null |
| buildtree($sax, &$tree) X-Ref |
param: array $sax param: array $tree Passed by reference |
| getAccountTree($params = array() X-Ref |
param: array $params return: bool|array Array or false |
| CreateFolder($new_folder_name, $params = array() X-Ref |
param: string $new_folder_name param: array $params return: bool|array Array or false |
| UploadFile($params = array() X-Ref |
| Upload a File param: array $params the file MUST be present in key 'file' and be a moodle stored_file object. return: array|bool Array or false |
| RenameFile($fileid, $newname) X-Ref |
param: string $fileid param: string $newname return: bool |
| RegisterUser($params = array() X-Ref |
| Register New User param: array $params return: array|bool Outcome Array or false |
| AddTag($tag, $id, $target_type, $params = array() X-Ref |
| Add Tags (http://enabled.box.net/docs/rest#add_to_tag) param: string $tag param: string $id Set to ID of file or folder param: string $target_type File or folder param: array $params return: array|bool Outcome Array or false |
| PublicShare($message, $emails, $id, $target_type, $password, $params = array() X-Ref |
| Public Share (http://enabled.box.net/docs/rest#public_share) param: string $message param: string $emails param: string $id Set to ID of file or folder param: string $target_type File or folder param: string $password param: array $params return: array|bool Outcome Array or false |
| GetFriends($params = array() X-Ref |
| Get Friends (http://enabled.box.net/docs/rest#get_friends) param: array $params return: array|bool Outcome Array or false |
| Logout($params = array() X-Ref |
| Logout User (http://enabled.box.net/docs/rest#get_friends) param: array $params return: array|bool Outcome Array or false |
| _checkForError($data) X-Ref |
param: array $data return: bool |
| isError() X-Ref |
return: bool |
| setError($code = 0, $msg) X-Ref |
| No description |
| getErrorMsg() X-Ref |
return: string |
| getErrorCode() X-Ref |
return: string |
| _clearErrors() X-Ref |
| No description |
| Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |