Skip to content

Commit

Permalink
Added easy aliasing of kris.facebook service.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriswallsmith committed Jul 9, 2010
1 parent 6a7490a commit 4911ad9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DependencyInjection/FacebookExtension.php
Expand Up @@ -20,6 +20,10 @@ public function apiLoad($config, BuilderConfiguration $configuration)
$configuration->merge($loader->load($this->resources['facebook']));
}

if (isset($config['alias'])) {
$configuration->setAlias($config['alias'], 'kris.facebook');
}

foreach (array('class', 'app_id', 'secret', 'cookie', 'domain', 'logging', 'culture') as $attribute) {
if (isset($config[$attribute])) {
$configuration->setParameter('kris.facebook.'.$attribute, $config[$attribute]);
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -32,12 +32,14 @@ Installation

# application/config/config.yml
facebook.api:
alias: facebook
app_id: 123456879
secret: s3cr3t
cookie: true

# application/config/config.xml
<facebook:api
alias="facebook"
app_id="123456879"
secret="s3cr3t"
cookie="true"
Expand Down
1 change: 1 addition & 0 deletions Resources/config/schema/facebook-1.0.xsd
Expand Up @@ -7,6 +7,7 @@

<xsd:element name="facebook">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="class" type="xsd:string" />
<xsd:attribute name="app_id" type="xsd:integer" />
<xsd:attribute name="secret" type="xsd:string" />
Expand Down

0 comments on commit 4911ad9

Please sign in to comment.