From c43e7daefedea7873bea74bc84214e2e36c0c5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 18 Mar 2016 10:28:26 +0100 Subject: [PATCH] initial commit --- ChillEventBundle.php | 9 +++ Controller/DefaultController.php | 13 +++++ DependencyInjection/ChillEventExtension.php | 45 +++++++++++++++ DependencyInjection/Configuration.php | 29 ++++++++++ Resources/config/routing.yml | 3 + Resources/config/services.yml | 4 ++ Resources/views/Default/index.html.twig | 1 + Tests/Controller/DefaultControllerTest.php | 17 ++++++ composer.json | 61 +++++++++++++++++++++ 9 files changed, 182 insertions(+) create mode 100644 ChillEventBundle.php create mode 100644 Controller/DefaultController.php create mode 100644 DependencyInjection/ChillEventExtension.php create mode 100644 DependencyInjection/Configuration.php create mode 100644 Resources/config/routing.yml create mode 100644 Resources/config/services.yml create mode 100644 Resources/views/Default/index.html.twig create mode 100644 Tests/Controller/DefaultControllerTest.php create mode 100644 composer.json diff --git a/ChillEventBundle.php b/ChillEventBundle.php new file mode 100644 index 000000000..dc040dac6 --- /dev/null +++ b/ChillEventBundle.php @@ -0,0 +1,9 @@ +render('ChillEventBundle:Default:index.html.twig', array('name' => $name)); + } +} diff --git a/DependencyInjection/ChillEventExtension.php b/DependencyInjection/ChillEventExtension.php new file mode 100644 index 000000000..89eb98c57 --- /dev/null +++ b/DependencyInjection/ChillEventExtension.php @@ -0,0 +1,45 @@ +processConfiguration($configuration, $configs); + + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.yml'); + } + + /* (non-PHPdoc) + * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() + */ + public function prepend(ContainerBuilder $container) + { + + //add routes for custom bundle + $container->prependExtensionConfig('chill_main', array( + 'routing' => array( + 'resources' => array( + '@ChillEventBundle/Resources/config/routing.yml' + ) + ) + )); + } +} diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php new file mode 100644 index 000000000..26441ce71 --- /dev/null +++ b/DependencyInjection/Configuration.php @@ -0,0 +1,29 @@ +root('chill_event'); + + // 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; + } +} diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml new file mode 100644 index 000000000..712a131e6 --- /dev/null +++ b/Resources/config/routing.yml @@ -0,0 +1,3 @@ +chill_event_homepage: + path: /hello/{name} + defaults: { _controller: ChillEventBundle:Default:index } diff --git a/Resources/config/services.yml b/Resources/config/services.yml new file mode 100644 index 000000000..d2cfb62f0 --- /dev/null +++ b/Resources/config/services.yml @@ -0,0 +1,4 @@ +services: +# chill_event.example: +# class: Chill\EventBundle\Example +# arguments: [@service_id, "plain_value", %parameter%] diff --git a/Resources/views/Default/index.html.twig b/Resources/views/Default/index.html.twig new file mode 100644 index 000000000..4ce626e9b --- /dev/null +++ b/Resources/views/Default/index.html.twig @@ -0,0 +1 @@ +Hello {{ name }}! diff --git a/Tests/Controller/DefaultControllerTest.php b/Tests/Controller/DefaultControllerTest.php new file mode 100644 index 000000000..5c2a813f4 --- /dev/null +++ b/Tests/Controller/DefaultControllerTest.php @@ -0,0 +1,17 @@ +request('GET', '/hello/Fabien'); + + $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); + } +} diff --git a/composer.json b/composer.json new file mode 100644 index 000000000..14fc5af95 --- /dev/null +++ b/composer.json @@ -0,0 +1,61 @@ +{ + "name": "chill-project/event", + "description": "This bundle extend chill software. This bundle allow to define event and participation to those events.", + "type": "symfony-bundle", + "license": "AGPL-3.0", + "keywords" : ["chill", "social work"], + "homepage" : "https://git.framasoft.org/Chill-project/Chill-Group", + "autoload": { + "psr-4": { "Chill\\EventBundle\\": "" } + }, + "support": { + "issues": "https://git.framasoft.org/Chill-project/Chill-Event/issues", + "source": "https://git.framasoft.org/Chill-project/Chill-Event", + "docs" : "http://docs.chill.social", + "email": "dev@listes.chill.social" + }, + "authors": [ + { + "name": "Champs-Libres", + "email": "info@champs-libres.coop" + } + ], + "require": { + "twig/extensions": "^1.2", + "symfony/assetic-bundle": "~2.3", + "symfony/framework-bundle": "~2.7", + "symfony/yaml": "~2.8", + "symfony/symfony": "~2.8", + "doctrine/dbal": "~2.5", + "doctrine/orm": "~2.4", + "doctrine/common": "~2.4", + "doctrine/doctrine-bundle": "~1.2", + "chill-project/main": "dev-master@dev", + "chill-project/person": "dev-master@dev", + "champs-libres/composer-bundle-migration": "~1.0", + "doctrine/doctrine-migrations-bundle": "~1.1", + "chill-project/custom-fields": "dev-master@dev", + "doctrine/migrations": "~1.0", + "monolog/monolog": "^1.14" + }, + "require-dev": { + "doctrine/doctrine-fixtures-bundle": "~2.2", + "fzaninotto/faker": "~1", + "symfony/monolog-bundle": "^2.7", + "sensio/generator-bundle": "^2.5" + }, + "suggest" : { + "chill-project/group": "dev-master@dev" + }, + "scripts": { + "post-install-cmd": [ + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + ], + "post-update-cmd": [ + "ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations" + ] + }, + "extra": { + "app-migrations-dir": "Resources/test/Fixtures/App/DoctrineMigrations" + } +}