Propel init
This commit is contained in:
parent
c67bc1c50f
commit
8a037f95e9
20
.gitignore
vendored
Normal file
20
.gitignore
vendored
Normal file
|
@ -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/
|
|
@ -15,7 +15,8 @@ class AppKernel extends Kernel
|
||||||
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
||||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
||||||
new AppBundle\AppBundle(),
|
new Propel\Bundle\PropelBundle\PropelBundle(),
|
||||||
|
new NotifyBundle\NotifyBundle(),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
|
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ imports:
|
||||||
- { resource: parameters.yml }
|
- { resource: parameters.yml }
|
||||||
- { resource: security.yml }
|
- { resource: security.yml }
|
||||||
- { resource: services.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
|
# 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
|
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
|
||||||
|
@ -38,27 +39,17 @@ twig:
|
||||||
debug: "%kernel.debug%"
|
debug: "%kernel.debug%"
|
||||||
strict_variables: "%kernel.debug%"
|
strict_variables: "%kernel.debug%"
|
||||||
|
|
||||||
# Doctrine Configuration
|
propel:
|
||||||
doctrine:
|
generator:
|
||||||
dbal:
|
objectModel:
|
||||||
driver: pdo_mysql
|
addClassLevelComment: false
|
||||||
host: "%database_host%"
|
database:
|
||||||
port: "%database_port%"
|
connections:
|
||||||
dbname: "%database_name%"
|
default:
|
||||||
user: "%database_user%"
|
adapter: %database_driver%
|
||||||
password: "%database_password%"
|
user: %database_user%
|
||||||
charset: UTF8
|
password: %database_password%
|
||||||
# if using pdo_sqlite as your database driver:
|
dsn: %database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%
|
||||||
# 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
|
|
||||||
|
|
||||||
# Swiftmailer Configuration
|
# Swiftmailer Configuration
|
||||||
swiftmailer:
|
swiftmailer:
|
||||||
|
|
|
@ -31,5 +31,5 @@ monolog:
|
||||||
# type: chromephp
|
# type: chromephp
|
||||||
# level: info
|
# level: info
|
||||||
|
|
||||||
#swiftmailer:
|
swiftmailer:
|
||||||
# delivery_address: me@example.com
|
delivery_address: dev@deblan.fr
|
||||||
|
|
|
@ -6,6 +6,8 @@ parameters:
|
||||||
database_port: ~
|
database_port: ~
|
||||||
database_name: symfony
|
database_name: symfony
|
||||||
database_user: root
|
database_user: root
|
||||||
|
database_driver: mysql
|
||||||
|
database_charset: UTF8
|
||||||
database_password: ~
|
database_password: ~
|
||||||
# You should uncomment this if you want use pdo_sqlite
|
# You should uncomment this if you want use pdo_sqlite
|
||||||
# database_path: "%kernel.root_dir%/data.db3"
|
# database_path: "%kernel.root_dir%/data.db3"
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
notify:
|
||||||
|
resource: "@NotifyBundle/Controller/"
|
||||||
|
type: annotation
|
||||||
|
prefix: /
|
||||||
|
|
||||||
app:
|
app:
|
||||||
resource: "@AppBundle/Controller/"
|
resource: "@AppBundle/Controller/"
|
||||||
type: annotation
|
type: annotation
|
||||||
|
|
|
@ -7,7 +7,7 @@ $lineSize = 70;
|
||||||
$symfonyRequirements = new SymfonyRequirements();
|
$symfonyRequirements = new SymfonyRequirements();
|
||||||
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
|
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
|
||||||
|
|
||||||
echo_title('Symfony2 Requirements Checker');
|
echo_title('Symfony Requirements Checker');
|
||||||
|
|
||||||
echo '> PHP is using the following php.ini file:'.PHP_EOL;
|
echo '> PHP is using the following php.ini file:'.PHP_EOL;
|
||||||
if ($iniPath) {
|
if ($iniPath) {
|
||||||
|
@ -43,9 +43,9 @@ foreach ($symfonyRequirements->getRecommendations() as $req) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($checkPassed) {
|
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 {
|
} 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');
|
echo_title('Fix the following mandatory requirements', 'red');
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,10 @@
|
||||||
"symfony/monolog-bundle": "^2.8",
|
"symfony/monolog-bundle": "^2.8",
|
||||||
"sensio/distribution-bundle": "^5.0",
|
"sensio/distribution-bundle": "^5.0",
|
||||||
"sensio/framework-extra-bundle": "^3.0.2",
|
"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": {
|
"require-dev": {
|
||||||
"sensio/generator-bundle": "^3.0",
|
"sensio/generator-bundle": "^3.0",
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace AppBundle\Controller;
|
|
||||||
|
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
|
|
||||||
class DefaultController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @Route("/", name="homepage")
|
|
||||||
*/
|
|
||||||
public function indexAction(Request $request)
|
|
||||||
{
|
|
||||||
// replace this example code with whatever you need
|
|
||||||
return $this->render('default/index.html.twig', [
|
|
||||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
BIN
src/NotifyBundle/Controller/.DefaultController.php.swp
Normal file
BIN
src/NotifyBundle/Controller/.DefaultController.php.swp
Normal file
Binary file not shown.
17
src/NotifyBundle/Controller/DefaultController.php
Normal file
17
src/NotifyBundle/Controller/DefaultController.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace NotifyBundle\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||||
|
|
||||||
|
class DefaultController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @Route("/")
|
||||||
|
*/
|
||||||
|
public function indexAction()
|
||||||
|
{
|
||||||
|
return $this->render('NotifyBundle:Default:index.html.twig');
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace AppBundle;
|
namespace NotifyBundle;
|
||||||
|
|
||||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
|
||||||
class AppBundle extends Bundle
|
class NotifyBundle extends Bundle
|
||||||
{
|
{
|
||||||
}
|
}
|
3
src/NotifyBundle/Resources/config/propel/schema.xml
Normal file
3
src/NotifyBundle/Resources/config/propel/schema.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<database defaultIdMethod="native" name="default" namespace="NotifyBundle\Model">
|
||||||
|
</database>
|
4
src/NotifyBundle/Resources/config/services.yml
Normal file
4
src/NotifyBundle/Resources/config/services.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
services:
|
||||||
|
# notify.example:
|
||||||
|
# class: NotifyBundle\Example
|
||||||
|
# arguments: ["@service_id", "plain_value", %parameter%]
|
1
src/NotifyBundle/Resources/views/Default/index.html.twig
Normal file
1
src/NotifyBundle/Resources/views/Default/index.html.twig
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Hello World!
|
17
src/NotifyBundle/Tests/Controller/DefaultControllerTest.php
Normal file
17
src/NotifyBundle/Tests/Controller/DefaultControllerTest.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace NotifyBundle\Tests\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
|
class DefaultControllerTest extends WebTestCase
|
||||||
|
{
|
||||||
|
public function testIndex()
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
|
||||||
|
$crawler = $client->request('GET', '/');
|
||||||
|
|
||||||
|
$this->assertContains('Hello World', $client->getResponse()->getContent());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue