Quantcast
Channel: Symfony Blog
Viewing all 3075 articles
Browse latest View live

New in Symfony 4.1: Ajax improvements

$
0
0

A simpler way to test Ajax requests

Hamza Amrouche

Contributed by
Hamza Amrouche
in #26381.

The BrowserKit component used in Symfony functional tests provides lots of utilities to simulate the behavior of a web browser. In Symfony 4.1 we've added a new utility to make Ajax requests simpler: xmlHttpRequest().

This method works the same as the current request() method and accepts the same arguments, but it adds the required HTTP_X_REQUESTED_WITH header automatically so you don't have to do that yourself:

1
2
3
4
5
6
7
// Before$crawler=$client->request('GET','/some/path',[],[],['HTTP_X-Requested-With'=>'XMLHttpRequest',]);// After$crawler=$client->xmlHttpRequest('GET','/some/path');

Improved the Ajax panel in the debug toolbar

Gabriel OstroluckýJavier Eguiluz

Contributed by
Gabriel Ostrolucký, and Javier Eguiluz in #26665 and #26668.

The first minor but noticeable change is that the link to the Ajax request profile has been moved to the first column of the table, so it's easier to click on it.

In addition, when the Ajax request results in an exception (HTTP status of 400 or higher) the profiler link points to the exception profiler panel instead of the default request/response panel:

In any case, the biggest new feature of the Ajax panel is that requests now display their duration in real-time, so you always know which requests are still pending to finish:


Be trained by Symfony experts - 2018-04-23 Lyon - 2018-04-23 Lyon - 2018-04-25 Clichy

New in Symfony 4.1: Serializer improvements

$
0
0

Added a ConstraintViolationListNormalizer

Grégoire Pineau

Contributed by
Grégoire Pineau
in #22150.

