forked from ThePhalcons/AmazonWebServicesBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create initial service configuration
- Loading branch information
Mark Badolato
committed
Nov 24, 2011
1 parent
3e4795b
commit 0d8cc0d
Showing
10 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Cybernox\AmazonWebServicesBundle; | ||
|
||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
|
||
class CybernoxAmazonWebServicesBundle extends Bundle | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Cybernox\AmazonWebServicesBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
class Configuration implements ConfigurationInterface | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getConfigTreeBuilder() | ||
{ | ||
$treeBuilder = new TreeBuilder(); | ||
$rootNode = $treeBuilder->root('cybernox_amazon_web_services'); | ||
|
||
$rootNode | ||
->children() | ||
->scalarNode('key')->isRequired()->end() | ||
->scalarNode('secret_key')->isRequired()->end() | ||
->scalarNode('account_id')->end() | ||
->scalarNode('canonical_id')->end() | ||
->scalarNode('canonical_name')->end() | ||
->scalarNode('mfa_serial')->end() | ||
->scalarNode('cloudfront_keypair_id')->end() | ||
->scalarNode('cloudfront_private_key_pem')->end() | ||
->scalarNode('default_cache_config')->end() | ||
->booleanNode('enable_extensions')->defaultFalse()->end() | ||
->booleanNode('certificate_authority')->defaultFalse()->end() | ||
->end(); | ||
|
||
return $treeBuilder; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
DependencyInjection/CybernoxAmazonWebServicesExtension.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Cybernox\AmazonWebServicesBundle\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
use Symfony\Component\DependencyInjection\Loader; | ||
|
||
class CybernoxAmazonWebServicesExtension extends Extension | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$configuration = new Configuration(); | ||
$config = $this->processConfiguration($configuration, $configs); | ||
|
||
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
$loader->load('services.xml'); | ||
|
||
foreach ($config as $key => $value) | ||
{ | ||
$container->setParameter('cybernox_amazon_web_services.' . $key, $value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<parameters> | ||
<parameter key="aws_sqs.class">Cybernox\AmazonWebServicesBundle\WebServices\SimpleQueueService</parameter> | ||
</parameters> | ||
|
||
<services> | ||
<service id="aws_sqs" class="%aws_sqs.class%"> | ||
</service> | ||
</services> | ||
</container> |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Cybernox\AmazonWebServicesBundle\Tests\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
class DefaultControllerTest extends WebTestCase | ||
{ | ||
public function testIndex() | ||
{ | ||
$client = static::createClient(); | ||
|
||
$crawler = $client->request('GET', '/hello/Fabien'); | ||
|
||
$this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Cybernox\AmazonWebServicesBundle\WebServices; | ||
|
||
use AWS\services\AmazonSQS as WebService; | ||
use AWS\services\SQS_Exception as WebServiceException; | ||
|
||
class SimpleQueueService extends WebServices implements WebServicesInterface | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Cybernox\AmazonWebServicesBundle\WebServices; | ||
|
||
abstract class WebServices | ||
{ | ||
private $service = null; | ||
|
||
public function __construct() | ||
{ | ||
echo "I'm in the WebService"; | ||
//$this->service = new WebService(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Cybernox\AmazonWebServicesBundle\WebServices; | ||
|
||
interface WebServicesInterface | ||
{ | ||
|
||
} |