API_URL
API_URL = 'https://api.onedrive.com/v1.0'
getLogInUrl((array) $scopes, (string) $redirectUri, array $options = array()) : (string)
Gets the URL of the log in form. After login, the browser is redirected to the redirect URL, and a code is passed as a GET parameter to this URL.
The browser is also redirected to this URL if the user is already logged in.
(array) | $scopes |
|
(string) | $redirectUri |
|
array | $options |
The login URL.
obtainAccessToken((string) $clientSecret, (string) $code) : mixed
Obtains a new access token from OAuth. This token is valid for one hour.
(string) | $clientSecret |
|
(string) | $code |
|
fetchAccountInfo() : (object)
Fetches the account info of the current OneDrive account.
An object with the following properties: (string) id - OneDrive account ID. (string) first_name - account owner's first name. (string) last_name - account owner's last name. (string) name - account owner's full name. (string) gender - account owner's gender. (string) locale - account owner's locale.
updateObject(mixed $path, (array|object) $properties = array()) : mixed
Updates the properties of an object in the current OneDrive account.
mixed | $path | |
(array|object) | $properties |
|
Thrown on I/O errors.
createFolder(mixed $path, (string) $name, mixed $ondup = 'fail') : (\Folder)
Creates a folder in the current OneDrive account.
mixed | $path | |
(string) | $name |
|
mixed | $ondup |
The folder created, as a Folder instance referencing to the OneDrive folder created.
createFile(mixed $path = null, (string) $name, (string) $content = '') : (\File)
Creates a file in the current OneDrive account.
mixed | $path | |
(string) | $name |
|
(string) | $content |
|
Thrown on I/O errors.
The file created, as File instance referencing to the OneDrive file created.
_processResult((resource) $curl) : (object|string)
Processes a result returned by the OneDrive API call using a cURL object.
(resource) | $curl |
|
The content returned, as an object instance if served a JSON, or as a string if served as anything else.