File tree Expand file tree Collapse file tree 4 files changed +15
-16
lines changed Expand file tree Collapse file tree 4 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 5
5
[ ![ Latest Stable Version] ( https://poser.pugx.org/aws/aws-sdk-php-silex/v/stable.png )] ( https://packagist.org/packages/aws/aws-sdk-php-silex )
6
6
[ ![ Total Downloads] ( https://poser.pugx.org/aws/aws-sdk-php-silex/downloads.png )] ( https://packagist.org/packages/aws/aws-sdk-php-silex )
7
7
8
- A simple Silex service provider for including the [ AWS SDK for PHP] ( https://github.com/aws/aws-sdk-php ) .
8
+ A simple Silex 2 / Pimple 3 service provider for including the [ AWS SDK for PHP] ( https://github.com/aws/aws-sdk-php ) .
9
+
10
+ note:
11
+ If you are using the 1.x Silex version, Use [ version 2.x]
12
+ (https://github.com/aws/aws-sdk-php-silex/tree/2.0 ) of this provider.
9
13
10
14
## Installation
11
15
@@ -15,7 +19,7 @@ The AWS Service Provider can be installed via [Composer](http://getcomposer.org)
15
19
``` json
16
20
{
17
21
"require" : {
18
- "aws/aws-sdk-php-silex" : " ~2 .0"
22
+ "aws/aws-sdk-php-silex" : " ~3 .0"
19
23
}
20
24
}
21
25
```
Original file line number Diff line number Diff line change 14
14
"require" : {
15
15
"php" : " >=5.5" ,
16
16
"aws/aws-sdk-php" : " ~3.0" ,
17
- "silex/silex" : " 1.* "
17
+ "silex/silex" : " ^2.0 "
18
18
},
19
19
"autoload" : {
20
20
"psr-4" : {
28
28
},
29
29
"extra" : {
30
30
"branch-alias" : {
31
- "dev-master" : " 2 .0-dev"
31
+ "dev-master" : " 3 .0-dev"
32
32
}
33
33
},
34
34
"require-dev" : {
Original file line number Diff line number Diff line change 17
17
namespace Aws \Silex ;
18
18
19
19
use Aws \Sdk ;
20
+ use Pimple \Container ;
21
+ use Pimple \ServiceProviderInterface ;
20
22
use Silex \Application ;
21
- use Silex \ServiceProviderInterface ;
22
23
23
24
/**
24
25
* AWS SDK for PHP service provider for Silex applications
25
26
*/
26
27
class AwsServiceProvider implements ServiceProviderInterface
27
28
{
28
- const VERSION = '2 .0.2 ' ;
29
+ const VERSION = '3 .0.0 ' ;
29
30
30
- public function register (Application $ app )
31
+ public function register (Container $ container )
31
32
{
32
- $ app ['aws ' ] = $ app -> share ( function (Application $ app ) {
33
- $ config = isset ($ app ['aws.config ' ]) ? $ app ['aws.config ' ] : [];
33
+ $ container ['aws ' ] = function (Application $ container ) {
34
+ $ config = isset ($ container ['aws.config ' ]) ? $ container ['aws.config ' ] : [];
34
35
35
36
return new Sdk ($ config + ['ua_append ' => [
36
37
'Silex/ ' . Application::VERSION ,
37
38
'SXMOD/ ' . self ::VERSION ,
38
39
]]);
39
- });
40
- }
41
-
42
- public function boot (Application $ app )
43
- {
40
+ };
44
41
}
45
42
}
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ public function testRegisterAwsServiceProvider()
38
38
],
39
39
)
40
40
));
41
- $ provider ->boot ($ app );
42
41
43
42
// Get an instance of a client (S3) to use for testing
44
43
$ s3 = $ app ['aws ' ]->createS3 ();
@@ -66,7 +65,6 @@ public function testNoConfigProvided()
66
65
],
67
66
)
68
67
));
69
- $ provider ->boot ($ app );
70
68
71
69
// Instantiate a client, which should trigger an exception for missing configs
72
70
$ s3 = $ app ['aws ' ]->createS3 ();
You can’t perform that action at this time.
0 commit comments