Posted
about 7 years
ago
by
Emilie Lorenzo
We’re so thrilled and excited to announce SymfonyLive London! We’ve just confirmed the official dates, SymfonyLive London will be held on September 28th at the Park Plaza Westminster! Symfony is proud to organize the 7th edition of the British
... [More]
Symfony conference and to welcome the Symfony community from all over the UK and Europe.
Join us to share Symfony best practices, experience, knowledge, make new contacts, and hear the latest developments with the framework!
Come to attend SymfonyLive London, conference day will be on September 28th, and the pre-conference workshops will take place, one day before the conference, on September 27th.
Early bird to register to the conference is already available! If you want to enjoy it, hurry up to register before July 1st!
Call for Papers is also open, until June 17th. If you want to speak at the SymfonyLive, send us your talk proposals. We are looking for highly technical talks related to Symfony and its ecosystem, original talks that haven't been delivered in previous conferences and community oriented talks. All criteria regarding the CFP are listed on the website. Don’t hesitate to send more than one proposal to increase your chances of being selected.
Workshops are already announced, check out our website to review the different topics. Workshop tickets are sold in combo with conference tickets. The ticket price includes the conference ticket, the 1 workshop day, food throughout all 2 days (breaks and lunches) and wifi. Get 20% off the global price for workshops and conference days with the combo ticket.
We hope to see the entire UK Symfony community at SymfonyLive London, and we’d like to thank you for your involvement with Symfony.
See you in September!
Be trained by Symfony experts
- 2018-05-16 Paris
- 2018-05-22 Clichy
- 2018-05-22 Clichy
[Less]
|
Posted
about 7 years
ago
by
Javier Eguiluz
The main new feature of the Console component in Symfony 4.1 is the
advanced output control that lets you update different parts of the output
simultaneously. However, we improved the the Console with other minor changes too.
Automatically run the
... [More]
suggested command¶
Contributed by
Pierre du Plessis
in #25732.
In Symfony, when you mistype the command name you see an error message with a
list of similarly named commands. In Symfony 4.1, when there's only one
alternative command, you get the option to run it right away:
1
2
3
4
$ ./bin/console app:user:impot
Command "app:user:impot" not defined.
Do you want to run "app:user:import" instead? [y/n]
New table styles¶
Contributed by
Dany Maillard
in #25301
and #26693.
In Symfony 4.1, tables displayed as part of the command output can select two
new styles called box and box-double:
1
2
$table->setStyle('box');
$table->render();
1
2
3
4
5
6
7
8
┌───────────────┬──────────────────────────┬──────────────────┐
│ ISBN │ Title │ Author │
├───────────────┼──────────────────────────┼──────────────────┤
│ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
│ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens │
│ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien │
│ 80-902734-1-6 │ And Then There Were None │ Agatha Christie │
└───────────────┴──────────────────────────┴──────────────────┘
1
2
$table->setStyle('box-double');
$table->render();
1
2
3
4
5
6
7
8
╔═══════════════╤══════════════════════════╤══════════════════╗
║ ISBN │ Title │ Author ║
╠═══════════════╪══════════════════════════╪══════════════════╣
║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║
║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║
║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║
║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║
╚═══════════════╧══════════════════════════╧══════════════════╝
New methods to customize tables¶
Contributed by
Dany Maillard
in #25456.
In addition to the new table styles, in Symfony 4.1 we've deprecated some methods
(setHorizontalBorderChar(), setVerticalBorderChar(), setCrossingChar())
to introduce more powerful methods that will allow you to customize every single
character used to draw the table borders.
For example, the new setCrossingChars() can customize 9 different characters:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public function setCrossingChars(
string $cross, string $topLeft, string $topMid, string $topRight,
string $midRight, string $bottomRight, string $bottomMid,
string $bottomLeft, string $midLeft
);
// * 1---------------2-----------------------2------------------3
// | ISBN | Title | Author |
// 8---------------0-----------------------0------------------4
// | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
// | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
// | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
// 7---------------6-----------------------6------------------5
// @param string $cross Crossing char (see #0 of example)
// @param string $topLeft Top left char (see #1 of example)
// @param string $topMid Top mid char (see #2 of example)
// @param string $topRight Top right char (see #3 of example)
// @param string $midRight Mid right char (see #4 of example)
// @param string $bottomRight Bottom right char (see #5 of example)
// @param string $bottomMid Bottom mid char (see #6 of example)
// @param string $bottomLeft Bottom left char (see #7 of example)
// @param string $midLeft Mid left char (see #8 of example)
Added support for outputting iterators¶
Contributed by
Tobias Schultze and
Maxime Steinhausser
in #26847
and #26863.
In Symfony 4.1, the write() and writeln() methods of the Console output
(including SymfonyStyle output too) support passing iterators that return
strings:
1
2
3
4
5
6
7
8
9
10
11
private function generateMessages(): iterable
{
yield 'foo';
yield 'bar';
}
// ...
$output->writeln($this->generateMessages());
// Output will be:
// foo\n
// bar\n
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|
Posted
over 7 years
ago
by
Javier Eguiluz
Symfony Polyfills provide some features from PHP core and PHP extensions
implemented as PHP 5.3 code, so you can use them in your applications regardless
of the PHP version being run on your system.
Polyfills allow you to use some PHP 7 functions
... [More]
(e.g. spl_object_id() from
PHP 7.2) in your PHP 5 code and some functions from PHP extensions (e.g.
mb_strlen() from mbstring) even if you don't have those extensions installed.
Symfony Polyfills are continuously being improved and we recently added two new
polyfills for PHP 7.3 and the Ctype extension. PHP 7.3 hasn't been released
yet, so Symfony PHP 7.3 Polyfill only includes one function for now:
is_countable(), which returns true when the given variable is countable
(an array or an instance of Countable, ResourceBundle or SimpleXmlElement).
The Symfony Ctype Polyfill provides the following functions:
1
2
3
4
5
6
7
8
9
10
11
function ctype_alnum($text)
function ctype_alpha($text)
function ctype_cntrl($text)
function ctype_digit($text)
function ctype_graph($text)
function ctype_lower($text)
function ctype_print($text)
function ctype_punct($text)
function ctype_space($text)
function ctype_upper($text)
function ctype_xdigit($text)
Run these commands to install any of the new polyfills in your apps:
1
2
$ composer require symfony/polyfill-php73
$ composer require symfony/polyfill-ctype
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|
Posted
over 7 years
ago
by
Fabien Potencier
Symfony 4.0.9 has just been released. Here is a list of the most
important changes:
bug #27074 [Debug][WebProfilerBundle] Fix setting file link format (@lyrixx, @nicolas-grekas)
bug #27088 ResolveBindingsPass: Don't throw error for unused service
... [More]
, missing parent class (@weaverryan)
bug #27086 [PHPUnitBridge] Add an implementation just for php 7.0 (@greg0ire)
bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (@cilefen)
bug #27007 [Cache] TagAwareAdapterInterface::invalidateTags() should commit deferred items (@nicolas-grekas)
bug #27067 [HttpFoundation] Fix setting session-related ini settings (@e-moe)
bug #27061 [HttpKernel] Don't clean legacy containers that are still loaded (@nicolas-grekas)
bug #27064 [VarDumper] Fix HtmlDumper classes match (@ogizanagi)
bug #27016 [Security][Guard] GuardAuthenticationProvider::authenticate cannot return null (@biomedia-thomas)
bug #26831 [Bridge/Doctrine] count(): Parameter must be an array or an object that implements Countable (@gpenverne)
bug #27044 [Security] Skip user checks if not implementing UserInterface (@chalasr)
bug #27025 [DI] Add check of internal type to ContainerBuilder::getReflectionClass (@upyx)
bug #26994 [PhpUnitBridge] Add type hints (@greg0ire)
bug #26014 [Security] Fixed being logged out on failed attempt in guard (@iltar)
bug #25348 [HttpFoundation] Send cookies using header() to fix "SameSite" ones (@nicolas-grekas, @cvilleger)
bug #26910 Use new PHP7.2 functions in hasColorSupport (@johnstevenson)
bug #26999 [VarDumper] Fix dumping of SplObjectStorage (@corphi)
bug #25841 [DoctrineBridge] Fix bug when indexBy is meta key in PropertyInfoDoctrineExtractor (@insekticid)
bug #26983 [TwigBridge] [Bootstrap 4] Fix PercentType error rendering. (@alexismarquis)
bug #26980 [TwigBundle] fix formatting arguments in plaintext format (@xabbuh)
bug #26886 Don't assume that file binary exists on nix OS (@teohhanhui)
bug #26959 [Console] Fix PSR exception context key (@scaytrase)
bug #26899 [Routing] Fix loading multiple class annotations for invokable classes (@1ed)
bug #26643 Fix that ESI/SSI processing can turn a "private" response "public" (@mpdude)
bug #26932 [Form] Fixed trimming choice values (@HeahDude)
bug #26922 [TwigBundle] fix rendering exception stack traces (@xabbuh)
bug #26773 [HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing (@mathieutu)
bug #26870 Add d-block to bootstrap 4 alerts (@Normunds)
bug #26857 [HttpKernel] Dont create mock cookie for new sessions in tests (@nicolas-grekas)
bug #26875 [Console] Don't go past exact matches when autocompleting (@nicolas-grekas)
bug #26823 [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't existing class (@Pascal Montoya, @pmontoya)
bug #26834 [Yaml] Throw parse error on unfinished inline map (@nicolas-grekas)
Want to upgrade to this new release? Fortunately, because Symfony protects
backwards-compatibility very closely, this should be quite easy.
Read our upgrade
documentation to learn more.
Want to be notified whenever a new Symfony release is published? Or when a
version is not maintained anymore? Or only when a security issue is fixed?
Consider subscribing to the Symfony Roadmap Notifications.
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|
Posted
over 7 years
ago
by
Fabien Potencier
Symfony 3.4.9 has just been released. Here is a list of the most
important changes:
feature #24896 Add CODE_OF_CONDUCT.md (@egircys)
bug #27074 [Debug][WebProfilerBundle] Fix setting file link format (@lyrixx, @nicolas-grekas)
bug #27088
... [More]
ResolveBindingsPass: Don't throw error for unused service, missing parent class (@weaverryan)
bug #27086 [PHPUnitBridge] Add an implementation just for php 7.0 (@greg0ire)
bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (@cilefen)
bug #27007 [Cache] TagAwareAdapterInterface::invalidateTags() should commit deferred items (@nicolas-grekas)
bug #27067 [HttpFoundation] Fix setting session-related ini settings (@e-moe)
bug #27061 [HttpKernel] Don't clean legacy containers that are still loaded (@nicolas-grekas)
bug #27064 [VarDumper] Fix HtmlDumper classes match (@ogizanagi)
bug #27016 [Security][Guard] GuardAuthenticationProvider::authenticate cannot return null (@biomedia-thomas)
bug #26831 [Bridge/Doctrine] count(): Parameter must be an array or an object that implements Countable (@gpenverne)
bug #27044 [Security] Skip user checks if not implementing UserInterface (@chalasr)
bug #27025 [DI] Add check of internal type to ContainerBuilder::getReflectionClass (@upyx)
bug #26994 [PhpUnitBridge] Add type hints (@greg0ire)
bug #26014 [Security] Fixed being logged out on failed attempt in guard (@iltar)
bug #25348 [HttpFoundation] Send cookies using header() to fix "SameSite" ones (@nicolas-grekas, @cvilleger)
bug #26910 Use new PHP7.2 functions in hasColorSupport (@johnstevenson)
bug #26999 [VarDumper] Fix dumping of SplObjectStorage (@corphi)
bug #25841 [DoctrineBridge] Fix bug when indexBy is meta key in PropertyInfoDoctrineExtractor (@insekticid)
bug #26983 [TwigBridge] [Bootstrap 4] Fix PercentType error rendering. (@alexismarquis)
bug #26980 [TwigBundle] fix formatting arguments in plaintext format (@xabbuh)
bug #26886 Don't assume that file binary exists on nix OS (@teohhanhui)
bug #26959 [Console] Fix PSR exception context key (@scaytrase)
bug #26899 [Routing] Fix loading multiple class annotations for invokable classes (@1ed)
bug #26643 Fix that ESI/SSI processing can turn a "private" response "public" (@mpdude)
bug #26932 [Form] Fixed trimming choice values (@HeahDude)
bug #26922 [TwigBundle] fix rendering exception stack traces (@xabbuh)
bug #26773 [HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing (@mathieutu)
bug #26870 Add d-block to bootstrap 4 alerts (@Normunds)
bug #26857 [HttpKernel] Dont create mock cookie for new sessions in tests (@nicolas-grekas)
bug #26875 [Console] Don't go past exact matches when autocompleting (@nicolas-grekas)
bug #26823 [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't existing class (@Pascal Montoya, @pmontoya)
bug #26834 [Yaml] Throw parse error on unfinished inline map (@nicolas-grekas)
Want to upgrade to this new release? Fortunately, because Symfony protects
backwards-compatibility very closely, this should be quite easy.
Read our upgrade
documentation to learn more.
Want to be notified whenever a new Symfony release is published? Or when a
version is not maintained anymore? Or only when a security issue is fixed?
Consider subscribing to the Symfony Roadmap Notifications.
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|
Posted
over 7 years
ago
by
Javier Eguiluz
Contributed by
Jeffrey Brubaker
in #26655.
Single-page applications (SPA) are web applications that use JavaScript to
rewrite the current
... [More]
page contents dynamically rather than loading entire new
pages from the backend.
One of the problems of working on those applications is that Symfony's Web Debug
Toolbar remains unchanged with the debug information of the first action
executed when browsing the application.
In order to solve this issue, in Symfony 4.1 we've introduced a special
Symfony-Debug-Toolbar-Replace HTTP header. Set its value to 1 to tell
Symfony to replace the web debug toolbar with the new one associated with the
current response.
If you want to enable this behavior for just one response, add this to your code:
1
$response->headers->set('Symfony-Debug-Toolbar-Replace', 1);
If you work on a SPA application, it's better to define an event subscriber
and listen to the kernel.response event to add that header automatically.
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|
Posted
over 7 years
ago
by
Fabien Potencier
Symfony 2.8.39 has just been released. Here is a list of the most
important changes:
bug #27067 [HttpFoundation] Fix setting session-related ini settings (@e-moe)
bug #27016 [Security][Guard] GuardAuthenticationProvider::authenticate cannot return
... [More]
null (@biomedia-thomas)
bug #26831 [Bridge/Doctrine] count(): Parameter must be an array or an object that implements Countable (@gpenverne)
bug #27044 [Security] Skip user checks if not implementing UserInterface (@chalasr)
bug #26014 [Security] Fixed being logged out on failed attempt in guard (@iltar)
bug #26910 Use new PHP7.2 functions in hasColorSupport (@johnstevenson)
bug #26999 [VarDumper] Fix dumping of SplObjectStorage (@corphi)
bug #25841 [DoctrineBridge] Fix bug when indexBy is meta key in PropertyInfoDoctrineExtractor (@insekticid)
bug #26886 Don't assume that file binary exists on nix OS (@teohhanhui)
bug #26643 Fix that ESI/SSI processing can turn a "private" response "public" (@mpdude)
bug #26932 [Form] Fixed trimming choice values (@HeahDude)
bug #26875 [Console] Don't go past exact matches when autocompleting (@nicolas-grekas)
bug #26823 [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't existing class (@Pascal Montoya, @pmontoya)
bug #26834 [Yaml] Throw parse error on unfinished inline map (@nicolas-grekas)
Want to upgrade to this new release? Fortunately, because Symfony protects
backwards-compatibility very closely, this should be quite easy.
Read our upgrade
documentation to learn more.
Want to be notified whenever a new Symfony release is published? Or when a
version is not maintained anymore? Or only when a security issue is fixed?
Consider subscribing to the Symfony Roadmap Notifications.
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|
Posted
over 7 years
ago
by
Javier Eguiluz
This week, development activity was focused on improving the new Messenger component to allow defining multiple buses, adding a memory limit option to ConsumeMessagesCommand and generating better logs for received messages. In addition, we improved
... [More]
the performance of the resource loading in the Translator component and the performance of the normalizer in the Serializer component.
Symfony development highlights
2.7 changelog:
e775871: [HttpFoundation] added HTTP_EARLY_HINTS constant
9afb41e: [Security] skip user checks if not implementing UserInterface
778d47f: [HttpKernel] remove decoration from actual output in tests
bf8ed0a: [Doctrine Bridge] fixed an countable issue in UniqueEntityValidator
81c9545: [HttpFoundation] fixed setting session-related ini settings
3.4 changelog:
aec5cd0: [DependencyInjection] added check of internal type to ContainerBuilder::getReflectionClass
ff96226: [Security] fixed GuardAuthenticationProvider::authenticate cannot return null
df20e80: [VarDumper] fixed HtmlDumper classes match
b8c1538: [HttpKernel] don't clean legacy containers that are still loaded
61af0e3: [Cache] make TagAwareAdapterInterface::invalidateTags() commit deferred items
b213c5a: [HttpKernel] catch HttpExceptions when templating is not installed
Master changelog:
9ae116f: [MonologBridge] added WebSubscriberProcessor to ease processor configuration
8a35c8b: [DependencyInjection] handle invalid extension configuration class
0a83b17: [Serializer] allow to access to the context and various other infos in callbacks and max depth handler
2232d99: [FrameworkBundle] register all private services on the test service container
da4fccd: [Messenger] allow to define multiple buses from the framework.messenger.buses configuration
cef8d28: [WebProfilerBundle] show Messenger bus name in profiler panel
ee0967f: [Messenger] added a memory limit option for ConsumeMessagesCommand
3b363a8: [Messenger] unwrap ReceivedMessage in LoggingMiddleware to improve log detail
39c7c90: [Messenger] validate that the message exists to be able to configure its routing
a9d12d2: [DependencyInjection, Routing] allow invokable objects to be used as PHP-DSL loaders
e902caa: [SecurityBundle] register a UserProviderInterface alias if one provider only
ff19a04: [Messenger] restored wildcard support in routing
d843181: [Translator] further postpone adding resource files
5b6df6f: [Serializer] cache the normalizer to use when possible
50a59c0: [WebProfilerBundle] made the debug toolbar follow ajax requests if header set
Newest issues and pull requests
[Asset] Missing manifest file throws an exception
Lazy load Translator service to improve performance
[RFC] Link missing service dependencies with tailored error messages
[DependencyInjection] Rethink getDefinition() and findDefinition()
[DI][FrameworkBundle] PHP-DSL base class for simple shortcuts for DI
They talked about us
How to Slowly Turn your Symfony Project to Legacy with Action Injection
The easier way to prepare for Symfony Certification: Now updated for 4.0!
The Symfony Form Component for API Contracts
Auto package configuration for Symfony
SyliusResourceBundle - How to Develop Your CRUD Apps Faster
Nuevo en Symfony 4.1: Configuración concisa de rutas
Bolt, CMS sencillo basado en Symfony, publica su versión 3.5
Nuevo en Symfony 4.1: mejoras en el componente Workflow
Symfony 4.1: Aprimoramentos nas requisições Ajax
Symfony 4.1: Melhorias no Componente Serializer
Trabalhando com Migrations no Symfony 4
Symfony 4.1: Melhorias nos cabeçalhos HTTP
Symfony 4.1: Melhorias na Sessão
Symfony 4.1: Melhorias nas Exceções
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|
Posted
over 7 years
ago
by
Fabien Potencier
Symfony 2.7.46 has just been released. Here is a list of the most
important changes:
bug #26831 [Bridge/Doctrine] count(): Parameter must be an array or an object that implements Countable (@gpenverne)
bug #27044 [Security] Skip user checks if not
... [More]
implementing UserInterface (@chalasr)
bug #26910 Use new PHP7.2 functions in hasColorSupport (@johnstevenson)
bug #26999 [VarDumper] Fix dumping of SplObjectStorage (@corphi)
bug #26886 Don't assume that file binary exists on nix OS (@teohhanhui)
bug #26643 Fix that ESI/SSI processing can turn a "private" response "public" (@mpdude)
bug #26932 [Form] Fixed trimming choice values (@HeahDude)
bug #26875 [Console] Don't go past exact matches when autocompleting (@nicolas-grekas)
bug #26823 [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't existing class (@Pascal Montoya, @pmontoya)
bug #26834 [Yaml] Throw parse error on unfinished inline map (@nicolas-grekas)
Want to upgrade to this new release? Fortunately, because Symfony protects
backwards-compatibility very closely, this should be quite easy.
Read our upgrade
documentation to learn more.
Want to be notified whenever a new Symfony release is published? Or when a
version is not maintained anymore? Or only when a security issue is fixed?
Consider subscribing to the Symfony Roadmap Notifications.
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|
Posted
over 7 years
ago
by
Javier Eguiluz
Deprecate some uses of Request::getSession()¶
Contributed by
Florent Mata
in #26564.
Using Request::getSession() when no session
... [More]
exists has been deprecated in
Symfony 4.1 and it will throw an exception in Symfony 5.0. The solution is to
always check first if a session exists with the Request::hasSession()
method:
1
2
3
4
// ...
if ($request->hasSession() && ($session = $request->getSession())) {
$session->set('some_key', 'some_value');
}
Allow to cache requests that use sessions¶
Contributed by
Yanick Witschi
in #26681.
Whenever the session is started during a request, Symfony turns the response
into a private non-cacheable response to prevent leaking private information.
However, even requests making use of the session can be cached under some
circumstances.
For example, information related to some user group could be cached for all the
users belonging to that group. Handling these advanced caching scenarios is out
of the scope of Symfony, but they can be solved with the FOSHttpCacheBundle.
In order to disable the default Symfony behavior that makes requests using the
session uncacheable, in Symfony 4.1 we added the NO_AUTO_CACHE_CONTROL_HEADER
header that you can add to responses:
1
2
3
use Symfony\Component\HttpKernel\EventListener\AbstractSessionListener;
$response->headers->set(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER, 'true');
Allow to migrate sessions¶
Contributed by
Ross Motley
in #26096.
Migrating sessions (e.g. from the filesystem to the database) is a tricky
operation that usually ends up losing all the existing sessions. That's why in
Symfony 4.1 we've introduced a new MigratingSessionHandler class to allow
migrate between old and new save handlers without losing session data.
It's recommended to do the migration in three steps:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use Symfony\Component\HttpFoundation\Session\Storage\Handler\MigratingSessionHandler;
$oldSessionStorage = ...;
$newSessionStorage = ...;
// The constructor of the migrating class are: MigratingSessionHandler($currentHandler, $writeOnlyHandler)
// Step 1. Do this during the "garbage collection period of time" to get all sessions in the new storage
$sessionStorage = new MigratingSessionHandler($oldSessionStorage, $newSessionStorage);
// Step 2. Do this while you verify that the new storage handler works as expected
$sessionStorage = new MigratingSessionHandler($newSessionStorage, $oldSessionStorage);
// Step 3. Your app is now ready to switch to the new storage handler
$sessionStorage = $newSessionStorage;
Be trained by Symfony experts
- 2018-05-14 Paris
- 2018-05-14 Paris
- 2018-05-16 Paris
[Less]
|