Skip to content

Commit 9097c80

Browse files
committed
Case 27611; Corrected check for S3.
1 parent 0a0e292 commit 9097c80

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Command/SiteDbImportCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Symfony\Component\Console\Input\InputOption;
1313
use Symfony\Component\Console\Input\InputInterface;
1414
use Symfony\Component\Console\Output\OutputInterface;
15+
use Aws\S3\S3Client;
1516
use DennisDigital\Drupal\Console\Exception\SiteCommandException;
1617
use DennisDigital\Drupal\Console\Command\Shared\SiteInstallArgumentsTrait;
1718

@@ -61,7 +62,7 @@ protected function configure() {
6162
'region' => 'eu-west-1',
6263
'version' => 'latest',
6364
];
64-
$client = new Aws\S3\S3Client($options);
65+
$client = new S3Client($options);
6566
$client->registerStreamWrapper();
6667
}
6768

@@ -260,12 +261,11 @@ protected function execute(InputInterface $input, OutputInterface $output) {
260261
*/
261262
protected function download($filename) {
262263
$tmp_folder = '/tmp/';
263-
$meta = stream_get_meta_data($filename);
264264

265265
// Save the dbdump to a local destination.
266266
//
267267
// @todo Use of 's3cmd' can be removed once s3 wrapper is aware of access creds.
268-
if ($meta['wrapper_type'] === 's3') {
268+
if ('s3' === parse_url($filename, PHP_URL_SCHEME)) {
269269
$command = sprintf(
270270
'cd %s && ' .
271271
's3cmd --force get %s',

0 commit comments

Comments
 (0)