Skip to content

Commit 4a18f20

Browse files
Merge branch main into 6.0
2 parents 724e451 + 27b7cab commit 4a18f20

File tree

6 files changed

+68
-49
lines changed

6 files changed

+68
-49
lines changed

build.xml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
</copy>
137137

138138
<!-- AMAZON AWS -->
139-
<copy file="${basedir}/vendor/aws/aws-sdk-php/LICENSE.md" tofile="${basedir}/build/phar/lib/aws-sdk/LICENSE"/>
139+
<copy file="${basedir}/vendor/aws/aws-sdk-php/LICENSE" tofile="${basedir}/build/phar/lib/aws-sdk/LICENSE"/>
140140
<copy todir="${basedir}/build/phar/lib/aws-sdk">
141141
<fileset dir="${basedir}/vendor/aws/aws-sdk-php/src">
142142
<include name="**/*.php"/>
@@ -413,14 +413,6 @@
413413
<include name="**/*.php"/>
414414
</fileset>
415415
</copy>
416-
<copy file="${basedir}/vendor/psr/log/LICENSE"
417-
tofile="${basedir}/build/phar/lib/psr/log/LICENSE"/>
418-
<copy todir="${basedir}/build/phar/lib/psr/log">
419-
<fileset dir="${basedir}/vendor/psr/log/Psr">
420-
<include name="**/*.php"/>
421-
</fileset>
422-
</copy>
423-
424416

425417
<!-- PHPSECLIB -->
426418
<copy file="${basedir}/vendor/phpseclib/phpseclib/LICENSE" tofile="${basedir}/build/phar/lib/phpseclib/LICENSE"/>
@@ -468,25 +460,6 @@
468460
</fileset>
469461
</copy>
470462

471-
<!-- OPENSTACK -->
472-
<copy file="${basedir}/vendor/php-opencloud/openstack/LICENSE"
473-
tofile="${basedir}/build/phar/lib/php-opencloud/openstack/LICENSE"/>
474-
<copy todir="${basedir}/build/phar/lib/php-opencloud/openstack">
475-
<fileset dir="${basedir}/vendor/php-opencloud/openstack/src">
476-
<include name="**/*.php"/>
477-
<exclude name="**/Test*"/>
478-
</fileset>
479-
</copy>
480-
481-
<copy file="${basedir}/vendor/justinrainbow/json-schema/LICENSE"
482-
tofile="${basedir}/build/phar/lib/justinrainbow/json-schema/LICENSE"/>
483-
<copy todir="${basedir}/build/phar/lib/justinrainbow/json-schema">
484-
<fileset dir="${basedir}/vendor/justinrainbow/json-schema/src">
485-
<include name="**/*.php"/>
486-
<exclude name="**/Test*"/>
487-
</fileset>
488-
</copy>
489-
490463
<!-- PHP-HTTP -->
491464
<copy file="${basedir}/vendor/php-http/httplug/LICENSE"
492465
tofile="${basedir}/build/phar/lib/php-http/httplug/LICENSE"/>
@@ -545,15 +518,7 @@
545518
</fileset>
546519
</copy>
547520

