PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 1.2.9
JetBackup – Backup, Restore & Migrate v1.2.9
3.1.22.3 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.8.1 1.4.9 1.5.0 1.5.1 1.5.1.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.10 1.6.11 1.6.12 1.6.13 1.6.15 1.6.5.1 1.6.8.8 1.6.9 1.6.9.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7.5 2.0.8.7 2.0.9.11 2.0.9.14 2.0.9.15 2.0.9.6 2.0.9.7 2.0.9.9 3.1.10.7 3.1.11.1 3.1.12.3 3.1.13.4 3.1.14.17 3.1.15.4 3.1.16.1 3.1.17.5 3.1.18.10 3.1.18.8 3.1.18.9 3.1.19.8 3.1.20.3 3.1.21.3 3.1.7.9 3.1.9.2 trunk 1.1.90 1.1.91 1.2.0 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2
backup / com / lib / Dropbox / Host.php
backup / com / lib / Dropbox Last commit date
Exception 6 years ago WebAuthException 6 years ago certs 6 years ago AppInfo.php 6 years ago AppInfoLoadException.php 6 years ago ArrayEntryStore.php 6 years ago AuthBase.php 6 years ago AuthInfo.php 6 years ago AuthInfoLoadException.php 6 years ago Checker.php 6 years ago Client.php 6 years ago Curl.php 6 years ago CurlStreamRelay.php 6 years ago DeserializeException.php 6 years ago DropboxMetadataHeaderCatcher.php 6 years ago Exception.php 6 years ago Host.php 6 years ago HttpResponse.php 6 years ago OAuth1AccessToken.php 6 years ago OAuth1Upgrader.php 6 years ago Path.php 6 years ago RequestUtil.php 6 years ago RootCertificates.php 6 years ago SSLTester.php 6 years ago Security.php 6 years ago StreamReadException.php 6 years ago Util.php 6 years ago ValueStore.php 6 years ago WebAuth.php 6 years ago WebAuthBase.php 6 years ago WebAuthNoRedirect.php 6 years ago WriteMode.php 6 years ago autoload.php 6 years ago strict.php 6 years ago
Host.php
101 lines
1 <?php
2 namespace Dropbox;
3
4 /**
5 * The Dropbox web API accesses three hosts; this structure holds the
6 * names of those three hosts. This is primarily for mocking things out
7 * during testing. Most of the time you won't have to deal with this class
8 * directly, and even when you do, you'll just use the default
9 * value: {@link Host::getDefault()}.
10 *
11 * @internal
12 */
13 final class Host
14 {
15 /**
16 * Returns a Host object configured with the three standard Dropbox host: "api.dropbox.com",
17 * "api-content.dropbox.com", and "www.dropbox.com"
18 *
19 * @return Host
20 */
21 static function getDefault()
22 {
23 if (!self::$defaultValue) {
24 //self::$defaultValue = new Host("api.dropbox.com", "api-content.dropbox.com", "www.dropbox.com");
25 self::$defaultValue = new Host("api.dropboxapi.com", "content.dropboxapi.com", "www.dropbox.com");
26 }
27 return self::$defaultValue;
28 }
29 private static $defaultValue;
30
31 /** @var string */
32 private $api;
33 /** @var string */
34 private $content;
35 /** @var string */
36 private $web;
37
38 /**
39 * Constructor.
40 *
41 * @param string $api
42 * See {@link getApi()}
43 * @param string $content
44 * See {@link getContent()}
45 * @param string $web
46 * See {@link getWeb()}
47 */
48 function __construct($api, $content, $web)
49 {
50 $this->api = $api;
51 $this->content = $content;
52 $this->web = $web;
53 }
54
55 /**
56 * Returns the host name of the main Dropbox API server.
57 * The default is "api.dropbox.com".
58 *
59 * @return string
60 */
61 function getApi() { return $this->api; }
62
63 /**
64 * Returns the host name of the Dropbox API content server.
65 * The default is "api-content.dropbox.com".
66 *
67 * @return string
68 */
69 function getContent() { return $this->content; }
70
71 /**
72 * Returns the host name of the Dropbox web server. Used during user authorization.
73 * The default is "www.dropbox.com".
74 *
75 * @return string
76 */
77 function getWeb() { return $this->web; }
78
79 /**
80 * Check that a function argument is of type <code>Host</code>.
81 *
82 * @internal
83 */
84 static function checkArg($argName, $argValue)
85 {
86 if (!($argValue instanceof self)) Checker::throwError($argName, $argValue, __CLASS__);
87 }
88
89 /**
90 * Check that a function argument is either <code>null</code> or of type
91 * <code>Host</code>.
92 *
93 * @internal
94 */
95 static function checkArgOrNull($argName, $argValue)
96 {
97 if ($argValue === null) return;
98 if (!($argValue instanceof self)) Checker::throwError($argName, $argValue, __CLASS__);
99 }
100 }
101