mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-11-04 03:08:25 +00:00 
			
		
		
		
	initial commit
This commit is contained in:
		
							
								
								
									
										9
									
								
								ChillEventBundle.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								ChillEventBundle.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Chill\EventBundle;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
 | 
			
		||||
 | 
			
		||||
class ChillEventBundle extends Bundle
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										13
									
								
								Controller/DefaultController.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Controller/DefaultController.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Chill\EventBundle\Controller;
 | 
			
		||||
 | 
			
		||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 | 
			
		||||
 | 
			
		||||
class DefaultController extends Controller
 | 
			
		||||
{
 | 
			
		||||
    public function indexAction($name)
 | 
			
		||||
    {
 | 
			
		||||
        return $this->render('ChillEventBundle:Default:index.html.twig', array('name' => $name));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										45
									
								
								DependencyInjection/ChillEventExtension.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								DependencyInjection/ChillEventExtension.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Chill\EventBundle\DependencyInjection;
 | 
			
		||||
 | 
			
		||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
 | 
			
		||||
use Symfony\Component\Config\FileLocator;
 | 
			
		||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Loader;
 | 
			
		||||
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 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 ChillEventExtension 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');
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
     /* (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'
 | 
			
		||||
              )
 | 
			
		||||
           )
 | 
			
		||||
        ));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								DependencyInjection/Configuration.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								DependencyInjection/Configuration.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Chill\EventBundle\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('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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										3
									
								
								Resources/config/routing.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								Resources/config/routing.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
chill_event_homepage:
 | 
			
		||||
    path:     /hello/{name}
 | 
			
		||||
    defaults: { _controller: ChillEventBundle:Default:index }
 | 
			
		||||
							
								
								
									
										4
									
								
								Resources/config/services.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								Resources/config/services.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
services:
 | 
			
		||||
#    chill_event.example:
 | 
			
		||||
#        class: Chill\EventBundle\Example
 | 
			
		||||
#        arguments: [@service_id, "plain_value", %parameter%]
 | 
			
		||||
							
								
								
									
										1
									
								
								Resources/views/Default/index.html.twig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								Resources/views/Default/index.html.twig
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
Hello {{ name }}!
 | 
			
		||||
							
								
								
									
										17
									
								
								Tests/Controller/DefaultControllerTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Tests/Controller/DefaultControllerTest.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Chill\EventBundle\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);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										61
									
								
								composer.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								composer.json
									
									
									
									
									
										Normal file
									
								
							@@ -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"
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user