|
@@ 45-47 (lines=3) @@
|
| 42 |
|
*/ |
| 43 |
|
public function getUrl($path) |
| 44 |
|
{ |
| 45 |
|
if (! is_array($this->urlVars) || sizeof($this->urlVars) !== 4) { |
| 46 |
|
throw new BadMethodCallException('Insufficient Url Params', 1); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
$urlBasePath = sprintf( |
| 50 |
|
'https://storage.%s.cloud.ovh.net/v1/AUTH_%s/%s/', |
|
@@ 74-76 (lines=3) @@
|
| 71 |
|
throw $e; |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
if (! is_array($this->urlVars) || sizeof($this->urlVars) !== 4) { |
| 75 |
|
throw new BadMethodCallException('Insufficient Url Params', 1); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
$urlBasePath = sprintf( |
| 79 |
|
'https://storage.%s.cloud.ovh.net/v1/AUTH_%s/%s/', |
|
@@ 98-100 (lines=3) @@
|
| 95 |
|
*/ |
| 96 |
|
public function getTemporaryUrl($path, $expiry = 60*60, $method = 'GET') |
| 97 |
|
{ |
| 98 |
|
if (! is_array($this->urlVars) || sizeof($this->urlVars) !== 4) { |
| 99 |
|
throw new BadMethodCallException('Insufficient Url Params', 1); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
$expiresAt = (int) (time() + $expiry); |
| 103 |
|
|