Skip to content

Commit 180728f

Browse files
author
Marco De Felice
committed
added s3 connector
1 parent 12a11a5 commit 180728f

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/Application/Service/TransferService.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,38 @@ private function __construct(ConnectionInterface $connection)
2525
*
2626
* @return ConnectionInterface
2727
*/
28-
public static function init($user, $password, $host, Protocol $type)
28+
public static function init($user, $password, $host, Protocol $type, array $options = [])
2929
{
3030
switch($type) {
3131
case Protocol::FTP:
3232
return new self(new FtpServiceConnection(
33-
$user, $password, $host
33+
$user, $password, $host, $options
3434
));
3535
break;
3636
case Protocol::SSH:
3737
return new self(new SFtpServiceConnection(
38-
$user, $password, $host
38+
$user, $password, $host, $options
3939
));
4040
break;
4141
}
4242
}
4343

44+
/**
45+
* instance of new TransferConnector
46+
* @param string $key
47+
* @param string $secret
48+
* @param string $region
49+
* @param array $options
50+
*
51+
* @return ConnectionInterface
52+
*/
53+
public static function initS3($key, $secret, $region, $options = [])
54+
{
55+
return new self(new AwsServiceConnection(
56+
$key, $secret, $region, $options
57+
));
58+
}
59+
4460
/**
4561
* Get the value of command
4662
*

0 commit comments

Comments
 (0)