Conditions | 2 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public function sync(Target $target, Result $result) |
||
33 | { |
||
34 | $sourcePath = $target->getPathname(); |
||
35 | $targetPath = $this->path . $target->getFilename(); |
||
36 | |||
37 | $s3 = S3Client::factory( |
||
1 ignored issue
–
show
|
|||
38 | [ |
||
39 | 'signature' => 'v4', |
||
40 | 'region' => $this->region, |
||
41 | 'credentials' => [ |
||
42 | 'key' => $this->key, |
||
43 | 'secret' => $this->secret, |
||
44 | ] |
||
45 | ] |
||
46 | ); |
||
47 | |||
48 | try { |
||
49 | $fh = fopen($sourcePath, 'r'); |
||
50 | $s3->upload($this->bucket, $targetPath, $fh, $this->acl); |
||
51 | } catch (\Exception $e) { |
||
52 | throw new Exception($e->getMessage(), null, $e); |
||
53 | } |
||
54 | |||
55 | $result->debug('upload: done'); |
||
56 | } |
||
57 | } |
||
58 |
This method has been deprecated.