From 55362c7e9b05c368c5d7fb3057591183ef40b494 Mon Sep 17 00:00:00 2001 From: Ruben Nijveld Date: Tue, 9 Dec 2014 16:45:40 +0100 Subject: [PATCH] Updated project to Symfony 2.6 (and other updated dependencies) --- app/AppKernel.php | 2 +- app/Resources/views/base.html.twig | 26 +++++++++---------- app/Resources/views/default/index.html.twig | 5 ++++ app/SymfonyRequirements.php | 14 ++++++++-- app/check.php | 2 +- app/config/config.yml | 9 +++++-- app/config/dev/config.yml | 15 +++++++++++ app/config/dev/routing.yml | 4 +++ app/config/prod/config.yml | 2 ++ app/config/services.yml | 7 +++++ app/config/test/config.yml | 2 +- bower.json | 4 +-- composer.json | 14 +++++----- package.json | 24 ++++++++--------- .../Controller/DefaultController.php | 17 ++++++++++++ .../DependencyInjection/AppExtension.php | 26 ------------------- .../DependencyInjection/Configuration.php | 20 -------------- src/AppBundle/Resources/config/services.yml | 4 --- web/app.php | 16 +++++++----- web/app_dev.php | 1 - web/app_test.php | 1 - 21 files changed, 116 insertions(+), 99 deletions(-) create mode 100644 app/Resources/views/default/index.html.twig create mode 100644 app/config/services.yml create mode 100644 src/AppBundle/Controller/DefaultController.php delete mode 100644 src/AppBundle/DependencyInjection/AppExtension.php delete mode 100644 src/AppBundle/DependencyInjection/Configuration.php delete mode 100644 src/AppBundle/Resources/config/services.yml diff --git a/app/AppKernel.php b/app/AppKernel.php index 6c4e35f..14b5907 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,7 +17,6 @@ public function registerBundles() new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), - new Bs\BootstrapifyBundle\BsBootstrapifyBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(), new Vich\UploaderBundle\VichUploaderBundle(), @@ -29,6 +28,7 @@ public function registerBundles() ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { + $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index eec3746..3358458 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -1,16 +1,16 @@ - - {% block head %} - - {% block title %}{{ sitename }}{% endblock %} - {% block stylesheets %}{% endblock %} - - {% block metas %}{% endblock %} - {% block javascripts %}{% endblock %} - {% endblock %} - - - {% block body %}{% endblock %} - + + {% block head %} + + {% block title %}{{ sitename }}{% endblock %} + {% block stylesheets %}{% endblock %} + + {% block metas %}{% endblock %} + {% block javascripts %}{% endblock %} + {% endblock %} + + + {% block body %}{% endblock %} + diff --git a/app/Resources/views/default/index.html.twig b/app/Resources/views/default/index.html.twig new file mode 100644 index 0000000..756d87c --- /dev/null +++ b/app/Resources/views/default/index.html.twig @@ -0,0 +1,5 @@ +{% extends 'base.html.twig' %} + +{% block body %} + Homepage. +{% endblock %} diff --git a/app/SymfonyRequirements.php b/app/SymfonyRequirements.php index 56bd35d..c4894c0 100644 --- a/app/SymfonyRequirements.php +++ b/app/SymfonyRequirements.php @@ -440,8 +440,8 @@ public function __construct() } $this->addRequirement( - isset($timezones[date_default_timezone_get()]), - sprintf('Configured default timezone "%s" must be supported by your installation of PHP', date_default_timezone_get()), + isset($timezones[@date_default_timezone_get()]), + sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()), 'Your default timezone is not supported by PHP. Check for typos in your php.ini file and have a look at the list of deprecated timezones at http://php.net/manual/en/timezones.others.php.' ); } @@ -530,6 +530,16 @@ function_exists('simplexml_import_dom'), 'Install the PCRE extension (version 8.0+).' ); + if (extension_loaded('mbstring')) { + $this->addPhpIniRequirement( + 'mbstring.func_overload', + create_function('$cfgValue', 'return (int) $cfgValue === 0;'), + true, + 'string functions should not be overloaded', + 'Set "mbstring.func_overload" to 0 in php.ini* to disable function overloading by the mbstring extension.' + ); + } + /* optional recommendations follow */ $this->addRecommendation( diff --git a/app/check.php b/app/check.php index bb0a20e..90bad4a 100644 --- a/app/check.php +++ b/app/check.php @@ -110,7 +110,7 @@ function echo_style($style, $message) ); $supports = has_color_support(); - echo ($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : ''); + echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : ''); } function echo_block($style, $title, $message) diff --git a/app/config/config.yml b/app/config/config.yml index 0158c14..6b32c76 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -1,6 +1,7 @@ imports: - { resource: parameters.yml } - { resource: security.yml } + - { resource: services.yml } # Framework configuration framework: @@ -17,15 +18,20 @@ framework: engines: ['twig'] #assets_version: SomeVersionScheme default_locale: "%locale%" + trusted_hosts: ~ trusted_proxies: ~ session: + handler_id: ~ save_path: "%kernel.root_dir%/sessions" fragments: ~ + http_method_override: true # Twig Configuration twig: debug: %kernel.debug% strict_variables: %kernel.debug% + form: + resources: ['bootstrap_3_layout.html.twig'] globals: sitename: %sitename% @@ -103,8 +109,7 @@ knp_gaufrette: # Vich Configuration vich_uploader: db_driver: orm - gaufrette: true - storage: vich_uploader.storage.gaufrette + storage: gaufrette mappings: ~ # Doctrine Extensions Configuration diff --git a/app/config/dev/config.yml b/app/config/dev/config.yml index 3024e24..be0a0d6 100644 --- a/app/config/dev/config.yml +++ b/app/config/dev/config.yml @@ -18,6 +18,21 @@ monolog: type: stream path: %kernel.logs_dir%/%kernel.environment%.log level: debug + console: + type: console + bubble: false + verbosity_levels: + VERBOSITY_VERBOSE: INFO + VERBOSITY_VERY_VERBOSE: DEBUG + channels: ["!doctrine"] + console_very_verbose: + type: console + bubble: false + verbosity_levels: + VERBOSITY_VERBOSE: NOTICE + VERBOSITY_VERY_VERBOSE: NOTICE + VERBOSITY_DEBUG: DEBUG + channels: ["doctrine"] # firephp: # type: firephp # level: info diff --git a/app/config/dev/routing.yml b/app/config/dev/routing.yml index 0e82854..e03b855 100644 --- a/app/config/dev/routing.yml +++ b/app/config/dev/routing.yml @@ -10,5 +10,9 @@ _configurator: resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml" prefix: /_configurator +_errors: + resource: "@TwigBundle/Resources/config/routing/errors.xml" + prefix: /_error + _main: resource: ../routing.yml diff --git a/app/config/prod/config.yml b/app/config/prod/config.yml index 2e54036..fc6c166 100644 --- a/app/config/prod/config.yml +++ b/app/config/prod/config.yml @@ -22,3 +22,5 @@ monolog: type: stream path: %kernel.logs_dir%/%kernel.environment%.log level: debug + console: + type: console diff --git a/app/config/services.yml b/app/config/services.yml new file mode 100644 index 0000000..8b9b9a4 --- /dev/null +++ b/app/config/services.yml @@ -0,0 +1,7 @@ +parameters: +# parameter_name: value + +services: +# service_name: +# class: AppBundle\Directory\ClassName +# arguments: ["@another_service_name", "plain_value", "%parameter_name%"] diff --git a/app/config/test/config.yml b/app/config/test/config.yml index 2685907..012e836 100644 --- a/app/config/test/config.yml +++ b/app/config/test/config.yml @@ -8,7 +8,7 @@ framework: session: storage_id: session.storage.filesystem profiler: - enabled: false + collect: false default_locale: en web_profiler: diff --git a/bower.json b/bower.json index fd6d20a..1bee521 100644 --- a/bower.json +++ b/bower.json @@ -3,9 +3,9 @@ "private": true, "dependencies": { "jquery": "1.11.1", - "bootstrap-sass-twbs": "3.2.0+2", + "bootstrap-sass-twbs": "3.3.1", "fontawesome": "4.2.0", "selectize": "0.11.2", - "selectize-scss": "0.8.8" + "selectize-scss": "0.8.9" } } diff --git a/composer.json b/composer.json index 336944e..cfb16de 100644 --- a/composer.json +++ b/composer.json @@ -10,21 +10,20 @@ }, "require": { "php": ">=5.4.0", - "symfony/symfony": "~2.5", + "symfony/symfony": "~2.6.0", "doctrine/orm": "~2.4", - "doctrine/doctrine-bundle": "~1.2.0", - "twig/extensions": "~1.1", + "doctrine/doctrine-bundle": "~1.3", + "twig/extensions": "~1.2", "symfony/swiftmailer-bundle": "~2.3", "symfony/monolog-bundle": "~2.6", "sensio/distribution-bundle": "~3.0", "sensio/framework-extra-bundle": "~3.0", "incenteev/composer-parameter-handler": "~2.1", "stof/doctrine-extensions-bundle": "~1.1", - "vich/uploader-bundle": "~0.11", + "vich/uploader-bundle": "~0.12", "knplabs/knp-gaufrette-bundle": "~0.1.7", "doctrine/doctrine-migrations-bundle": "~1.0.0", "doctrine/migrations": "~1.0@dev", - "bravesheep/bootstrapify-bundle": "~3.0.0", "friendsofsymfony/user-bundle": "~2.0@dev", "doctrine/doctrine-fixtures-bundle": "~2.2.0", "bravesheep/database-url-bundle": "~0.1", @@ -32,7 +31,7 @@ }, "require-dev": { "fzaninotto/faker": "~1.4", - "sensio/generator-bundle": "~2.4", + "sensio/generator-bundle": "~2.5", "behat/behat": "~3.0", "behat/mink": "~1.6", "behat/mink-extension": "~2.0", @@ -70,11 +69,12 @@ "extra": { "symfony-app-dir": "app", "symfony-web-dir": "web", + "symfony-assets-install": "relative", "incenteev-parameters": { "file": "app/config/parameters.yml" }, "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "config": { diff --git a/package.json b/package.json index 47ccf8a..f92c6e1 100644 --- a/package.json +++ b/package.json @@ -2,34 +2,34 @@ "name": "symfony-okoa", "private": true, "devDependencies": { - "browserify": "6.1.0", + "browserify": "7.0.0", "deamdify": "0.1.1", - "debowerify": "0.9.0", - "del": "0.1.3", + "debowerify": "1.2.0", + "del": "1.1.0", "event-stream": "3.1.7", "extend": "2.0.0", - "gulp": "3.8.8", - "gulp-autoprefixer": "1.0.1", + "gulp": "3.8.10", + "gulp-autoprefixer": "2.0.0", "gulp-buster": "1.0.0", - "gulp-changed": "1.0.0", - "gulp-cssimport": "1.2.3", + "gulp-changed": "1.1.0", + "gulp-cssimport": "1.3.1", "gulp-flatten": "0.0.4", "gulp-if": "1.2.5", - "gulp-jshint": "1.8.5", + "gulp-jshint": "1.9.0", "gulp-livereload": "2.1.1", "gulp-minify-css": "0.3.11", "gulp-plumber": "0.6.6", "gulp-rename": "1.2.0", - "gulp-sass": "1.2.0", + "gulp-sass": "1.2.4", "gulp-size": "1.1.0", "gulp-streamify": "0.0.5", - "gulp-uglify": "1.0.1", + "gulp-uglify": "1.0.2", "gulp-util": "3.0.1", "jshint-stylish": "1.0.0", "stream-combiner": "0.2.1", "vinyl-source-stream": "1.0.0", - "watchify": "2.0.0", - "yargs": "1.3.2" + "watchify": "2.1.1", + "yargs": "1.3.3" }, "engines": { "node": "0.10.x" diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php new file mode 100644 index 0000000..b6f8f2f --- /dev/null +++ b/src/AppBundle/Controller/DefaultController.php @@ -0,0 +1,17 @@ +render('default/index.html.twig'); + } +} diff --git a/src/AppBundle/DependencyInjection/AppExtension.php b/src/AppBundle/DependencyInjection/AppExtension.php deleted file mode 100644 index e1a82f8..0000000 --- a/src/AppBundle/DependencyInjection/AppExtension.php +++ /dev/null @@ -1,26 +0,0 @@ -processConfiguration($configuration, $configs); - - $loader = new Loader\YamlFileLoader( - $container, - new FileLocator(__DIR__ . '/../Resources/config') - ); - $loader->load('services.yml'); - } -} diff --git a/src/AppBundle/DependencyInjection/Configuration.php b/src/AppBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 48d96f2..0000000 --- a/src/AppBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,20 +0,0 @@ -root('app'); - - return $treeBuilder; - } -} diff --git a/src/AppBundle/Resources/config/services.yml b/src/AppBundle/Resources/config/services.yml deleted file mode 100644 index d157895..0000000 --- a/src/AppBundle/Resources/config/services.yml +++ /dev/null @@ -1,4 +0,0 @@ -# services: -# app.twig.base_extension: -# class: AppBundle\Twig\BaseExtension -# arguments: [] diff --git a/web/app.php b/web/app.php index a813f62..c5c2640 100644 --- a/web/app.php +++ b/web/app.php @@ -5,12 +5,14 @@ $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; -// Use APC for autoloading to improve performance. -// Change 'sf2' to a unique prefix in order to prevent cache key conflicts -// with other applications also using APC. +// Enable APC for autoloading to improve performance. +// You should change the ApcClassLoader first argument to a unique prefix +// in order to prevent cache key conflicts with other applications +// also using APC. /* -$loader = new ApcClassLoader('sf2', $loader); -$loader->register(true); +$apcLoader = new ApcClassLoader(sha1(__FILE__), $loader); +$loader->unregister(); +$apcLoader->register(true); */ require_once __DIR__.'/../app/AppKernel.php'; @@ -19,7 +21,9 @@ $kernel = new AppKernel('prod', false); $kernel->loadClassCache(); //$kernel = new AppCache($kernel); -Request::enableHttpMethodParameterOverride(); + +// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter +//Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); diff --git a/web/app_dev.php b/web/app_dev.php index 28be88e..3042426 100644 --- a/web/app_dev.php +++ b/web/app_dev.php @@ -24,7 +24,6 @@ $kernel = new AppKernel('dev', true); $kernel->loadClassCache(); -Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); diff --git a/web/app_test.php b/web/app_test.php index 953ec83..a1d75ab 100644 --- a/web/app_test.php +++ b/web/app_test.php @@ -24,7 +24,6 @@ $kernel = new AppKernel('test', true); $kernel->loadClassCache(); -Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send();