Skip to content

Upgrade the Demo Application to Symfony 3.1 #338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed

Upgrade the Demo Application to Symfony 3.1 #338

wants to merge 16 commits into from

Conversation

javiereguiluz
Copy link
Member

This fixes #337.

"incenteev/composer-parameter-handler" : "^2.0",
"ircmaxell/password-compat" : "^1.0",
"leafo/scssphp" : "^0.4",
"patchwork/jsqueeze" : "^1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest also migrating to version 2

@stof
Copy link
Member

stof commented May 31, 2016

var/bootstrap.php.cache should not be committed

@stof
Copy link
Member

stof commented May 31, 2016

the bin/console file is missing

@stof
Copy link
Member

stof commented May 31, 2016

Given the 2 above issues, I suspect you did the git add call before changing the gitignore file...

@javiereguiluz
Copy link
Member Author

javiereguiluz commented May 31, 2016

In eba83d9 you can see that I reverted some changes related to logs and DB and that were introduced to make this app more Heroku-friendly:

  1. First, errors in prod environment are logged again in var/logs/prod.log which is what every Symfony developer expects. Otherwise, debugging errors is more complicated than it should.
  2. The database_url option doesn't work for me. The prod environment simply returns 500 for every request. Using the common path and driver options solved this for me.

@stof
Copy link
Member

stof commented Jun 2, 2016

The database_url option doesn't work for me. The prod environment simply returns 500 for every request.

Have you checked the logs to see what the error is ? It would be great to identify the bug rather than just saying it is buggy and avoiding its usage.

@javiereguiluz
Copy link
Member Author

javiereguiluz commented Jun 2, 2016

@stof you are right. I apologize! I didn't want to sound harsh. Here are the details.


With this config:

doctrine:
    dbal:
        driver: "pdo_sqlite"
        path:   "%kernel.root_dir%/../var/data/blog.sqlite"

The app works in prod.


With this other config:

parameters:
    database_url: 'sqlite:///%kernel.root_dir%/../var/data/blog.sqlite'

doctrine:
    dbal:
        url: "%database_url%"

Every page shows a 500 error because of this:

[2016-06-02 11:56:03] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime:
"An exception has been thrown during the rendering of a template: "An exception occurred
while executing 'SELECT ... FROM symfony_demo_post s0_ WHERE ...' with params
["2016-06-02 11:56:03"]: 

SQLSTATE[HY000]: General error: 1 no such table: symfony_demo_post"
in "blog/index.html.twig" at line 6."

@stof
Copy link
Member

stof commented Jun 2, 2016

that looks weird.

@voronkovich
Copy link
Contributor

It seems like it creates a new database instead of using an existing one

@xabbuh
Copy link
Member

xabbuh commented Jun 5, 2016

You need to update the app_dev.php file too. (Never mind, it's already up-to-date).

@javiereguiluz
Copy link
Member Author

This is ready for the final review. Thanks!

@@ -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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use a new array syntax. This converter can help you https://github.com/thomasbachem/php-short-array-syntax-converter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree ... but let's do that in a separate PR to not complicate this one too much. In fact, let's push PHP to use as many PHP 5.5 features as we can, not only the short array syntax.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javiereguiluz
Copy link
Member Author

Let's merge this change to test it a bit before releasing the new version of the demo app. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrading to Symfony 3
4 participants