diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..759e320 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +/app/config/parameters.yml +/build/ +/phpunit.xml +/var/* +!/var/cache +/var/cache/* +!var/cache/.gitkeep +!/var/logs +/var/logs/* +!var/logs/.gitkeep +!/var/sessions +/var/sessions/* +!var/sessions/.gitkeep +!var/SymfonyRequirements.php +/vendor/ +/web/bundles/ +/tags +Base +Map +/app/propel/ diff --git a/app/AppKernel.php b/app/AppKernel.php index 3789b32..790356f 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -15,7 +15,8 @@ class AppKernel extends Kernel new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), - new AppBundle\AppBundle(), + new Propel\Bundle\PropelBundle\PropelBundle(), + new NotifyBundle\NotifyBundle(), ]; if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { diff --git a/app/config/config.yml b/app/config/config.yml index d1c7cae..c60701b 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -2,6 +2,7 @@ imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: services.yml } + - { resource: "@NotifyBundle/Resources/config/services.yml" } # Put parameters here that don't need to change on each machine where the app is deployed # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration @@ -38,27 +39,17 @@ twig: debug: "%kernel.debug%" strict_variables: "%kernel.debug%" -# Doctrine Configuration -doctrine: - dbal: - driver: pdo_mysql - host: "%database_host%" - port: "%database_port%" - dbname: "%database_name%" - user: "%database_user%" - password: "%database_password%" - charset: UTF8 - # if using pdo_sqlite as your database driver: - # 1. add the path in parameters.yml - # e.g. database_path: "%kernel.root_dir%/data/data.db3" - # 2. Uncomment database_path in parameters.yml.dist - # 3. Uncomment next line: - # path: "%database_path%" - - orm: - auto_generate_proxy_classes: "%kernel.debug%" - naming_strategy: doctrine.orm.naming_strategy.underscore - auto_mapping: true +propel: + generator: + objectModel: + addClassLevelComment: false + database: + connections: + default: + adapter: %database_driver% + user: %database_user% + password: %database_password% + dsn: %database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset% # Swiftmailer Configuration swiftmailer: diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml index eaac609..1445f7e 100644 --- a/app/config/config_dev.yml +++ b/app/config/config_dev.yml @@ -31,5 +31,5 @@ monolog: # type: chromephp # level: info -#swiftmailer: -# delivery_address: me@example.com +swiftmailer: + delivery_address: dev@deblan.fr diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 886c92b..2d72e21 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -6,6 +6,8 @@ parameters: database_port: ~ database_name: symfony database_user: root + database_driver: mysql + database_charset: UTF8 database_password: ~ # You should uncomment this if you want use pdo_sqlite # database_path: "%kernel.root_dir%/data.db3" diff --git a/app/config/routing.yml b/app/config/routing.yml index 8eadc31..012fe67 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,3 +1,8 @@ +notify: + resource: "@NotifyBundle/Controller/" + type: annotation + prefix: / + app: resource: "@AppBundle/Controller/" type: annotation diff --git a/bin/symfony_requirements b/bin/symfony_requirements index 1eca671..7cd559a 100755 --- a/bin/symfony_requirements +++ b/bin/symfony_requirements @@ -7,7 +7,7 @@ $lineSize = 70; $symfonyRequirements = new SymfonyRequirements(); $iniPath = $symfonyRequirements->getPhpIniConfigPath(); -echo_title('Symfony2 Requirements Checker'); +echo_title('Symfony Requirements Checker'); echo '> PHP is using the following php.ini file:'.PHP_EOL; if ($iniPath) { @@ -43,9 +43,9 @@ foreach ($symfonyRequirements->getRecommendations() as $req) { } if ($checkPassed) { - echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects'); + echo_block('success', 'OK', 'Your system is ready to run Symfony projects'); } else { - echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects'); + echo_block('error', 'ERROR', 'Your system is not ready to run Symfony projects'); echo_title('Fix the following mandatory requirements', 'red'); diff --git a/composer.json b/composer.json index fe8fa2a..95980b4 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,10 @@ "symfony/monolog-bundle": "^2.8", "sensio/distribution-bundle": "^5.0", "sensio/framework-extra-bundle": "^3.0.2", - "incenteev/composer-parameter-handler": "^2.0" + "incenteev/composer-parameter-handler": "^2.0", + "symfony/dom-crawler": "^3.0", + "propel/propel": "dev-master", + "propel/propel-bundle": "2.0.x-dev" }, "require-dev": { "sensio/generator-bundle": "^3.0", diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php deleted file mode 100644 index 5d4bb7e..0000000 --- a/src/AppBundle/Controller/DefaultController.php +++ /dev/null @@ -1,21 +0,0 @@ -render('default/index.html.twig', [ - 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'), - ]); - } -} diff --git a/src/NotifyBundle/Controller/.DefaultController.php.swp b/src/NotifyBundle/Controller/.DefaultController.php.swp new file mode 100644 index 0000000..7faad77 Binary files /dev/null and b/src/NotifyBundle/Controller/.DefaultController.php.swp differ diff --git a/src/NotifyBundle/Controller/DefaultController.php b/src/NotifyBundle/Controller/DefaultController.php new file mode 100644 index 0000000..6235f6d --- /dev/null +++ b/src/NotifyBundle/Controller/DefaultController.php @@ -0,0 +1,17 @@ +render('NotifyBundle:Default:index.html.twig'); + } +} diff --git a/src/AppBundle/AppBundle.php b/src/NotifyBundle/NotifyBundle.php similarity index 51% rename from src/AppBundle/AppBundle.php rename to src/NotifyBundle/NotifyBundle.php index 05123b6..6628cc9 100644 --- a/src/AppBundle/AppBundle.php +++ b/src/NotifyBundle/NotifyBundle.php @@ -1,9 +1,9 @@ + + diff --git a/src/NotifyBundle/Resources/config/services.yml b/src/NotifyBundle/Resources/config/services.yml new file mode 100644 index 0000000..ac2ea26 --- /dev/null +++ b/src/NotifyBundle/Resources/config/services.yml @@ -0,0 +1,4 @@ +services: +# notify.example: +# class: NotifyBundle\Example +# arguments: ["@service_id", "plain_value", %parameter%] diff --git a/src/NotifyBundle/Resources/views/Default/index.html.twig b/src/NotifyBundle/Resources/views/Default/index.html.twig new file mode 100644 index 0000000..980a0d5 --- /dev/null +++ b/src/NotifyBundle/Resources/views/Default/index.html.twig @@ -0,0 +1 @@ +Hello World! diff --git a/src/NotifyBundle/Tests/Controller/DefaultControllerTest.php b/src/NotifyBundle/Tests/Controller/DefaultControllerTest.php new file mode 100644 index 0000000..f690098 --- /dev/null +++ b/src/NotifyBundle/Tests/Controller/DefaultControllerTest.php @@ -0,0 +1,17 @@ +request('GET', '/'); + + $this->assertContains('Hello World', $client->getResponse()->getContent()); + } +}