Skip to content

Commit

Permalink
feature #338 Upgrade the Demo Application to Symfony 3.1 (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the master branch (closes #338).

Discussion
----------

Upgrade the Demo Application to Symfony 3.1

This fixes #337.

Commits
-------

56cfa66 Upgrade the Demo Application to Symfony 3.1
  • Loading branch information
javiereguiluz committed Jun 19, 2016
2 parents 8d82d04 + 56cfa66 commit 4f1abb7
Show file tree
Hide file tree
Showing 19 changed files with 364 additions and 421 deletions.
21 changes: 13 additions & 8 deletions .gitignore
@@ -1,11 +1,16 @@
/app/config/parameters.yml
/app/bootstrap.php.cache
/app/cache/*
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep
/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/
/bin/
/composer.phar
web/bundles/whiteoctoberpagerfanta
/web/bundles/
4 changes: 1 addition & 3 deletions .travis.yml
Expand Up @@ -8,8 +8,6 @@ cache:
matrix:
fast_finish: true
include:
- php: 5.3
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
Expand All @@ -25,4 +23,4 @@ install:
- composer install

script:
- phpunit -c app
- phpunit
15 changes: 15 additions & 0 deletions app/AppKernel.php
Expand Up @@ -40,6 +40,21 @@ public function registerBundles()
return $bundles;
}

public function getRootDir()
{
return __DIR__;
}

public function getCacheDir()
{
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}

public function getLogDir()
{
return dirname(__DIR__).'/var/logs';
}

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
Expand Down
4 changes: 1 addition & 3 deletions app/autoload.php
Expand Up @@ -3,13 +3,11 @@
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;

error_reporting(error_reporting() & ~E_USER_DEPRECATED);

/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
AnnotationRegistry::registerLoader([$loader, 'loadClass']);

return $loader;
8 changes: 5 additions & 3 deletions app/config/config.yml
Expand Up @@ -44,8 +44,8 @@ framework:
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
handler_id: session.handler.native_file
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
fragments: ~
http_method_override: true
assets: ~
Expand Down Expand Up @@ -77,7 +77,9 @@ doctrine:
# them from the app/config/parameters.yml file. The reason is that config.yml
# stores options that change the application behavior and parameters.yml
# stores options that change from one server to another
url: "%database_url%"
driver: "pdo_sqlite"
# temp workaround for https://github.com/doctrine/dbal/issues/1106: define DB path here
path: "%kernel.root_dir%/../var/data/blog.sqlite"

orm:
auto_generate_proxy_classes: "%kernel.debug%"
Expand Down
2 changes: 1 addition & 1 deletion app/config/config_prod.yml
Expand Up @@ -21,7 +21,7 @@ monolog:
handler: nested
nested:
type: stream
path: "php://stderr"
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
44 changes: 0 additions & 44 deletions app/phpunit.xml.dist

This file was deleted.

2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -27,4 +27,4 @@ install:

test_script:
- cd %APPVEYOR_BUILD_FOLDER%
- php phpunit.phar -c app --verbose
- php phpunit.phar --verbose
2 changes: 1 addition & 1 deletion app/console → bin/console
Expand Up @@ -14,7 +14,7 @@ set_time_limit(0);
/**
* @var Composer\Autoload\ClassLoader $loader
*/
$loader = require __DIR__.'/autoload.php';
$loader = require __DIR__.'/../app/autoload.php';

$input = new ArgvInput();
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
Expand Down
3 changes: 2 additions & 1 deletion app/check.php → bin/symfony_requirements 100644 → 100755
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php

require_once dirname(__FILE__).'/SymfonyRequirements.php';
require_once dirname(__FILE__).'/../var/SymfonyRequirements.php';

$lineSize = 70;
$symfonyRequirements = new SymfonyRequirements();
Expand Down
41 changes: 22 additions & 19 deletions composer.json
Expand Up @@ -10,27 +10,27 @@
"require": {
"php" : ">=5.3.9",
"ext-pdo_sqlite" : "*",
"doctrine/doctrine-bundle" : "~1.5",
"doctrine/doctrine-fixtures-bundle" : "~2.2",
"doctrine/orm" : "~2.4",
"erusev/parsedown" : "~1.5",
"ezyang/htmlpurifier" : "~4.7",
"incenteev/composer-parameter-handler" : "~2.1",
"ircmaxell/password-compat" : "~1.0",
"leafo/scssphp" : "^0.4.0",
"patchwork/jsqueeze" : "~1.0",
"sensio/distribution-bundle" : "~5.0",
"sensio/framework-extra-bundle" : "~3.0",
"symfony/assetic-bundle" : "~2.6",
"symfony/monolog-bundle" : "~2.7",
"symfony/polyfill-intl-icu" : "^1.2",
"symfony/swiftmailer-bundle" : "~2.3",
"symfony/symfony" : "~2.8",
"twig/extensions" : "~1.2",
"doctrine/doctrine-bundle" : "^1.6",
"doctrine/doctrine-fixtures-bundle" : "^2.2",
"doctrine/orm" : "^2.5",
"erusev/parsedown" : "^1.5",
"ezyang/htmlpurifier" : "^4.7",
"incenteev/composer-parameter-handler" : "^2.0",
"ircmaxell/password-compat" : "^1.0",
"leafo/scssphp" : "^0.5",
"patchwork/jsqueeze" : "^2.0",
"sensio/distribution-bundle" : "^5.0",
"sensio/framework-extra-bundle" : "^3.0",
"symfony/assetic-bundle" : "^2.8",
"symfony/monolog-bundle" : "^2.8",
"symfony/swiftmailer-bundle" : "^2.3",
"symfony/symfony" : "^3.1",
"twig/extensions" : "^1.3",
"white-october/pagerfanta-bundle" : "^1.0"
},
"require-dev": {
"sensio/generator-bundle": "~3.0"
"sensio/generator-bundle" : "~3.0",
"symfony/phpunit-bridge" : "^3.0"
},
"scripts": {
"post-install-cmd": [
Expand All @@ -53,12 +53,15 @@
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.3.9"
"php": "5.5.9"
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml",
Expand Down

0 comments on commit 4f1abb7

Please sign in to comment.