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: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76:
<?php
namespace Dropbox;
/**
* Base class for API authorization-related classes.
*/
class AuthBase
{
/**
* Whatever AppInfo was passed into the constructor.
*
* @return AppInfo
*/
function getAppInfo() { return $this->appInfo; }
/** @var AppInfo */
protected $appInfo;
/**
* An identifier for the API client, typically of the form "Name/Version".
* This is used to set the HTTP `User-Agent` header when making API requests.
* Example: `"PhotoEditServer/1.3"`
*
* If you're the author a higher-level library on top of the basic SDK, and the
* "Photo Edit" app's server code is using your library to access Dropbox, you should append
* your library's name and version to form the full identifier. For example,
* if your library is called "File Picker", you might set this field to:
* `"PhotoEditServer/1.3 FilePicker/0.1-beta"`
*
* The exact format of the `User-Agent` header is described in
* <a href="http://tools.ietf.org/html/rfc2616#section-3.8">section 3.8 of the HTTP specification</a>.
*
* Note that underlying HTTP client may append other things to the `User-Agent`, such as
* the name of the library being used to actually make the HTTP request (such as cURL).
*
* @return string
*/
function getClientIdentifier() { return $this->clientIdentifier; }
/** @var string */
protected $clientIdentifier;
/**
* The locale of the user of your application. Some API calls return localized
* data and error messages; this "user locale" setting determines which locale
* the server should use to localize those strings.
*
* @return null|string
*/
function getUserLocale() { return $this->userLocale; }
/** @var string */
protected $userLocale;
/**
* Constructor.
*
* @param AppInfo $appInfo
* See {@link getAppInfo()}
* @param string $clientIdentifier
* See {@link getClientIdentifier()}
* @param null|string $userLocale
* See {@link getUserLocale()}
*/
function __construct($appInfo, $clientIdentifier, $userLocale = null)
{
AppInfo::checkArg("appInfo", $appInfo);
Client::checkClientIdentifierArg("clientIdentifier", $clientIdentifier);
Checker::argStringNonEmptyOrNull("userLocale", $userLocale);
$this->appInfo = $appInfo;
$this->clientIdentifier = $clientIdentifier;
$this->userLocale = $userLocale;
}
}