@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | private $exec; |
16 | 16 | |
17 | - public function __construct(string $container, string $connection_string) { |
|
17 | + public function __construct (string $container, string $connection_string) { |
|
18 | 18 | $this->exec = new CommandRunner(); |
19 | 19 | |
20 | 20 | $this->connection_string = $connection_string; |
@@ -31,22 +31,22 @@ discard block |
||
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | - protected function run($cmd) : string { |
|
34 | + protected function run ($cmd) : string { |
|
35 | 35 | $logfile = $this->exec->run(CommandRunner::COMMAND_SYNC, __DIR__, $cmd, true); |
36 | 36 | $log = $logfile->getText(); |
37 | 37 | $logfile->delete(); |
38 | 38 | return $log; |
39 | 39 | } |
40 | 40 | |
41 | - public function getContainer() : string { |
|
41 | + public function getContainer () : string { |
|
42 | 42 | return $this->container; |
43 | 43 | } |
44 | 44 | |
45 | - public function getAccountName() : string { |
|
45 | + public function getAccountName () : string { |
|
46 | 46 | $this->account_name; |
47 | 47 | } |
48 | 48 | |
49 | - public function uploadToBlob(string $file, string $name, string $content_type = null) { |
|
49 | + public function uploadToBlob (string $file, string $name, string $content_type = null) { |
|
50 | 50 | if (!file_exists($file) || !is_file($file)) { |
51 | 51 | throw new Exception("Invalid file"); |
52 | 52 | } |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | return $log; |
71 | 71 | } |
72 | 72 | |
73 | - public function GenerateBlobSas(string $name, int $expire = 5 * 60 * 60, string $ip = null) : string { |
|
73 | + public function GenerateBlobSas (string $name, int $expire = 5 * 60 * 60, string $ip = null) : string { |
|
74 | 74 | $signedPermissions = "r"; |
75 | 75 | //$signedStart = gmdate("Y-m-d\TH:i\Z", time()); |
76 | 76 | $signedExpiry = gmdate("Y-m-d\TH:i\Z", time() + $expire); |
77 | 77 | $signedProtocol = "https"; |
78 | - $signedVersion = "2017-07-29";//"2016-05-31"; |
|
78 | + $signedVersion = "2017-07-29"; //"2016-05-31"; |
|
79 | 79 | |
80 | 80 | $parameters = array(); |
81 | 81 | $parameters[] = $signedPermissions; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return $sas; |
122 | 122 | } |
123 | 123 | |
124 | - public function getBlobUrl(string $name) { |
|
124 | + public function getBlobUrl (string $name) { |
|
125 | 125 | $url = "https://" . $this->account_name . ".blob.core.windows.net/" . $this->container . "/" . $name; |
126 | 126 | return $url; |
127 | 127 | } |