- Custom FormType, how to handle form name refactoring: https://github.com/symfony-cmf/RoutingBundle/blob/master/Form/Type/RouteTypeType.php#L72-L83
- Using form types, both name and FQCN. See https://github.com/symfony-cmf/RoutingBundle/blob/master/Util/Sf2CompatUtil.php
- Security context removal, remove typehint from the constuctor for SecurityContextInterface and replace it with an if statement for both SecurityContextInteface and TokenStorageInterface/AuthorizationCheckerInterface. Then, inject the new service by default and create a compiler pass to inject the security context in case Symfony 2.3 was used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // ... | |
| class MyUnit | |
| { | |
| private $authChecker; | |
| public function __construct(AuthorizationCheckerInterface $authChecker) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| firewalls: | |
| # disables authentication for assets and the profiler, adapt it according to your needs | |
| dev: | |
| pattern: ^/(_(profiler|wdt)|css|images|js)/ | |
| security: false | |
| main: | |
| pattern: ^/ | |
| provider: db_provider | |
| anonymous: ~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class PostController extends Controller | |
| { | |
| public function showAction($slug, $_template) | |
| { | |
| $post = $this->someBackend->findBySlug($slug); | |
| return $this->render($_template, ['post' => $post]); | |
| } |
Every request, get the current logged in user (on the PC, no idea how they plan to implement this) and authenticate this user in the app (creating a new user if it doesn't exists yet).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // ... | |
| class MailLogger implements LoggerInterface | |
| { | |
| private $mailer; | |
| public function __construct(MailerInterface $mailer) | |
| { | |
| $this->mailer = $mailer; |
$ composer require --no-update symfony/framework-bundle "~2.3.3|~2.6.6"
$ composer require --no-update symfony/symfony "*"
$ composer update -q
$ composer show -i
...
symfony/framework-bundle v2.6.12
symfony/symfony v2.8.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [PDOException] | |
| SQLSTATE[HY000]: General error: 1 no such table: phpcr_workspaces | |
| Exception trace: | |
| () at C:\sf-world\cmf\standard-edition\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php:691 | |
| PDO->prepare() at C:\sf-world\cmf\standard-edition\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php:691 | |
| Doctrine\DBAL\Connection->executeQuery() at C:\sf-world\cmf\standard-edition\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php:419 | |
| Doctrine\DBAL\Connection->fetchColumn() at C:\sf-world\cmf\standard-edition\vendor\jackalope\jackalope-doctrine-dbal\src\Jackalope\Transport\DoctrineDBAL\Client.php:409 |
Symfony 3 is a major version update of Symfony. This means that code working on Symfony 2 applications might not work on Symfony 3. In order to update your bundles for Symfony 3, you need to make sure that your bundle doesn't use any of the removed features without also using the replacement. This guide will teach you how to add Symfony 3 support to your bundle and it'll also give you some practical tips to support both Symfony 2 and 3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App; | |
| require __DIR__.'/vendor/autoload.php'; | |
| use Symfony\Component\Console\Application; | |
| use Symfony\Component\Console\ConsoleEvents; | |
| use Symfony\Component\Console\Event\ConsoleCommandEvent; | |
| use Symfony\Component\Console\Input\InputArgument; |