548-
<copy file="${basedir}/vendor/zendframework/zend-diactoros/LICENSE.md"
549-
tofile="${basedir}/build/phar/lib/zendframework/zend-diactoros/LICENSE"/>
550-
<copy todir="${basedir}/build/phar/lib/zendframework/zend-diactoros">
551-
<fileset dir="${basedir}/vendor/zendframework/zend-diactoros/src">
552-
<include name="**/*.php"/>
553-
</fileset>
554-
</copy>
555-
556-
<copy file="${basedir}/vendor/league/event/LICENCE"
521+
<copy file="${basedir}/vendor/league/event/LICENSE"
557522
tofile="${basedir}/build/phar/lib/league/event/LICENSE"/>
558523
<copy todir="${basedir}/build/phar/lib/league/event">
559524
<fileset dir="${basedir}/vendor/league/event/src">

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
"ext-json": "*",
5050
"ext-spl": "*",
5151
"sebastian/environment": "^3.0|^4.0|^5.0",
52-
"sebastianfeldmann/cli": "^3.4"
52+
"sebastianfeldmann/cli": "^3.4",
53+
"symfony/process": "^3.0|^4.0|^5.0|^6.0"
5354
},
5455
"require-dev": {
5556
"sebastianfeldmann/git": "^3.2",
5657
"sebastianfeldmann/ftp": "^0.9",
57-
"guzzlehttp/guzzle": "^5.3.3|^6.2.1",
58+
"guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0.0",
5859
"aws/aws-sdk-php": "^3.10",
5960
"kunalvarma05/dropbox-php-sdk": "^0.2",
60-
"tightenco/collect": "^5.0",
6161
"phpseclib/phpseclib": "^2.0",
6262
"softlayer/objectstorage": "dev-master",
6363
"vlucas/phpdotenv": "^4.0",

phive.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpunit" version="^9.4.3" location="./tools/phpunit" copy="true" installed="9.5.9"/>
4-
<phar name="phpab" version="^1.20.0" location="./tools/phpab" copy="true" installed="1.26.3"/>
5-
<phar name="phpcs" version="^3.5.2" location="./tools/phpcs" copy="true" installed="3.6.0"/>
3+
<phar name="phpunit" version="^9.4.3" location="./tools/phpunit" copy="true" installed="9.5.19"/>
4+
<phar name="phpab" version="^1.20.0" location="./tools/phpab" copy="true" installed="1.27.1"/>
5+
<phar name="phpcs" version="^3.5.2" location="./tools/phpcs" copy="true" installed="3.6.2"/>
66
<phar name="phpstan" version="^0.12.2" location="./tools/phpstan" copy="true" installed="0.12.99"/>
77
</phive>

src/Backup/Cli.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use phpbu\App\Configuration;
77
use phpbu\App\Util;
88
use SebastianFeldmann\Cli\Command\Runner;
9+
use SebastianFeldmann\Cli\Processor\Symfony;
910

1011
/**
1112
* Base class for Actions using cli tools.
@@ -49,7 +50,7 @@ abstract class Cli
4950
*/
5051
public function __construct(Runner $runner = null, $time = null)
5152
{
52-
$this->runner = $runner ? : new Runner\Simple();
53+
$this->runner = $runner ? : new Runner\Simple(new Symfony());
5354
$this->time = $time ? : time();
5455
}
5556

src/Backup/File/GoogleDrive.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class GoogleDrive extends Remote
2121
/**
2222
* Google drive api service.
2323
*
24-
* @var \Google_Service_Drive
24+
* @var Google_Service_Drive
2525
*/
2626
private $service;
2727

@@ -35,23 +35,23 @@ class GoogleDrive extends Remote
3535
/**
3636
* Constructor.
3737
*
38-
* @param \Google_Service_Drive $service
39-
* @param \Google_Service_Drive_DriveFile $googleFile
38+
* @param Google_Service_Drive $service
39+
* @param Google_Service_Drive_DriveFile $googleFile
4040
*/
4141
public function __construct(Google_Service_Drive $service, Google_Service_Drive_DriveFile $googleFile)
4242
{
4343
$this->service = $service;
4444
$this->filename = $googleFile->getName();
4545
$this->pathname = $googleFile->getId();
4646
$this->fileId = $googleFile->getId();
47-
$this->size = $googleFile->getSize();
47+
$this->size = (int) $googleFile->getSize();
4848
$this->lastModified = strtotime($googleFile->getCreatedTime());
4949
}
5050

5151
/**
5252
* Deletes the file from Google Drive.
5353
*
54-
* @throws \phpbu\App\Exception
54+
* @throws Exception
5555
*/
5656
public function unlink()
5757
{

src/Backup/Sync/WasabiS3.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
namespace phpbu\App\Backup\Sync;
4+
5+
use Aws\S3\S3Client;
6+
7+
/**
8+
* Wasabi Sync
9+
*
10+
* Docs example
11+
* https://wasabi-support.zendesk.com/hc/en-us/articles/360015106031-What-are-the-service-URLs-for-Wasabi-s-different-storage-regions-
12+
* https://wasabi-support.zendesk.com/hc/en-us/articles/360000363572-How-do-I-use-AWS-SDK-for-PHP-with-Wasabi-
13+
*
14+
* @package phpbu
15+
* @subpackage Backup
16+
* @author Angel Fernandez <@angelfplaza>
17+
* @copyright Ángel Fernández - WPHercules <@wphercules>
18+
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
19+
* @link http://phpbu.de/
20+
*/
21+
class WasabiS3 extends AmazonS3v3
22+
{
23+
24+
/**
25+
* Create the Wasabi AWS client.
26+
*
27+
* @return \Aws\S3\S3Client
28+
*/
29+
protected function createClient() : S3Client
30+
{
31+
$endpoint = $this->createEndpoint();
32+
33+
return new S3Client([
34+
'endpoint' => $endpoint,
35+
'region' => $this->region,
36+
'version' => 'latest',
37+
'credentials' => [
38+
'key' => $this->key,
39+
'secret' => $this->secret,
40+
]
41+
]);
42+
}
43+
44+
/**
45+
* Generate Wasabi enpoint
46+
*
47+
* @return string
48+
*/
49+
protected function createEndpoint()
50+
{
51+
return str_replace('{region}', $this->region, 'https://s3.{region}.wasabisys.com');
52+
}
53+
}

0 commit comments

Comments
 (0)