Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertrand Dunogier committed Jul 10, 2013
0 parents commit 69d7615
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 0 deletions.
8 changes: 8 additions & 0 deletions BDIFTTTBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
namespace BD\Bundle\IFTTTBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class BDIFTTTBundle extends Bundle
{
}
21 changes: 21 additions & 0 deletions Controller/IFTTT.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* File containing the IFTTT controller.
*/
namespace BD\Bundle\IFTTTBundle\Controller;

use BD\Bundle\XmlRpcBundle\XmlRpc\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class IFTTT extends Controller
{
public function getRecentPosts()
{
return new Response( array() );
}

public function newPost()
{

}
}
27 changes: 27 additions & 0 deletions DependencyInjection/BDIFTTTExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
namespace BD\Bundle\IFTTTBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class BDIFTTTExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}
28 changes: 28 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
namespace BD\Bundle\IFTTTBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('bdifttt');

// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.

return $treeBuilder;
}
}
14 changes: 14 additions & 0 deletions Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bdifttt.getRecentPosts:
path: /xmlrpc/metaWeblog.getRecentPosts
defaults:
_controller: bdifttt.controller:getRecentPosts

bdifttt.supportedMethods:
path: /xmlrpc/mt.supportedMethods
defaults:
_controller: bdifttt.controller:supportedMethods

bdifttt.newPost:
path: /xmlrpc/metaWeblog.newPost
defaults:
_controller: bdifttt.controller:newPost
8 changes: 8 additions & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
bdifttt.controller.class: BD\Bundle\IFTTTBundle\Controller\IFTTT

services:
bdifttt.controller:
class: %bdifttt.controller.class%
calls:
- [ setContainer, [ @service_container ] ]
19 changes: 19 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "bdunogier/iftttbundle",
"description": "A generic Symfony 2 bundle that receives IFTTT recipe actions",
"license": "GPL-2.0",
"authors": [
{
"name": "Bertrand Dunogier",
"homepage": "https://github.com/bdunogier/iftttbundle"
}
],
"require": {
"bdunogier/xmlrpcbundle": "@dev"
},
"minimum-stability": "dev",
"autoload": {
"psr-0": {"BD\\Bundle\\IFTTTBundle": ""}
},
"target-dir": "BD/Bundle/IFTTTBundle"
}

0 comments on commit 69d7615

Please sign in to comment.