When working on APIs with Symfony, it's common to use code like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
/** * @Route("/blog/new", name="api_blog_new") * @Method("POST") * @Security("is_granted('ROLE_ADMIN')") */publicfunctionnew(Request$request,SerializerInterface$serializer,ValidatorInterface$validator){$data=$request->getContent();$post=$serializer->deserialize($data,Post::class,'json',['groups'=>['post_write']]);$post->setAuthor($this->getUser());$violations=$validator->validate($post);if(count($violations)>0){$repr=$serializer->serialize($violations,'json');returnJsonResponse::fromJsonString($repr,400);}// ...}

The $violations variable contains a ConstraintViolationList object and it's common to transform it into a list of errors and serialize the list to include it in a JSON response. That's why in Symfony 4.1 we've added aConstraintViolationListNormalizer which does that for you automatically. The normalizer follows the RFC 7807 specification to generate the list of errors.

Getting the XML and CSV results as a collection

Hamza Amrouche

Contributed by
Hamza Amrouche
in #25218 and#25369.

The CsvEncoder and XmlEncoder now define a new config option calledas_collection. If you pass that option as part of the context argument and set it to true, the results will be a collection.

Default constructor arguments for denormalization

Maxime Veber

Contributed by
Maxime Veber
in #25493.

If the constructor of a class defines arguments, as usually happens when using Value Objects, the serializer won't be able to create the object. In Symfony 4.1 we've introduced a new default_constructor_arguments context option to solve this problem.

In the following example, both foo and bar are required constructor arguments but only foo is provided. The value of bar is taken from thedefault_constructor_arguments option:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
useSymfony\Component\Serializer\Serializer;useSymfony\Component\Serializer\Normalizer\ObjectNormalizer;classMyObj{private$foo;private$bar;publicfunction__construct($foo,$bar){$this->foo=$foo;$this->bar=$bar;}}$normalizer=newObjectNormalizer($classMetadataFactory);$serializer=newSerializer(array($normalizer));// this is equivalent to $data = new MyObj('Hello', '');$data=$serializer->denormalize(['foo'=>'Hello'],'MyObj',['default_constructor_arguments'=>['MyObj'=>['foo'=>'','bar'=>''],]]);

Added a MaxDepth handler

Kévin Dunglas

Contributed by
Kévin Dunglas
in #26108.

Sometimes, instead of just stopping the serialization process when the configured max depth is reached, it's better to let the developer handle this situation to return something (e.g. the identifier of the entity).

In Symfony 4.1 you can solve this problem defining a custom handler with the newsetMaxDepthHandler() method:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
useDoctrine\Common\Annotations\AnnotationReader;useSymfony\Component\Serializer\Serializer;useSymfony\Component\Serializer\Annotation\MaxDepth;useSymfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;useSymfony\Component\Serializer\Mapping\Loader\AnnotationLoader;useSymfony\Component\Serializer\Normalizer\ObjectNormalizer;classFoo{public$id;/** @MaxDepth(1) */public$child;}$level1=newFoo();$level1->id=1;$level2=newFoo();$level2->id=2;$level1->child=$level2;$level3=newFoo();$level3->id=3;$level2->child=$level3;$classMetadataFactory=newClassMetadataFactory(newAnnotationLoader(newAnnotationReader()));$normalizer=newObjectNormalizer($classMetadataFactory);$normalizer->setMaxDepthHandler(function($foo){return'/foos/'.$foo->id;});$serializer=newSerializer(array($normalizer));$result=$serializer->normalize($level1,null,array(ObjectNormalizer::ENABLE_MAX_DEPTH=>true));/*$result = array['id' => 1,'child' => ['id' => 2,'child' => '/foos/3',    ]];*/

Ignore comments when decoding XML

James Sansbury

Contributed by
James Sansbury
in #26445.

In previous Symfony versions, XML comments were processed when decoding contents. Also, if the first line of the XML content was a comment, it was used as the root node of the decoded XML.

In Symfony 4.1, XML comments are removed by default but you can control this behavior with the new optional third constructor argument:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
classXmlEncoder{publicfunction__construct(string$rootNodeName='response',int$loadOptions=null,array$ignoredNodeTypes=array(XML_PI_NODE,XML_COMMENT_NODE)){// ...}}

Be trained by Symfony experts - 2018-04-23 Lyon - 2018-04-23 Lyon - 2018-04-25 Clichy

A week of symfony #590 (16-22 April 2018)

$
0
0

This week, Symfony improved the performance of the Cache component inlining some function calls and simplified the usage of the new Messenger component allowing to omit the sender tag name and to use the adapter name instead of the service name. In addition, we added a new dd() helper which is useful when you can't or don't want to use a debugger.

Symfony development highlights

2.7 changelog:

  • a3af3d3: [Form] fixed trimming choice values
  • d17d38d: [HttpKernel] fix that ESI/SSI processing can turn a private response public
  • b0410d4: [HttpFoundation] don't assume that file binary exists on *nix OS

3.4 changelog:

  • baeb1bf: [TwigBundle] fixed rendering exception stack traces
  • 8f2132f: [Routing] fixed loading multiple class annotations for invokable classes
  • 2a52963: [Console] fixed PSR exception context key
  • e984546: [TwigBundle] fixed formatting arguments in plaintext format
  • bf871f4: [Cache] inline some hot function calls
  • 09d1a2b: [TwigBridge] fixed PercentType error rendering in Bootstrap 4 theme
  • 733e813: [DoctrineBridge] fixed bug when indexBy is meta key in PropertyInfo\DoctrineExtractor

Master changelog:

  • 7e4de96: [Messenger] use the adapter name instead of the service name
  • d2f8df8: [Config] fix the valid placeholder types for variable node
  • 4af9003: [Messenger] allow sender tag name omission
  • fe19931: [Messenger] allow to configure the transport
  • 4429c9b: [Messenger] allow disabling the auto-setup of the AmqpExt connection
  • a59d0f6: [VarDumper] added dd() helper
  • 8c4fd12: [Security] made security.providers optional
  • 3450e47: [TwigBundle] do not normalize array keys in twig globals
  • 028e1e5: Declare type for arguments of anonymous functions
  • 1b1bbd4: [HttpKernel] Added support for timings in ArgumentValueResolvers
  • 306c599: [DependencyInjection] allow autoconfigured calls in PHP
  • d0db387: [HttpKernel] split logs on different sub-requests in LoggerDataCollector
  • 833909b: [DependencyInjection] hide service ids that start with a dot
  • 2ceef59: [Form] added choice_translation_locale option for Intl choice types
  • 9cb1f14: [BrowserKit] allow to bypass HTTP header information
  • cbc2376: [HttpFoundation] added a HeaderUtils class

Newest issues and pull requests

They talked about us


Be trained by Symfony experts - 2018-04-23 Lyon - 2018-04-23 Lyon - 2018-04-25 Clichy

New in Symfony 4.1: HTTP header improvements

$
0
0

Introduced a HeaderUtils class

Christian Schmidt

Contributed by
Christian Schmidt
in #26791.

Parsing HTTP headers is not as trivial as some may think. It requires parsing quoted strings with backslash escaping and ignoring white-space in certain places. We did that in some methods of the HttpFoundation component but the repeated logic was starting to make the code hard to maintain.

That's why in Symfony 4.1 we've introduced a new HeaderUtils class that provides the most common utilities needed when parsing HTTP headers. This is not an internal class, so you can use it in your own code too:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
useSymfony\Component\HttpFoundation\HeaderUtils;// Splits an HTTP header by one or more separatorsHeaderUtils::split('da, en-gb;q=0.8',',;')// => array(array('da'), array('en-gb'), array('q', '0.8'))// Combines an array of arrays into one associative arrayHeaderUtils::combineParts(array(array('foo','abc'),array('bar')))// => array('foo' => 'abc', 'bar' => true)// Joins an associative array into a string for use in an HTTP headerHeaderUtils::joinAssoc(array('foo'=>'abc','bar'=>true,'baz'=>'a b c'),',')// => 'foo=bar, baz, baz="a b c"'// Encodes a string as a quoted string, if necessaryHeaderUtils::quote('foo "bar"')// => 'foo \"bar\"'// Decodes a quoted stringHeaderUtils::unquote('foo \"bar\"')// => 'foo "bar"'

Allow to bypass headers when submitting forms in tests

cfjulien

Contributed by
cfjulien
in #26791.

An issue reported by the Mink browser testing project made us realize that you cannot bypass HTTP header information when submitting forms in tests which use the BrowserKit component.

That's why in Symfony 4.1 the submit() method now accepts a third optional argument called $serverParameters which allows you to do things like this:

1
2
3
4
$crawler=$client->request('GET','http://www.example.com/foo');$headers=['Accept-Language'=>'de'];$client->submit($crawler->filter('input')->form(),array(),$headers);// => $client->getRequest()->getServer()['Accept-Language'] = 'de'

Added support for default values in Accept headers

Javier Eguiluz

Contributed by
Javier Eguiluz
in #26036.

When using the Accept HTTP header it's common to use expressions like .../*,*/* and even * to define the default values:

1
Accept: text/plain;q=0.5, text/html, text/*;q=0.8, */*

However, in Symfony versions previous to 4.1 these default values weren't supported:

1
2
3
4
5
6
useSymfony\Component\HttpFoundation\AcceptHeader;$acceptHeader=AcceptHeader::fromString('text/plain;q=0.5, text/html, text/*;q=0.8, */*');$quality=$acceptHeader->get('text/xml')->getQuality();// instead of returning '0.8', this code displays the following error message://   Call to a member function getQuality() on null

In Symfony 4.1 all these default values are now properly supported:

1
2
3
4
$acceptHeader=AcceptHeader::fromString('text/plain;q=0.5, text/html, text/*;q=0.8, */*');$quality=$acceptHeader->get('text/xml')->getQuality();// => 0.8 (because of text/*)$quality=$acceptHeader->get('text/html')->getQuality();// => 1.0$quality=$acceptHeader->get('text/x-dvi')->getQuality();// => 1.0 (because of */*)

Be trained by Symfony experts - 2018-04-23 Lyon - 2018-04-23 Lyon - 2018-04-25 Clichy

New in Symfony 4.1: Exception improvements

$
0
0

FlattenException now unwraps errors

Alexander M. Turek

Contributed by
Alexander M. Turek
in #26028.

Symfony wraps errors thrown by the application inside a FatalThrowableError. This makes the actual error class to not be displayed in the exception pages, where you see for example Symfony's FatalThrowableError instead of PHP'sDivisionByZeroError when your code tries to divide by 0.

In Symfony 4.1, FlattenException now unwraps FatalThrowableError instances and logs the wrapped error. In consequence, the real error class is now always displayed in the exception page:

Introduced new exception classes

Sullivan SenechalFlorent Mata

Contributed by
Sullivan Senechal and Florent Mata
in #25775 and #26475.

In Symfony 4.1 we've introduced a new ProcessSignaledException class in theProcess component to properly catch signaled process errors. Also, in theHttpFoundation component, we've introduced new detailed exception classes for file upload handling to replace the generic catch-all FileException:

1
2
3
4
5
6
7
useSymfony\Component\HttpFoundation\File\Exception\CannotWriteFileException;useSymfony\Component\HttpFoundation\File\Exception\ExtensionFileException;useSymfony\Component\HttpFoundation\File\Exception\FormSizeFileException;useSymfony\Component\HttpFoundation\File\Exception\IniSizeFileException;useSymfony\Component\HttpFoundation\File\Exception\NoFileException;useSymfony\Component\HttpFoundation\File\Exception\NoTmpDirFileException;useSymfony\Component\HttpFoundation\File\Exception\PartialFileException;

Moreover, now that PHP 7.1 supports multi catch exception handling, you can process several exceptions with the same catch() block:

1
2
3
4
5
try{// ...}catch(FormSizeFileException|IniSizeFileException$e){// ...}

Improved the exception page design

Javier Eguiluz

Contributed by
Javier Eguiluz
in #26671.

The exception pages have been improved in Symfony 4.1 to display less information about "vendor code". If some code belongs to the vendor/ folder, we compact its information to fit in a single line and we no longer display its arguments. The other code remains the same, which helps you focus more easily on your own application code:


Be trained by Symfony experts - 2018-04-25 Clichy - 2018-04-26 Paris - 2018-05-14 Cologne

New in Symfony 4.1: Session improvements

$
0
0

Deprecate some uses of Request::getSession()

Florent Mata

Contributed by
Florent Mata
in #26564.

Using Request::getSession() when no session 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

Yanick Witschi

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
useSymfony\Component\HttpKernel\EventListener\AbstractSessionListener;$response->headers->set(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER,'true');

Allow to migrate sessions

Ross Motley

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
useSymfony\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=newMigratingSessionHandler($oldSessionStorage,$newSessionStorage);// Step 2. Do this while you verify that the new storage handler works as expected$sessionStorage=newMigratingSessionHandler($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

Symfony 2.7.46 released

$
0
0

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 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

A week of symfony #591 (23-29 April 2018)

$
0
0

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 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

They talked about us


Be trained by Symfony experts - 2018-05-14 Paris - 2018-05-14 Paris - 2018-05-16 Paris

Symfony 2.8.39 released

$
0
0

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 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

New in Symfony 4.1: Self-updating debug toolbar

$
0
0
Jeffrey Brubaker

Contributed by
Jeffrey Brubaker
in #26655.

Single-page applications (SPA) are web applications that use JavaScript to rewrite the current 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 specialSymfony-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

Symfony 3.4.9 released

$
0
0

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 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

Symfony 4.0.9 released

$
0
0

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, 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

Introducing new Symfony Polyfills for PHP 7.3 and Ctype

$
0
0

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 (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
functionctype_alnum($text)functionctype_alpha($text)functionctype_cntrl($text)functionctype_digit($text)functionctype_graph($text)functionctype_lower($text)functionctype_print($text)functionctype_punct($text)functionctype_space($text)functionctype_upper($text)functionctype_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

New in Symfony 4.1: Console improvements

$
0
0

The main new feature of the Console component in Symfony 4.1 is theadvanced 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 suggested command

Pierre du Plessis

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

Dany Maillard

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

Dany Maillard

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
publicfunctionsetCrossingChars(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

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
privatefunctiongenerateMessages():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

SymfonyLive London 2018 is announced!

$
0
0

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 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-14 Paris - 2018-05-14 Paris - 2018-05-16 Paris

Finding a new home for IvoryCKEditorBundle

$
0
0

IvoryCKEditorBundle is a popular Symfony bundle (more than 2 million downloads) that integrates the ubiquitous CKEditor WYSIWYG editor in Symfony applications and it's also used in projects like Sonata and Symfony CMF.Eric Geloen, the original bundle author, can no longer maintain it so he made a public announcement to get new maintainers.

Sadly nobody volunteered to maintain the bundle, so it was going to be abandoned. However, a few days ago Marko Kunic and Maximilian Berghoff finally volunteered and adopted the bundle under the Friends Of Symfony organization.

The migration to the new bundle is simple and it's explained in thenew migration guide. You just need to update the package name in yourcomposer.json to friendsofsymfony/ckeditor-bundle and then update some PHP namespaces and the bundle config file.

The first version of the new bundle is focused on providing full compatibility with the old bundle and Symfony 4 support. The next version will include new features (maybe even support for CKEditor 5), lots of improvements and simplifications. You can help the new maintainers reporting issues orcontributing pull requests and you can ask for help in the #ckeditor channel of the Symfony Slack chat.

More information: Ivory Becomes FOS Now – CKEditor Bundle for Symfony


Be trained by Symfony experts - 2018-05-14 Paris - 2018-05-14 Paris - 2018-05-16 Paris

A week of symfony #592 (30 April - 6 May 2018)

$
0
0

This week Symfony introduced new polyfills for PHP 7.3 and Ctype and started using the Ctype polyfill in Symfony's code. In addition, we made the Symfony command exceptions more concise and introduced a new Serializer interface to enable caching support. Lastly, the German Symfony community celebrated the SymfonyLive Phantasialand 2018 conference with great success.

Symfony development highlights

2.7 changelog:

  • 222fef4: [Form] fixed instance variable phpdoc in FormRegistry class
  • 6ca520f: use symfony/polyfill-ctype

3.4 changelog:

  • 7242b4c: [PHPUnitBridge] add an implementation just for PHP 7.0
  • 45fd7f8: [DependencyInjection] don't throw error for unused service missing parent class in ResolveBindingsPass
  • 100348a: [FrameworkBundle] use the correct service id for CachePoolPruneCommand in its compiler pass
  • 7bbadf5: [Doctrine Bridge] fixed priority for doctrine event listeners
  • 278f40f: [Console] hide the short exception trace line from exception messages in Symfony commands
  • 5aaa0d7: [Cache] fixed logic for fetching tag versions on TagAwareAdapter

Master changelog:

  • 5a5b925: [Workflow] use clear() instead of reset()
  • 295eaed: [HttpFoundation] renamed some HeaderUtils methods
  • 74aa515: [Messenger] late collect and clone messages
  • daf7ac0: [Messenger] reset traceable buses
  • 50fd769: [Serializer] add ->hasCacheableSupportsMethod() to CacheableSupportsMethodInterface
  • 47da23c: [Messenger] renamed Adapters to Transports
  • d9c3831: [Messenger] added a new time limit receiver

Newest issues and pull requests

They talked about us


Be trained by Symfony experts - 2018-05-14 Paris - 2018-05-14 Paris - 2018-05-16 Paris

Symfony 4.1.0-BETA1 released

$
0
0

Symfony 4.1.0-BETA1 has just been released. Here is a list of the most important changes:

  • feature #26945 [Messenger] Support configuring messages when dispatching (@ogizanagi)
  • feature #27168 [HttpKernel] Add Kernel::getAnnotatedClassesToCompile() (@nicolas-grekas)
  • feature #27170 Show the deprecations tab by default in the logger panel (@javiereguiluz)
  • feature #27130 [Messenger] Add a new time limit receiver (@sdelicata)
  • feature #27104 [DX] Redirect to proper Symfony version documentation (@noniagriconomie)
  • feature #27105 [Serializer] Add ->hasCacheableSupportsMethod() to CacheableSupportsMethodInterface (@nicolas-grekas)
  • feature #24896 Add COD _O _CONDUCT.md (@egircys)
  • feature #27092 [Workflow] "clear()" instead of "reset()" (@nicolas-grekas)
  • feature #26655 [WebProfilerBundle] Make WDT follow ajax requests if header set (@jeffreymb)
  • feature #27049 [Serializer] Cache the normalizer to use when possible (@dunglas, @nicolas-grekas)
  • feature #27062 [SecurityBundle] Register a UserProviderInterface alias if one provider only (@sroze)
  • feature #27065 [DI][Routing] Allow invokable objects to be used as PHP-DSL loaders (@aurimasniekis)
  • feature #26975 [Messenger] Add a memory limit option for ConsumeMessagesCommand (@sdelicata)
  • feature #26864 [Messenger] Define multiple buses from the framework.messenger.buses configuration (@sroze)
  • feature #27017 [Serializer] Allow to access to the context and various other infos in callbacks and max depth handler (@dunglas)
  • feature #26832 [MonologBridge] Added WebSubscriberProcessor to ease processor configuration (@lyrixx)
  • feature #24699 [HttpFoundation] Add HeaderUtils class (@c960657)
  • feature #26791 [BrowserKit] Bypass Header Informations (@cfjulien)
  • feature #26825 [Form] Add choic _translatio _locale option for Intl choice types (@yceruto, @fabpot)
  • feature #26921 [DI][FrameworkBundle] Hide service ids that start with a dot (@nicolas-grekas)
  • feature #23659 [HttpKernel] LoggerDataCollector: splitting logs on different sub-requests (@vtsykun)
  • feature #26768 [DI] Allow autoconfigured calls in PHP (@Gary PEGEOT, @GaryPEGEOT)
  • feature #26833 [HttpKernel] Added support for timings in ArgumentValueResolvers (@iltar)
  • feature #26770 Do not normalize array keys in twig globals (@lstrojny)
  • feature #26787 [Security] Make security.providers optional (@MatTheCat)
  • feature #26970 [VarDumper] Add dd() helper == dump() + exit() (@nicolas-grekas)
  • feature #26941 [Messenger] Allow to configure the transport (@sroze)
  • feature #26632 [Messenger] Add AMQP adapter (@sroze)
  • feature #26863 [Console] Support iterable in SymfonyStyle::write/writeln (@ogizanagi)
  • feature #26847 [Console] add support for iterable in output (@Tobion)
  • feature #26660 [SecurityBundle] allow using custom function inside allo _if expressions (@dmaicher)
  • feature #26096 [HttpFoundation] Added a migrating session handler (@rossmotley)
  • feature #26528 [Debug] Support any Throwable object in FlattenException (@derrabus)
  • feature #26811 [PhpUnitBridge] Search for other SYMFON _ env vars in phpunit.xml then phpunit.xml.dist (@lyrixx)
  • feature #26800 [PhpUnitBridge] Search for SYMFON _PHPUNI _REMOVE env var in phpunit.xml then phpunit.xml.dist (@lyrixx)
  • feature #26684 [Messenger] Remove the Doctrine middleware configuration from the FrameworkBundle (@sroze)
  • feature #21856 [LDAP] Allow adding and removing values to/from multi-valued attributes (@jean-gui)
  • feature #26767 [Form] ability to set rounding strategy for MoneyType (@syastrebov)
  • feature #23707 [Monolog Bridge][DX] Add a Monolog activation strategy for ignoring specific HTTP codes (@simshaun, @fabpot)
  • feature #26685 [Messenger] Add a MessageHandlerInterface (multiple messages + auto-configuration) (@sroze)
  • feature #26648 [Messenger] Added a middleware that validates messages (@Nyholm)
  • feature #26475 [HttpFoundation] split FileException into specialized ones about upload handling (@fmata)
  • feature #26702 Mark ExceptionInterfaces throwable (@ostrolucky)
  • feature #26656 [Workflow][Registry] Added a new 'all' method (@alexpozzi, @lyrixx)
  • feature #26693 [Console] Add box-double table style (@maidmaid)
  • feature #26698 [Console] Use UTF-8 bullet for listing (@ro0NL)
  • feature #26682 Improved the lint:xliff command (@javiereguiluz)
  • feature #26681 Allow to easily ask Symfony not to set a response to private automatically (@Toflar)
  • feature #26627 [DI] Add runtime service exceptions to improve the error message when controller arguments cannot be injected (@nicolas-grekas)
  • feature #26504 [FrameworkBundle] framework.ph _errors.log now accept a log level (@Simperfit)
  • feature #26498 Allow "json:" env var processor to accept null value (@mcfedr)
  • feature #25928 [DI] Allow binary values in parameters. (@bburnichon)
  • feature #26647 [Messenger] Add a middleware that wraps all handlers in one Doctrine transaction. (@Nyholm)
  • feature #26668 [WebProfilerBundle] Live duration of AJAX request (@ostrolucky)
  • feature #26650 [Messenger] Clone messages to show in profiler (@Nyholm)
  • feature #26281 [FrameworkBundle] keep query in redirect (@Simperfit)
  • feature #26665 Improved the Ajax profiler panel when there are exceptions (@javiereguiluz)
  • feature #26654 [VarDumper] Provide binary, allowing to start a server at any time (@ogizanagi)
  • feature #26332 Add a dat _help method in Form (@mpiot, @Nyholm)
  • feature #26671 More compact display of vendor code in exception pages (@javiereguiluz)
  • feature #26502 [Form] Add Bootstrap 4 style for field FileType (@zenmate)
  • feature #23888 [DI] Validate env vars in config (@ro0NL)
  • feature #26658 Adding support to bind scalar values to controller arguments (@weaverryan)
  • feature #26651 [Workflow] Added a TransitionException (@andrewtch, @lyrixx)
  • feature #23831 [VarDumper] Introduce a new way to collect dumps through a server dumper (@ogizanagi, @nicolas-grekas)
  • feature #26220 [HttpFoundation] Use pars _str() for query strings normalization (@nicolas-grekas)
  • feature #24411 [Messenger] Add a new Messenger component (@sroze)
  • feature #22150 [Serializer] Added a ConstraintViolationListNormalizer (@lyrixx)
  • feature #26639 [SecurityBundle] Added an alias from RoleHierarchyInterface to security.rol _hierarchy (@lyrixx)
  • feature #26636 [DI] deprecate TypedReference::canBeAutoregistered() and getRequiringClass() (@nicolas-grekas)
  • feature #26445 [Serializer] Ignore comments when decoding XML (@q0rban)
  • feature #26284 [Routing] allow no-slash root on imported routes (@nicolas-grekas)
  • feature #26092 [Workflow] Add a MetadataStore to fetch some metadata (@lyrixx)
  • feature #26121 [FrameworkBundle] feature: add the ability to search a route (@Simperfit)
  • feature #25197 [FrameworkBundle][TwigBridge] make csr _token() usable without forms (@xabbuh)
  • feature #25631 [DI] Service decoration: autowire the inner service (@dunglas)
  • feature #26076 [Workflow] Add transition blockers (@d-ph, @lyrixx)
  • feature #24363 [Console] Modify console output and print multiple modifyable sections (@pierredup)
  • feature #26381 Transform both switchToXHR() and removeXhr() to xmlHttpRequest() (@Simperfit)
  • feature #26449 Make ProgressBar::setMaxSteps public (@ostrolucky)
  • feature #26308 [Config] Introduce BuilderAwareInterface (@ro0NL)
  • feature #26518 [Routing] Allow inline definition of requirements and defaults (@nicolas-grekas)
  • feature #26143 [Routing] Implement i18n routing (@frankdejonge, @nicolas-grekas)
  • feature #26564 [HttpFoundation] deprecate call to Request::getSession() when Request::hasSession() returns false (@fmata)
  • feature #26408 Readd 'for _labe _errors' block to disable errors on form labels (@birkof)
  • feature #25456 [Console] Make pretty the box style table (@maidmaid)
  • feature #26499 [FrameworkBundle] Allow fetching private services from test clients (@nicolas-grekas)
  • feature #26509 [BrowserKit] Avoid nullable values in some Client's methods (@ossinkine)
  • feature #26288 [FrameworkBundle] show the unregistered command warning at the end of the list command (@Simperfit)
  • feature #26520 Added some HTML5 features to the Symfony Profiler (@javiereguiluz)
  • feature #26398 [WebProfilerBundle] Display the missing translation panel by default (@javiereguiluz)
  • feature #23409 [Security] AuthenticationUtils::getLastUsername() return type inconsistency (@vudaltsov)
  • feature #26439 [Console] [DX] Fix command description/help display (@noniagriconomie)
  • feature #26372 Revert "feature #24763 [Process] Allow writing portable "prepared" command lines (Simperfit)" (@nicolas-grekas)
  • feature #26223 [FrameworkBundle] Add command to delete an item from a cache pool (@pierredup)
  • feature #26341 Autoconfigure service locator tag (@apfelbox)
  • feature #26330 [FORM] Fix HTML errors. (@Nyholm)
  • feature #26334 [SecurityBundle] Deprecate switc _user.stateless config node (@chalasr)
  • feature #26304 [Routing] support scheme requirement without redirectable dumped matcher (@Tobion)
  • feature #26283 [Routing] Redirect from trailing slash to no-slash when possible (@nicolas-grekas)
  • feature #25732 [Console] Add option to automatically run suggested command if there is only 1 alternative (@pierredup)
  • feature #26085 Deprecate bundle:controller:action and service:method notation (@Tobion)
  • feature #26175 [Security] Add configuration for Argon2i encryption (@CoalaJoe)
  • feature #26075 [Validator] Deprecate use of Locale validation constraint without setting "canonicalize" option to true (@phansys)
  • feature #26218 [MonologBridge] Allow to change level format in ConsoleFormatter (@ostrolucky)
  • feature #26232 [Lock] Add a TTL to refresh lock (@jderusse)
  • feature #26108 [Serializer] Add a MaxDepth handler (@dunglas)
  • feature #24778 [BrowserKit] add a way to switch to ajax for one request (@Simperfit)
  • feature #25605 [PropertyInfo] Added support for extracting type from constructor (@lyrixx)
  • feature #24763 [Process] Allow writing portable "prepared" command lines (@Simperfit)
  • feature #25218 [Serializer] add a constructor arguement to return csv always as collection (@Simperfit)
  • feature #25369 [Serializer] add a context key to return always as collection for XmlEncoder (@Simperfit)
  • feature #26213 [FrameworkBundle] Add support to 307/308 HTTP status codes in RedirectController (@ZipoKing)
  • feature #26149 Added support for name on the unit node (@Nyholm)
  • feature #24308 [Validator] support protocolless urls validation (@MyDigitalLife)
  • feature #26059 [Routing] Match 77.7x faster by compiling routes in one regexp (@nicolas-grekas)
  • feature #22447 [WebProfilerBundle] Imply forward request by a new X-Previous-Debug-Token header (@ro0NL)
  • feature #26152 [Intl] Add polyfill for Locale::canonicalize() (@nicolas-grekas)
  • feature #26073 [DoctrineBridge] Add support for datetime immutable types in doctrine type guesser (@jvasseur)
  • feature #26079 [Workflow] Remove constraints on transition/place name + Updated Dumper (@lyrixx)
  • feature #23617 [PropertyInfo] Add hassers for accessors prefixes (@sebdec)
  • feature #25997 Always show all deprecations except legacy ones when not weak (@greg0ire)
  • feature #25582 [Form] Support DateTimeImmutable (@vudaltsov)
  • feature #24705 [Workflow] Add PlantUML dumper to workflow:dump command (@Plopix)
  • feature #24508 [Serializer] Fix security issue on CsvEncoder about CSV injection (@welcoMattic)
  • feature #25772 [Security] The AuthenticationException should implements Security's ExceptionInterface (@sroze)
  • feature #25164 [WebProfilerBundle] Improve controller linking (@ro0NL)
  • feature #22353 [Validator] Add canonicalize option for Locale validator (@phansys)
  • feature #26036 Added support for getting default values in Accept headers (@javiereguiluz)
  • feature #25780 [TwigBundle] Deprecating "false" in favor of "kernel.debug" as default value of "stric _variable" (@yceruto)
  • feature #23508 Deprecated the AdvancedUserInterface (@iltar)
  • feature #24781 [HttpFoundation] RedisSessionHandler (@dkarlovi)
  • feature #26028 Unwrap errors in FlattenException (@derrabus)
  • feature #25892 Adding an array adapter (@weaverryan)
  • feature #24894 [FrameworkBundle] add a notice when passing a routerInterface without warmupInterface in RouterCacheWarmer (@Simperfit)
  • feature #24632 [DependencyInjection] Anonymous services in PHP DSL (@unkind)
  • feature #25836 [HttpKernel] Make session-related services extra-lazy (@nicolas-grekas)
  • feature #25775 Introduce signaled process specific exception class (@Soullivaneuh)
  • feature #22253 [Config] allow changing the path separator (@bburnichon)
  • feature #25493 [Serializer] defaul _constructo _arguments context option for denormalization (@Nek-)
  • feature #25839 [SecurityBundle] Deprecate i _memory.user abstract service (@chalasr)
  • feature #24392 Display orphaned events in profiler (@kejwmen)
  • feature #25275 [DI] Allow for invokable event listeners (@ro0NL)
  • feature #25627 [DI] Add a simple CSV env var processor (@dunglas)
  • feature #25092 [Security] #25091 add target user to SwitchUserListener (@jwmickey)
  • feature #24777 [TwigBundle] Added priority to twig extensions (@Brunty)
  • feature #25710 [FrameworkBundle] add cache.app.simple psr simple cache (@dmaicher)
  • feature #25669 [Security] Fail gracefully if the security token cannot be unserialized from the session (@thewilkybarkid)
  • feature #25504 [Validator] Add option to pass custom values to Expression validator (@ostrolucky)
  • feature #25701 [FrameworkBundle] add autowiring aliases for TranslationReaderInterface, ExtractorInterface & TranslationWriterInterface (@Dennis Langen)
  • feature #25516 [Validator] Deprecated "checkDNS" option in Url constraint (@ro0NL)
  • feature #25588 Move SecurityUserValueResolver to security-http (@chalasr)
  • feature #25629 [Process] Make PhpExecutableFinder look for the PH _BINARY env var (@nicolas-grekas)
  • feature #25562 allow autowire for htt _utils class (@do-see)
  • feature #25478 [FrameworkBundle] add emai _validatio _mode option (@xabbuh)
  • feature #25366 [HttpKernel] Decouple exception logging from rendering (@ro0NL)
  • feature #25450 [PropertyAccess] add more information to NoSuchPropertyException Message (@Simperfit)
  • feature #25148 Pr/workflow name as graph label (@shdev)
  • feature #25324 [HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize() (@Simperfit)
  • feature #24738 [FrameworkBundle][Routing] Use a PSR-11 container in FrameworkBundle Router (@ogizanagi)
  • feature #25439 Add ControllerTrait::getParameter() (@chalasr)
  • feature #25332 [VarDumper] Allow VarDumperTestTrait expectation to be non-scalar (@romainneutron)
  • feature #25301 [Console] Add box style table (@maidmaid)
  • feature #25415 [FrameworkBundle] Add atom editor to ide config (@lexcast)
  • feature #24442 [Validator] Html5 Email Validation (@PurpleBooth)
  • feature #25288 [DI][FrameworkBundle] Add PSR-11 "ContainerBag" to access parameters as-a-service (@nicolas-grekas, @sroze)
  • feature #25290 [FrameworkBundle] debug:autowiring: don't list FQCN when they are aliased (@nicolas-grekas)
  • feature #24375 [Serializer] Serialize and deserialize from abstract classes (@sroze)
  • feature #25346 [DoctrineBridge] DoctrineDataCollector comments the non runnable part of the query (@Simperfit)
  • feature #24216 added clean option to assets install command (@robinlehrmann)
  • feature #25142 [Process] Create a "isTtySupported" static method (@nesk)
  • feature #24751 [Workflow] Introduce a Workflow interface (@Simperfit)
  • feature #25293 [Routing] Parse PHP constants in YAML routing files (@ostrolucky)
  • feature #25295 [Translation] Parse PHP constants in YAML translation files (@ostrolucky)
  • feature #25294 [Serializer] Parse PHP constants in YAML mappings (@ostrolucky)
  • feature #24637 [FrameworkBundle] Improve the DX of TemplateController when using SF 4 (@dunglas)
  • feature #25178 [Routing] Allow to set name prefixes from the configuration (@sroze)
  • feature #25237 [VarDumper] add a GMP caster in order to cast GMP resources into string or integer (@Simperfit)
  • feature #25166 [WebProfilerBundle] Expose dotenv variables (@ro0NL)
  • feature #24785 [Profiler][Translation] Logging false by default and desactivated when using the profiler (@Simperfit)
  • feature #24826 [FrameworkBundle] Allow to pass a logger instance to the Router (@ogizanagi)
  • feature #24937 [DependencyInjection] Added support for variadics in named arguments (@PabloKowalczyk)
  • feature #24819 [Console] add setInputs to ApplicationTester and share some code (@Simperfit)
  • feature #25131 [SecurityBundle][Security][Translation] trigger some deprecations for legacy methods (@xabbuh)

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

Diversity initiative Update #2

$
0
0

A few days ago Symfony adopted a code of conduct and a process for enforcing it. While this was a major effort of the diversity initiative which took several months to complete, it should not change how we interact. The fundamental rules of how we treat each other already have now simply been written down. More importantly we have thought about how to deal with incidents in case someone thinks these rules have not been followed. So while nothing changes for the bulk of our community, we hope that in the edge cases where people don’t treat each other well, we can now give them a clear communication path to getting the situation resolved.

What is a Code of Conduct?

Egidijus Girčys

Contributed by
Egidijus Girčys
in #9394.

"A code of conduct is a set of rules outlining the social norms and rules and responsibilities of, or proper practices for, an individual, party or organization." (quoted from). A code of conduct includes a statement of unacceptable behavior, how it is enforced and to whom an incident should be reported to (see also). It is not meant to be used to police people but mainly for:

  • Making it clear that our space is safe for anyone;
  • Helping anyone who experiences intimidation or harassment to feel safer coming forward;
  • Encouraging people to feel more comfortable stepping in and taking care of their fellow community members.

For further reading check.

Why is a code of conduct necessary?

Michelle Sanver

Contributed by
Michelle Sanver
in #9393.

In general when people come together good things happen, but sometimes problems occur. Ideally people work out issues on their own, learn from their mistakes and move on. However sometimes this doesn't work. Members part of minority groups are more often the target of misconduct than others. This creates a vicious circle where those smaller demographics become the most likely to leave the community. It is often hard to even realize the gravity of this problem for members not part of a marginalized group. We created a document of cases that have been reported, or experienced by members of PHPWomen to illustrate just how bad things can get. We will continuously update this document with our own experiences, as time passes in case incidents happen. Of course we hope this document won't grow further!

Why this code of conduct?

There are few codes of conduct written in the OSS space. Like Django, Python or Ubuntu. The adapted version of the Contributor Covenant is widely spread in the OSS with a public list of adopters. We felt it has the best balance between being not too vague and specific enough, describing the unacceptable behavior and what steps will be taken in such situations.

How will it affect me?

To put it in other words, the code of conduct defines rules for a respectful communication style that is welcoming to a diverse community. However these rules largely already existed before the formal adoption of this code of conduct. This code of conduct covers all communication on the official Symfony maintained channels, like this blog, the Symfony documentation, the Slack chat and the non-maintained channels like social networks or forums.

To clarify, if a user on Twitter posts through the official Symfony account (e.g. http://twitter.com/symfony), then they should follow the code of conduct. On the other hand, if the same user has a second Twitter account with no official relation to Symfony, then the code of conduct would not apply there.

How will the code of conduct be enforced?

Tobias NyholmIltar van der Berg

Contributed by
Tobias Nyholm and Iltar van der Berg
in #9340 and #9750.

The introduced code of conduct is not a bulletproof document that covers all possible cases of misconduct, but it is specific enough to handle the most common issues that might occur. An important part of the code of conduct is enforcement. If a community member encounters an issue of harassment or other unwanted behaviour, they can report it to the CARE team (CoC Active Response Ensurers). Note the CARE team will soon be appointed by Fabien.

The process for reporting and enforcement is detailed here. Once an incident has been reported, the CARE team will then take over from there and handle the case. The guidelines are adapted from Stumptown Syndicate and the Django Software Foundation.

Sponsoring

We intend to organize a training for the CARE team and some of the people involved in running SymfonyLive events, to ensure that they are prepared to handle incident reports in a professional manner. Obviously this sort of thing costs money. There are often ideas coming up that may require additional funds. Any organization interested in sponsoring the diversity initiative, please contact me so that I can maintain a list of potential sponsors for the various initiatives.

Documentation translation

Moving on to another topic, one point of discussion is the fact that our documentation is only available in English. In the past we had French and Italian translations, but they were dropped since it was simply impossible to keep them up to date given the rapid pace on the English documentation. However we have taken steps to make the experience with Google Translate hopefully acceptable. Doctrine has now taken things a step further by offering a dropdown on all documentation pages to get a translation of any given page more easily. It would be interesting to get some feedback from the community on how useful they think this is and if we should do something similar for Symfony.

SymfonyLive going global

So far we have SymfonyLive events mostly in Europe and a few in the US. For next year our goal is to bring SymfonyLive to more continents. We are already fairly far in the discussions for some specific locations on continents that have so far been left behind. That being said, this all depends on local people assisting the experienced event team at Symfony to make this happen. So anyone who is serious about bringing the SymfonyLive format to your country, get in touch with Nicolas.


Be trained by Symfony experts - 2018-05-14 Paris - 2018-05-14 Paris - 2018-05-16 Paris

Symfony Website Updates #2

$
0
0

Lately we've been busy improving and adding features to the symfony.com website. This article recaps the most important new features.

See past events and add events to your calendar

The Events & Meetups section, where anybody from the community can publish their Symfony-related events, has been improved to show all the past events. This will give more visibility to the community events and it will help you find events celebrated near the place you live.

In addition, submitted events now must define their timezone. This allows us to display an Add to my calendar button to the upcoming events. This button downloads a *.ics file to add the event to your Google, Outlook or Apple calendar:

Filter "New in Symfony" posts

Living on the Edge is the most popular category of our blog. It mostly contains "New in Symfony" posts explaining the new features added to each Symfony version. Sometimes you need to browse the new features of past Symfony versions, for example to check when a certain feature was added.

That's why we've added a "Filter by Symfony version" feature to help you browse those past Symfony versions:

Give contributors more visibility

Symfony is lucky to have thousands of contributors and we want to highlight their work more prominently. That's why in the footer of every symfony.com page you'll see a randomly picked contributor:

A different contributor is shown on each page reload, so you can try to reload the page until you see yourself featured on symfony.com (keep in mind that some pages are cached and the contributor doesn't change for a few minutes).

Related to this, in the Contributing section of the main Symfony Community page we now highlight some randomly picked contributors:

Diversity and inclusion

A recent blog post explained the latest diversity initiative updates, such as the adoption of a Code of Conduct and more. This diversity initiative is here to stay, so we are slowly improving symfony.com around it.

First, there is a new Symfony Diversity category in the official blog, so you can easily stay updated about it. Also, there is a new Diversity and Inclusion section in the main Symfony Community page with links to the most important resources related to that topic.

Diversity and Inclusion is also about making people with disabilities part of the community. That's why accessibility is an integral part of diversity. During the past months we've been tirelessly fixing web accessibility issues, tweaking colors to increase their contrast, making forms friendly to screen readers, etc.

The result, as measured by the A11yM accessibility test service is that we've fixed more than 2,000 accessibility errors on symfony.com during the past four months. There's still lot of work to do, but we're on the right track.

A new "dark theme"

The design of symfony.com is based on a pure white background which creates a clean and minimalist experience. However, some people don't like that because it's too bright in low light conditions and it can even cause headaches to them after long exposures (e.g. when reading the docs).

That's why we've introduced a new "dark theme" / "night mode" that changes the design to a black-based color palette. Click on the "Switch to dark theme" link at the bottom of the sidebar to test it in your own browser:


Be trained by Symfony experts - 2018-05-14 Paris - 2018-05-14 Paris - 2018-05-16 Paris
Viewing all 3075 articles
Browse latest View live