| 1 | <?php |
||
| 4 | class DropboxApp |
||
| 5 | { |
||
| 6 | |||
| 7 | /** |
||
| 8 | * The Client ID of the App |
||
| 9 | * |
||
| 10 | * @link https://www.dropbox.com/developers/apps |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $clientId; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The Client Secret of the App |
||
| 18 | * |
||
| 19 | * @link https://www.dropbox.com/developers/apps |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $clientSecret; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * The Access Token |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | protected $accessToken; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * The Refresh Token is a long-lived token that can be used to request new short-lived access tokens without |
||
| 34 | * direct interaction from a user in your app. |
||
| 35 | * |
||
| 36 | * @var string |
||
| 37 | */ |
||
| 38 | protected $refreshToken; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Create a new Dropbox instance |
||
| 42 | * |
||
| 43 | * @param string $clientId Application Client ID |
||
| 44 | * @param string $clientSecret Application Client Secret |
||
| 45 | * @param string $accessToken Access Token |
||
| 46 | */ |
||
| 47 | public function __construct($clientId, $clientSecret, $accessToken = null, $refreshToken = null) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Get the App Client ID |
||
| 57 | * |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function getClientId() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Get the App Client Secret |
||
| 67 | * |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | public function getClientSecret() |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Get the Access Token |
||
| 77 | * |
||
| 78 | * @return string |
||
| 79 | */ |
||
| 80 | public function getAccessToken() |
||
| 84 | |||
| 85 | /** |
||
| 86 | * Get the long lived Refresh Token |
||
| 87 | * |
||
| 88 | * @return string |
||
| 89 | */ |
||
| 90 | public function getRefreshToken() |
||
| 94 | } |
||
| 95 |