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

A Week of Symfony #661 (26 August - 1 September 2019)

$
0
0

This week, Symfony 3.4.31 and 4.3.4 maintenance versions were released. Meanwhile, the SymfonyLive London 2019 conference announced its workshops, talks and some surprises related to new Symfony components. Secure your seat now at the best price until September 6th.

Symfony development highlights

This week, 35 pull requests were merged (27 in code and 8 in docs) and 29 issues were closed (23 in code and 6 in docs). Excluding merges, 19 authors made 1,183 additions and 650 deletions. See details for code and docs.

3.4 changelog:

  • e9886e4: fixed return types declarations
  • a5d776d: [DependencyInjection] fixed the getServiceIds implementation to always return aliases
  • b3cf4fb: [Yaml] fixed dumping not inlined scalar tag values
  • 593ec61: [ProxyManager] removed ProxiedMethodReturnExpression polyfill
  • bff9574: [HttpFoundation] return null as Expire header if it was set to null
  • 720ffd8: [Console] allow Command::getName() to return null

4.3 changelog:

  • 113fa0b: [Messenger] stop worker when it should stop
  • 4b66bee: [Routing] fixed static route reordering when a previous dynamic route conflicts
  • d67289c: [FrameworkBundle] fixed about command not showing .env vars
  • b9f8c7b: [Mailer] removed the default dispatcher in AbstractTransport

4.4 changelog:

  • d887a0d: [ErrorHandler] made DebugClassLoader able to add return type declarations
  • db9549d: [HttpKernel] do not mock removed getPublicDir() method
  • 545d38a: allow configuring class names through methods instead of class parameters in Doctrine extensions

Master changelog:

  • 6c9b87c: [TwigBridge] throw an exception when one uses email as a context variable in a TemplatedEmail
  • 760160f: [Security] drop support for non-boolean return values from checkCredentials()
  • b273561: added parameter type declarations to magic methods

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2019-09-2 Clichy - 2019-09-2 Clichy - 2019-09-4 Clichy

A Week of Symfony #662 (2-8 September 2019)

$
0
0

This week, Symfony improved handling of HTTP/2 PUSH and fixed support for 103 Early Hints status code in the HttpClient. Meanwhile, the Mailer component added support for multiple mailers and improved the DSN syntax. Finally, the Console component introduced a new definition list and horizontal table feature.

Symfony development highlights

This week, 76 pull requests were merged (57 in code and 19 in docs) and 47 issues were closed (39 in code and 8 in docs). Excluding merges, 28 authors made 3,797 additions and 1,487 deletions. See details for code and docs.

3.4 changelog:

  • 726999d: [PHPUnit Bridge] avoid registering listener twice
  • 38514cb: [Validator] sync string to date behavior and throw a better exception
  • 33c02ae: [Validator] add ConstraintValidator::formatValue() tests
  • 206ad49: [HttpKernel] fixed Apache mod_expires Session Cache-Control issue
  • 47a8784: [HttpKernel] fixed getFileLinkFormat() to avoid returning the wrong URL in Profiler

4.3 changelog:

  • ca16f52: [Mailer] fixed Mailgun support when a response is not JSON as expected
  • 4ee3c6b: [DependencyInjection] fixed support for '!tagged_locator foo'
  • c0f4037: [Validator] only handle numeric values in DivisibleBy
  • f48ebfa: [HttpClient] improved handling of HTTP/2 PUSH and disable it by default
  • a99a480: [HttpClient] fixed a bug preventing Server Pushes to be handled properly
  • 29355c0: [HttpClient] fixed support for 103 Early Hints and other informational status codes
  • 828e5a4: [Mailer] maintained sender/recipient name in SMTP envelopes
  • d081f16: [Messenger] fixed empty amqp body returned as false
  • 54a514f: [Router] routing cache crash when using generator_class

4.4 changelog:

  • ef2b65a: [Mailer] renamed getName() to toString()
  • 378abfa: [Mailer] changed the DSN semantics
  • 2ad7f97: [Mailer] added support for multiple mailers
  • 9690562: [Translator] allow nullable message ID
  • 1bfefef: [TwigBridge] lint all templates from configured Twig paths if no argument was provided
  • bb3652a: [ErrorHandler] registered a basic exception handler for late failures
  • a1a914e: [ErrorHandler] display deprecations for not-autoloaded classes
  • 6988286: [Mailer] improve an exception when trying to send a RawMessage without an Envelope
  • b7371ea: added new ErrorController + Preview and enabling there the error renderer mechanism
  • eb0ffbc: [Validator] deprecated CacheInterface in favor of PSR-6
  • 8e50eb9: comparing roles to detected that users has changed
  • b58876c: [Mailer] check email validity before opening an SMTP connection
  • d6ac452: [Mailer] changed DSN syntax
  • 8f84347: [Console] added support for definition list and horizontal table
  • 4234601: deprecated not passing dash symbol (-) to STDIN commands
  • 8aa708e: [VarDumper] display fully qualified title
  • e776419: [OptionsResolver] display full nested option hierarchy in exceptions
  • dc75ae2: new welcome page on startup for 4.4 LTS & 5.0
  • 6916822: [Serializer] allow multi-dimenstion object array in AbstractObjectNormalizer

Master changelog:

  • 4a32a98: [HttpFoundation] cast getInt to integer
  • 6651ee9: [TwigBundle] removed legacy code
  • 407652b: made dispatched events really final

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2019-09-9 Clichy - 2019-09-10 Clichy - 2019-09-12 Clichy

A Week of Symfony #663 (9-15 September 2019)

$
0
0

This week, Symfony development activity focused on minor tweaks and fixes, such as fixing our preloader for the upcoming PHP 7.4 version. In addition, the community proposed to add .gitattributes to all Symfony packages to exclude non-required files. Lastly, Fabien announced the new Notifier component during his keynote at the SymfonyLive London 2019 conference.

Symfony development highlights

This week, 60 pull requests were merged (42 in code and 18 in docs) and 42 issues were closed (27 in code and 15 in docs). Excluding merges, 25 authors made 2,672 additions and 2,800 deletions. See details for code and docs.

3.4 changelog:

  • f7130e3: [Yaml] don't dump a scalar tag value on its own line
  • d6855d4: [Console] get dimensions from stty on Windows if possible
  • cac27b2: [Inflector] add support 'see' to 'ee' for singularize

4.3 changelog:

  • 2c87f69: dirname simplification
  • 22b4586: [HttpClient] re-enable Server Push support
  • 6ea7f30: [DependencyInjection] accept existing interfaces as valid named args
  • 5914a1f: [Yaml] properly catch legacy tag syntax usages
  • 4a866d0: [Cache] fixed cache pools affecting each other due to an overwritten seed variable

4.4 changelog:

  • 312cbf9: [Cache] add types to constructors and private/final/internal methods
  • e9f524a: [HttpClient] allow enabling buffering conditionally with a Closure
  • 92e64a1: require exact match when reading from stdin with a dash
  • 1c3d409, c403706, f0aff8c: [DependencyInjection] fixed PHP 7.4 preloader
  • 541f80c: [DependencyInjection] used dirname() when possible
  • bed6511: [WebProfilerBundle] assign automatic colors to custom Stopwatch categories
  • 8ca975d: [HttpKernel] fixed compat with legacy DebugClassLoader
  • 419be6a: [SecurityBundle] moved Anonymous DI integration to new AnonymousFactory
  • 4b701bb: [FrameworkBundle, ErrorRenderer] used FileLinkFormatter service when possible
  • 74d5fa6: [Workflow] use a better exception message when many workflows are found
  • b07df9d: [Mailer] renamed SmtpEnvelope to Envelope
  • 60e3de6: minor tweaks to the new Welcome Page

Master changelog:

  • afe5188: removed legacy code from STDIN commands
  • 3f0cf49: [HttpClient] fixed calling the buffer-enabling callback
  • c0f0b8a: [Console] used correct EventDispatcherInterface
  • 3db419e: [DoctrineBridge] getMetadataDriverClass() is abstract now

Symfony Binary

The Symfony binary, which provides tools for developing Symfony applications in your local machine, released its new4.7.0 version with the following changes:

  • Display an error when trying to retrieve a environment variable value marked as sensitive
  • Fix a panic when a Docker env var is empty
  • Improve messages for plan/storage update
  • Use composer.phar from the project directory if present
  • Disable timeouts on billing API
  • Fix Slack tokens for integrations setup are not properly validated
  • Add support for Strong Customer Authentication in payment process

Newest issues and pull requests

They talked about us

Call to Action


Be trained by Symfony experts - 2019-09-16 Cologne - 2019-09-16 Cologne - 2019-09-16 Clichy

SymfonyCon Amsterdam: schedule part 3 is online (almost final one)!

$
0
0

We have announced the first part and the second part of the conference schedule in previous blog posts. We are now very happy to announce the third part of the talks and speakers selected for SymfonyCon Amsterdam 2019. As a reminder, we will have 3 tracks this year.

We are pleased to announce the selection of 8 more speakers for the conference. We would like to thank once again all the people who submitted a topic to our call for papers.

Discover the new speakers added to the list and the talks they will deliver during the conference:

  • Ryan Weaver, Symfony Core Team Member, will share his experience and talk about “Prime Time with Messenger: Queues, Workers & more Fun!”. In Symfony 4.4, Messenger will lose its experimental label and officially become stable! In this talk, he'll go through Messenger from the ground-up: learning about messages, message handlers, transports and how to consume messages asynchronously via worker commands. Everything you need to make your app faster by delaying work until later. He will also talk about the many new features that were added to Messenger since Symfony 4.3, like retries, the failure transport and support for using Doctrine and Redis as transports.

  • Lander Vanderstraeten, PHP developer and PHPro, will present a talk about “Eeek, my tests are mutating!”. Writing tests is nice, but how are you sure that your tests cover all use cases? Code coverage can give false positive metrics. A new way of working that goes by the name of mutation testing has gained a lot of popularity lately. This talk will explain you what it is, how you can integrate it and contains a demo over the basics of mutation testing with infection and phpspec.

  • Grégoire Hébert, Senior Developer, trainer and CEO of MasterClass By Les-Tilleuls, will introduce to you “Together towards an AI, NEAT plus ultra”. You've heard about AI for some time. But it remains obscure for you. How does it work, what is behind this word? If for you, reading white papers or doctoral paper is not your thing, that the Tensorflow doc is just a big pile of words for you, and if you've seen unclear presentations using the same vocabulary without really giving you an idea of how it works and how to implement an AI at home ... This presentation is for you. At its end, you will be able to play with an AI, simple, but that will serve as a gateway to the beautiful world of machine-learning.

  • Sebastian Bergmann, Co-Founder and Principal Consultant at thePHP.cc, will deliver a talk about "PHPUnit Best Practices". While PHPUnit is not difficult to set up and writing tests with it is easy, you will get better results and save development time if you know the tips and tricks to leverage PHPUnit more effectively. This session, presented by the creator of PHPUnit, teaches best practices you can use to ensure that your unit testing effort is efficiently implemented.

  • Juciellen Cabrera, Software Engineer, "Symfony Serializer: There and back again". When you are developing APIs sometimes you need return the same object with different ways. Furthermore a object can be complex due your relashionships with others objects turning serialization process such hard. The Symfony Serializer Component makes possible manage how you wants to serialize objects for json, xml e other options. Also you can manage responses using serialization groups, choosing which properties you want, handling Serialization Depth and much more.

  • Titouan Galopin, product manager at SymfonyInsight, will speak about “Demystifying React JS for Symfony developers”. The world of JavaScript is vast and exciting... but it can also be quite scary! It is an innovative world in which new technologies appear all the time, which can make it difficult for developers to keep up to date. One of the most famous of these technologies is probably React JS. It changed the way we conceive User Interfaces, both in the browser and in mobile applications. But understanding it can be challenging. Let's demystify it together so that you can enter the world of JavaScript with confidence!

  • Tobias Nyholm, Symfony Core Team and Symfony CARE team member, will talk about “Building really fast applications”. What can we do to make an application run faster? What should we be considering when starting a new application? There are some quick fixes that he will quickly cover. But to get down to really fast response times requires hard work. He will give his best ideas and tricks for fast apps. He will show how we can build applications that responds in less that 15ms and then work towards even faster than that.

  • Marc Weistroff, CTO at Blackfire.io, will be on stage talking about “Integrating performance management in your development cycle”. Good performance is crucial for online businesses and it should be taken very seriously. While this is common knowledge, it is usually not prioritized in development cycles. This leads to higher development cost as teams found themselves in situations of fire-fighting. By integrating performance management early in the development process, the cost is reduced, chances of performance regression are lessened, same as the business risks. Using Blackfire, we will see why performance management should be integrated in a SymfonyCloud project early in every environment from development to testing to production.

Find out the conference schedule and start to create your own! We will also have an unconference track on the second day of the conference, more details about it soon!

The last speakers and talks will be announced in a few days, stay tuned!

Not registered yet? Purchase your conference or combo ticket before price increase on Monday Sept, 30th!

See you soon at the International conference of the year!


Be trained by Symfony experts - 2019-09-23 Lille - 2019-09-25 Lille - 2019-09-30 Clichy

A Week of Symfony #664 (16-22 September 2019)

$
0
0

This week, Symfony added support for the upcoming Twig 3 version, improved the test suite to fix unrelated test failures, and added a new feature to send notification emails. In addition, the new String component that allows to work with all kinds of strings in an object oriented fashion was nearly completed. Finally, the third part of the SymfonyCon Amsterdam conference schedule was announced.

Symfony development highlights

This week, 74 pull requests were merged (43 in code and 31 in docs) and 63 issues were closed (34 in code and 29 in docs). Excluding merges, 27 authors made 3,947 additions and 813 deletions. See details for code and docs.

3.4 changelog:

  • 6fad4f1: [PropertyInfo] ensure compatibility with type resolver
  • 6bf2dd9, f158d4f: install from source to include components tests
  • 1ab8fff: re-enabled previously failing PHP 7.4 test cases

4.3 changelog:

  • ad6dc2e: [Finder] adjust regex to correctly match comments in gitignore contents
  • 23f64d5: [HttpClient] add default value for Accept header
  • 1575e27: [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted

4.4 changelog:

  • 7f81cb5: [Messenger] don't deep-merge senders configuration
  • 2ae76f9: [Messenger] fixed exception message of failed message is dropped on retry
  • 4c470a9, 8ccacab: minor design updates in the new Welcome page
  • 92ef476: [DependencyInjection] allow binding iterable and tagged services
  • 41a450b: fixed lint commands frozen on empty stdin
  • 6230465: [Twig] added NotificationEmail
  • b5ff996: [ErrorRenderer] fixed cannot use object of type ErrorException as array exception

Master changelog:

  • aec06c3: [TwigBundle] fixed accessing service arguments

Newest issues and pull requests

They talked about us

Call to Action


Be trained by Symfony experts - 2019-09-23 Lille - 2019-09-25 Lille - 2019-09-30 Clichy

SymfonyLive London 2019 was a great success!

$
0
0

Last Friday, we had the chance to meet the British community during the SymfonyLive London 2019. We were thrilled to welcome more than 250 people, 14 speakers and our amazing sponsors at the 8th edition of the Symfony conference at the Park Plaza Westminster Bridge. We thoroughly enjoyed our time in London and hope that the attendees left with plenty of new, exciting Symfony knowledge and fresh ideas to continue building their experience and business.

Let’s wrap up the past Symfony days starting with the pre-conference workshops

A big shout out to our fantastic trainers for sharing their knowledge during the pre-conference workshop day: Kévin Dunglas, Nicolas Grekas and Titouan Galopin! We offered the attendees the choice within 3 interesting workshops, among them: Practical Design Patterns with Symfony, Building API-driven apps with API Platform, and Getting Ready for Symfony 5. It was a good way for all the workshop trainees to enhance their knowledge and experience before the conference. Attending a pre-conference workshop is always a good idea to learn new skills, best practices and more. We hope that you learned a lot during this day!

September 13th : Conference day

We had the chance to welcome 13 amazing speakers on the SymfonyLive London stage! We would like to thank them for delivering their talks with success and sharing their experience with the audience. The event started with Fabien Potencier's Keynote during which he unveiled a new component: Symfony Notifier.
We ended up the day with Nicolas Grekas’ presentation of the new Symfony String component right before we got to share a perfect moment altogether during the conference social event.

All the talks of the conference have been recorded. You will be able to watch them online very soon! They will be available on SymfonyCasts for everyone but only available to all the conference attendees for free. We will also upload them later on our YouTube channel (free for everyone)!

Also, we would like to give a big thank you to our sponsors : Gold sponsors : Blackfire, Netgen layouts and SensioLabsLanyard sponsor : Blackfire

Thank you again to all the attendees, the speakers and the sponsors. This conference was a blast!

See you all in Amsterdam for the last conference of 2019, November 21-23. If you are not registered yet you can still register and secure your seat for SymfonyCon Amsterdam 2019!


Be trained by Symfony experts - 2019-09-25 Lille - 2019-09-30 Clichy - 2019-09-30 Clichy

A Week of Symfony #665 (23-29 September 2019)

$
0
0

This week, Symfony worked on several pending features in preparation for the "feature freeze" period which starts next week: stateful firewalls now turn responses private only when needed, isGranted()/decide() no longer accept more than one role/attribute, the files generated by the profiler are now compressed and firewalls added a new anonymous lazy mode. Lastly, the new String component was finally merged to provide object-oriented strings management with an abstract unit system.

Symfony development highlights

This week, 124 pull requests were merged (67 in code and 57 in docs) and 59 issues were closed (35 in code and 24 in docs). Excluding merges, 62 authors made 7,660 additions and 3,820 deletions. See details for code and docs.

3.4 changelog:

  • 35b6701: [Lock] use Predis\ClientInterface instead of Predis\Client
  • bb96c34: [Validator] added the missing translations for the Azerbaijani locale
  • 4b2019d: [FrameworkBundle] fixed framework bundle lock configuration
  • 650f179: [Translation] collect original locale in case of fallback translation
  • 8dc0814: [WebProfilerBundle] fixed toolbar load when GET params are present in "_wdt" route
  • ad89564: [Validator] accept underscores in the URL validator
  • 293a22a: [DependencyInjection] fixed wrong exception when service is synthetic

4.3 changelog:

  • acca7ad: [Mime] apply RFC2047 encoding only to one header
  • a53732f: [Security] used LegacyEventDispatcherProxy
  • 479d8ee: [Form] added missing row_attr option to FormType
  • 29a54c5: [Mailer, Messenger] ensure legacy event dispatcher compatibility
  • d04fdee: [Form] names for buttons should start with lowercase
  • 0222ea5: [Cache] fail gracefully when locking is not supported
  • dff71ce: [HttpClient] fixed race condition when reading response with informational status
  • abf11d8: [Messenger] return empty envelopes when RetryableException occurs
  • 944cda7: [Console] do not include hidden commands in suggested alternatives
  • ca25396: [HttpFoundation] allowed additinal characters in not raw cookies

4.4 changelog:

  • 8eaa5a8: allow using Twig 3
  • b00b633: [Form] added "validate" option to SubmitType
  • e84bd65: [Security] made stateful firewalls turn responses private only when needed
  • 3c7172d: [Security] deprecated isGranted()/decide() on more than one attribute
  • e2e73ef: [Messenger] added support for from_transport attribute on messenger.message_handler tag
  • 89d7931: [HttpKernel] compress files generated by the profiler
  • 745248f: [ErrorHandler] don't throw deprecations for return-types by default
  • b180208: [ErrorHandler] show fallback error page when default error controller is disabled
  • 4cf7ec1: [Yaml] fixed parsing inline YAML spanning multiple lines
  • db5cf1a: [DependencyInjection] scoped singly-implemented interfaces detection by file
  • 098584a: [FrameworkBundle] sort tagged services
  • b0c2112: [Messenger] displayed real handler if handler is wrapped
  • 7f43dc4: [DoctrineBridge] used VarCloner data instead of legacy array for query params
  • 7a3bfac: [HttpFoundation] optimized normalization of headers
  • 66f8f68: [DependencyInjection] replaced REMOTE_ADDR in trusted proxies with the current REMOTE_ADDR
  • b1f6d0d: added types to constructors and private/final/internal methods
  • b829439: [ErrorHandler] forwarded \Throwable
  • 7d6b657: [DomCrawler] add a normalizeWhitespace argument to text() method
  • 6fef3fb: [Security] added anonymous lazy mode to firewalls
  • ae61ae5: [Messenger] improved error message when routing to an invalid transport
  • e627989: [Console] do not leak hidden console commands
  • 5440d67: [VarDumper] output the location of calls to dump()

Master changelog:

  • ec2afb7, 77e42d8: [Security] removed deprecated code paths
  • 5d154fb: [String] a new component for object-oriented strings management with an abstract unit system
  • 979be29: [FrameworkBundle] WebTestCase KernelBrowser::getContainer null return type

Newest issues and pull requests

They talked about us

Call to Action


Be trained by Symfony experts - 2019-09-30 Clichy - 2019-09-30 Clichy - 2019-10-2 Clichy

A Week of Symfony #666 (30 September - 6 October 2019)

$
0
0

This week, Symfony continued fixing bugs and polishing the new features of the upcoming Symfony 4.4 version. Meanwhile, the new String component introduced in Symfony 5.0 added a locale-aware Slugger with support for transliterating multiple locales. Lastly, the new Notifier component was merged as an experimental feature in the upcoming Symfony 5.0 version.

Symfony development highlights

This week, 86 pull requests were merged (63 in code and 23 in docs) and 46 issues were closed (36 in code and 10 in docs). Excluding merges, 44 authors made 11,394 additions and 9,053 deletions. See details for code and docs.

3.4 changelog:

  • 03f2adc: [Cache] fixed known tag versions ttl check
  • a2cd56c: [Serializer] fixed denormalization of string-arrays with only one element
  • a824e08: [Security/Http] fixed parsing X509 emailAddress
  • d2b66ff: [CssSelector] fixed the :only-of-type pseudo class selector
  • db9ef8a: [FrameworkBundle] added RedirectController to annotation cache
  • e7f7041: [HttpFoundation] check if data passed to SessionBagProxy::initialize is an array
  • 8622c8c: [Security] don't let falsy usernames slip through impersonation
  • 14d0e27: [Intl] updated the ICU data to 65.1
  • c91e7ca: [Validator] updated Finnish translation
  • 14ccaf5: [Validator] updated Thai translation

4.3 changelog:

  • abe2745: [Workflow] fixed BC break on WorkflowInterface
  • 3786d4e: [Cache] fixed logger usage in CacheTrait::doGet()
  • 1124809: [HttpClient] fixed "no_proxy" option ignored in NativeHttpClient
  • 6016070: [Cache] give 100ms before starting the expiration countdown
  • b92d944: [Routing] gracefully handle docref_root ini setting

4.4 changelog:

  • 5b7848c: [Serializer] deprecated the XmlEncoder::TYPE_CASE_ATTRIBUTES constant
  • 526fd9f: [HttpKernel] wrap compilation of the container in an opportunistic lock
  • 7020f26: [Cache] fixed Redis Sentinel usage when only one Sentinel specified
  • e3aed10: [DependencyInjection] don't mandate a class on inline services with a factory
  • 4d6fe5c: [WebProfilerBundle] try to display the most useful panel by default
  • badb656: [DependencyInjection] added tests loading calls with returns-clone
  • 69928be: [EventDispatcher] added tests for aliased events
  • 67fe198: [DependencyInjection] added ability to define a priority method for tagged service
  • b2d6c10: added types to constructors and private/final/internal methods
  • 76e5ea8: [HttpKernel] inherit Throwable in HttpExceptionInterface
  • 2ccecbe: [Form] added CountryType option for using alpha3 country codes
  • 496346c: [Validator] fixed wrong expression language value
  • 3a66d59: [CssSelector] support *:only-of-type

Master changelog:

  • 5e48c39: [HttpKernel] drop support for retrieving container from non-booted kernels
  • c75098e: [Console] removed abbreviation support for hidden commands
  • 564a657: [String] fixed beforeLast/afterLast
  • a176d1a: [String] fixed toAscii()
  • c2111be: [Console] added deprecation message for non-int statusCode
  • 4a547c5: [Workflow] fixed default marking store value of Workflow
  • 1e4d873: [String] introduced a locale-aware Slugger
  • ebda9d1: [Console] throw a TypeError for non-int return value calling Command::execute()
  • 8375c6b: Introduced the Notifier component

Symfony Binary

The Symfony binary, which provides tools for developing Symfony applications in your local machine, released its new4.7.1 version with the following changes:

  • Fix formatting health.* integrations details
  • Automatically specify project ID when using open:support or open:issue
  • Don't display 'Remote and local environments are out-of-sync' warning when using the --project flag
  • Fix potential panic during autoupdate cache directory creation
  • Add a note about trailing dots in cname values
  • Check for unused subscriptions before creating a new one
  • Remove extra debug message
  • Allow to change the env var prefix of Docker services via the com.symfony.server.service-prefix label

Newest issues and pull requests

They talked about us

Call to Action


Be trained by Symfony experts - 2019-10-7 Clichy - 2019-10-14 Clichy - 2019-10-21 Lyon

Symfony 3.4.32 released

$
0
0

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

  • bug #33834 [Validator] Fix ValidValidator group cascading usage (@fancyweb)
  • bug #33841 [VarDumper] fix dumping uninitialized SplFileInfo (@nicolas-grekas)
  • bug #33799 [Security]: Don't let falsy usernames slip through impersonation (@j4nr6n)
  • bug #33814 [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array (@mynameisbogdan)
  • bug #33805 [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand (@jschaedl)
  • bug #33781 [AnnotationCacheWarmer] add RedirectController to annotation cache (@jenschude)
  • bug #33777 Fix the :only-of-type pseudo class selector (@jakzal)
  • bug #32051 [Serializer] Add CsvEncoder tests for PHP 7.4 (@ro0NL)
  • feature #33776 Copy phpunit.xsd to a predictable path (@julienfalque)
  • bug #33759 [Security/Http] fix parsing X509 emailAddress (@nicolas-grekas)
  • bug #33733 [Serializer] fix denormalization of string-arrays with only one element (@mkrauser)
  • bug #33754 [Cache] fix known tag versions ttl check (@SwenVanZanten)
  • bug #33646 [HttpFoundation] allow additinal characters in not raw cookies (@marie)
  • bug #33748 [Console] Do not include hidden commands in suggested alternatives (@m-vo)
  • bug #33625 [DependencyInjection] Fix wrong exception when service is synthetic (@k0d3r1s)
  • bug #32522 [Validator] Accept underscores in the URL validator, as the URL will load (@battye)
  • bug #32437 Fix toolbar load when GET params are present in _wdt" route (@Molkobain)
  • bug #32925 [Translation] Collect original locale in case of fallback translation (@digilist)
  • bug #31198 [FrameworkBundle] Fix framework bundle lock configuration not working as expected (@HypeMC)
  • bug #33719 [Cache] dont override native Memcached options (@nicolas-grekas)
  • bug #33675 [PhpUnit] Fix usleep mock return value (@fabpot)
  • bug #33618 fix tests depending on other components' tests (@xabbuh)
  • bug #33626 [PropertyInfo] ensure compatibility with type resolver 0.5 (@xabbuh)
  • bug #33620 [Twig] Fix Twig config extra keys (@fabpot)
  • bug #33571 [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee' (@maxhelias)
  • bug #32763 [Console] Get dimensions from stty on windows if possible (@rtek)
  • bug #33518 [Yaml] don't dump a scalar tag value on its own line (@xabbuh)
  • bug #32818 [HttpKernel] Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler (@Arman-Hosseini)
  • bug #33487 [HttpKernel] Fix Apache mo _expires Session Cache-Control issue (@pbowyer)
  • bug #33439 [Validator] Sync string to date behavior and throw a better exception (@fancyweb)
  • bug #32903 [PHPUnit Bridge] Avoid registering listener twice (@alexpott)
  • bug #33402 [Finder] Prevent unintentional file locks in Windows (@jspringe)
  • bug #33396 Fix #33395 PHP 5.3 compatibility (@kylekatarnls)
  • bug #33385 [Console] allow Command::getName() to return null (@nicolas-grekas)
  • bug #33353 Return null as Expire header if it was set to null (@danrot)
  • bug #33382 [ProxyManager] remove ProxiedMethodReturnExpression polyfill (@nicolas-grekas)
  • bug #33377 [Yaml] fix dumping not inlined scalar tag values (@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 - 2019-10-7 Clichy - 2019-10-14 Clichy - 2019-10-21 Lyon

Symfony 4.3.5 released

$
0
0

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

  • bug #33742 [Crawler] document $default as string|null (@nicolas-grekas)
  • bug #32308 [Messenger] DoctrineTransport: ensure auto setup is only done once (@bendavies)
  • bug #33871 [HttpClient] bugfix exploding values of headers (@michaljusiega)
  • bug #33834 [Validator] Fix ValidValidator group cascading usage (@fancyweb)
  • bug #33863 [Routing] gracefully handle docre _root ini setting (@nicolas-grekas)
  • bug #33846 [Cache] give 100ms before starting the expiration countdown (@nicolas-grekas)
  • bug #33853 [HttpClient] fix "n _proxy" option ignored in NativeHttpClient (@Harry-Dunne)
  • bug #33841 [VarDumper] fix dumping uninitialized SplFileInfo (@nicolas-grekas)
  • bug #33842 [Cache] fix logger usage in CacheTrait::doGet() (@nicolas-grekas)
  • bug #33835 [Workflow] Fixed BC break on WorkflowInterface (@lyrixx)
  • bug #33799 [Security]: Don't let falsy usernames slip through impersonation (@j4nr6n)
  • bug #33814 [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array (@mynameisbogdan)
  • bug #33744 [DI] Add CSV env var processor tests / support PHP 7.4 (@ro0NL)
  • bug #33805 [FrameworkBundle] Fix wrong returned status code in ConfigDebugCommand (@jschaedl)
  • bug #33781 [AnnotationCacheWarmer] add RedirectController to annotation cache (@jenschude)
  • bug #33777 Fix the :only-of-type pseudo class selector (@jakzal)
  • bug #32051 [Serializer] Add CsvEncoder tests for PHP 7.4 (@ro0NL)
  • feature #33776 Copy phpunit.xsd to a predictable path (@julienfalque)
  • bug #33759 [Security/Http] fix parsing X509 emailAddress (@nicolas-grekas)
  • bug #33733 [Serializer] fix denormalization of string-arrays with only one element (@mkrauser)
  • bug #33754 [Cache] fix known tag versions ttl check (@SwenVanZanten)
  • bug #33646 [HttpFoundation] allow additinal characters in not raw cookies (@marie)
  • bug #33748 [Console] Do not include hidden commands in suggested alternatives (@m-vo)
  • bug #33625 [DependencyInjection] Fix wrong exception when service is synthetic (@k0d3r1s)
  • bug #32979 [Messenger] return empty envelopes when RetryableException occurs (@surikman)
  • bug #32522 [Validator] Accept underscores in the URL validator, as the URL will load (@battye)
  • bug #32437 Fix toolbar load when GET params are present in _wdt" route (@Molkobain)
  • bug #32925 [Translation] Collect original locale in case of fallback translation (@digilist)
  • bug #33691 [HttpClient] fix race condition when reading response with informational status (@nicolas-grekas)
  • bug #33727 [HttpClient] workaround bad Content-Length sent by old libcurl (@nicolas-grekas)
  • bug #31198 [FrameworkBundle] Fix framework bundle lock configuration not working as expected (@HypeMC)
  • bug #33719 [Cache] dont override native Memcached options (@nicolas-grekas)
  • bug #33703 [Cache] fail gracefully when locking is not supported (@nicolas-grekas)
  • bug #33713 Fix exceptions (PDOException) error code type (@fruty)
  • bug #32335 [Form] Names for buttons should start with lowercase (@mcfedr)
  • bug #33706 [Mailer][Messenger] ensure legacy event dispatcher compatibility (@xabbuh)
  • bug #33688 Add missing ro _attr option to FormType (@mcsky)
  • bug #33693 [Security] use LegacyEventDispatcherProxy (@dmaicher)
  • bug #33675 [PhpUnit] Fix usleep mock return value (@fabpot)
  • bug #33652 [Cache] skip igbinary on PHP 7.4.0 (@nicolas-grekas)
  • bug #33643 [HttpClient] fix throwing HTTP exceptions when the 1st chunk is emitted (@nicolas-grekas)
  • bug #33618 fix tests depending on other components' tests (@xabbuh)
  • bug #33626 [PropertyInfo] ensure compatibility with type resolver 0.5 (@xabbuh)
  • bug #33620 [Twig] Fix Twig config extra keys (@fabpot)
  • bug #33600 [Messenger] Fix exception message of failed message is dropped on retry (@tienvx)
  • bug #33601 [HttpClient] Add default value for Accept header (@numerogeek)
  • bug #33340 [Finder] Adjust regex to correctly match comments in gitignore contents (@Jeroeny)
  • bug #33588 [PropertyInfo] ensure compatibility with type resolver 0.5 (@xabbuh)
  • bug #33575 [WebProfilerBundle] Fix time panel legend buttons (@fancyweb)
  • bug #33571 [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee' (@maxhelias)
  • bug #32763 [Console] Get dimensions from stty on windows if possible (@rtek)
  • bug #33570 Fixed cache pools affecting each other due to an overwritten seed variable (@roed)
  • bug #33517 [Yaml] properly catch legacy tag syntax usages (@xabbuh)
  • bug #33546 [DependencyInjection] Accept existing interfaces as valid named args (@fancyweb)
  • bug #33547 [HttpClient] Re-enable Server Push support (@dunglas)
  • bug #33521 Fixed incompatibility between ServiceSubscriberTrait and classes with protected $container property (@a-menshchikov)
  • bug #33518 [Yaml] don't dump a scalar tag value on its own line (@xabbuh)
  • bug #33505 [HttpClient] fallbackto CURLMOP _MAXCONNECTS when CURLMOP _MA _HOS _CONNECTIONS is not available (@nicolas-grekas)
  • bug #32818 [HttpKernel] Fix getFileLinkFormat() to avoid returning the wrong URL in Profiler (@Arman-Hosseini)
  • bug #33487 [HttpKernel] Fix Apache mo _expires Session Cache-Control issue (@pbowyer)
  • bug #33469 [FrameworkBundle] Fixed suggested package for missing server:dump command (@lyrixx)
  • bug #31964 [Router] routing cache crash when using generato _class (@dFayet)
  • bug #33481 [Messenger] fix empty amqp body returned as false (@Tobion)
  • bug #33387 [Mailer] maintain sender/recipient name in SMTP envelopes (@xabbuh)
  • bug #33449 Fix gmail relay (@Beno!t POLASZEK)
  • bug #33391 [HttpClient] fix support for 103 Early Hints and other informational status codes (@nicolas-grekas)
  • bug #33444 [HttpClient] improve handling of HTTP/2 PUSH, disable it by default (@nicolas-grekas)
  • bug #33435 [Validator] Only handle numeric values in DivisibleBy (@fancyweb)
  • bug #33437 Fix #33427 (@sylfabre)
  • bug #33439 [Validator] Sync string to date behavior and throw a better exception (@fancyweb)
  • bug #33436 [DI] fix support for "!tagge _locator foo" (@nicolas-grekas)
  • bug #32903 [PHPUnit Bridge] Avoid registering listener twice (@alexpott)
  • bug #33432 [Mailer] Fix Mailgun support when a response is not JSON as expected (@fabpot)
  • bug #33402 [Finder] Prevent unintentional file locks in Windows (@jspringe)
  • bug #33376 [Mailer] Remove the default dispatcher in AbstractTransport (@fabpot)
  • bug #33357 [FrameworkBundle] Fix about command not showing .env vars (@brentybh)
  • bug #33396 Fix #33395 PHP 5.3 compatibility (@kylekatarnls)
  • bug #33363 [Routing] fix static route reordering when a previous dynamic route conflicts (@nicolas-grekas)
  • bug #33385 [Console] allow Command::getName() to return null (@nicolas-grekas)
  • bug #33353 Return null as Expire header if it was set to null (@danrot)
  • bug #33382 [ProxyManager] remove ProxiedMethodReturnExpression polyfill (@nicolas-grekas)
  • bug #33377 [Yaml] fix dumping not inlined scalar tag values (@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 - 2019-10-7 Clichy - 2019-10-14 Clichy - 2019-10-21 Lyon

New in Symfony 4.4: Signing and Encrypting Email Messages

$
0
0
Sebastiaan Stok

Contributed by
Sebastiaan Stok
in #30981.

Symfony 4.4 will be released in November 2019. This is the first article of the series that shows the most important new features introduced by this Symfony version.


The new Mailer and Mime components were introduced in Symfony 4.3 to replace the previous solution based on SwiftMailer. In Symfony 4.4 we've improved them with new features to allow signing and encrypting email messages using the S/MIME standard.

Signing a message improves its integrity because it includes a digital signature of the hash of the entire email contents, ensuring that the original contents haven't been modified:

1
2
3
4
5
6
7
8
useSymfony\Component\Mime\Crypto\SMimeSigner;useSymfony\Component\Mime\Email;$email=(newEmail())->from('...')->to('...')->html('...');$signer=newSMimeSigner('/path/to/certificate.crt','/path/to/certificate-private-key.key');$signedEmail=$signer->sign($email);// now use the Mailer to send this $signedEmail instead of the original $email

Encrypting a message improves its security because its contents, including any attachments, can only be read if you have the private key associated to the public key used to encrypt them:

1
2
3
4
5
6
7
8
useSymfony\Component\Mime\Crypto\SMimeEncrypter;useSymfony\Component\Mime\Email;$email=(newEmail())->from('...')->to('...')->html('...');$encrypter=newSMimeEncrypter('/path/to/certificate.crt');$encryptedEmail=$encrypter->encrypt($email);// now use the Mailer to send this $encryptedEmail instead of the original $email

Read the Signing and Encrypting Messages article in the official Symfony documentation to learn more about this feature.


Be trained by Symfony experts - 2019-10-14 Clichy - 2019-10-21 Lyon - 2019-10-28 Berlin

New in Symfony 4.4: New DomCrawler Methods

$
0
0
Grégoire Pineau

Contributed by
Grégoire Pineau
in #33144.

The DomCrawler component is mostly used in Symfony applications via functional tests, to filter the DOM nodes of HTML/XML documents. The methods provided by DomCrawler were originally inspired by jQuery, such as eq(),first(), children(), nextAll(), etc.

In Symfony 4.4 we've added three new methods frequently requested by the community: matches(), closest() and outerHtml(). Consider the following HTML snippet:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<htmllang="en"><body><divclass="class-1"><h1class="class-1">Lorem Ipsum</h1><ulclass="class-2 class-3"id="id-1"><li>1</li><liclass="class-4">2</li><li>3</li></ul></div></body></html>

The matches(string $selector) method returns true if the node matches the given CSS selector:

1
2
$crawler->filter('#id-1')->matches('.class-3');// true$crawler->filter('#id-1')->matches('.class-4');// false

The closest(string $selector) method returns the first ancestor of the node that matches the given CSS selector:

1
2
3
// returns the div.class-1 node and NOT the h1.class-1 node because h1 is// a sibling and not an ancestor of ul#id-1$crawler->filter('#id-1')->closest('.class-1');

The outerHtml() method returns the whole HTML content of the node, including its own tags:

1
2
3
4
5
// returns '<ul class="class-2 class-3" id="id-1"><li>1</li><li class="class-4">2</li><li>3</li></ul>'$crawler->filter('#id-1')->outerHtml();// returns '<li>1</li><li class="class-4">2</li><li>3</li>'$crawler->filter('#id-1')->html();

Removing all Extra White Space

Hamza Amrouche

Contributed by
Hamza Amrouche
in #32440.

Dealing with white spaces is pretty annoying when checking the contents of some HTML tag. For example, with the following HTML snippet:

1
2
3
4
5
<divclass="class-1"><h2>
        Some Title Text</h2></div>

The following test will fail because of all the "n" and spaces that surround the title text:

1
2
// this fails because of the extra white spaces$this->assertSame('Some Title Text',$crawler->filter('.class-1')->text());

In Symfony 4.3 we introduced the assertSelectorTextContains() method to help in these situations, but starting from Symfony 4.4, you can also passtrue as the second optional argument of text() to remove all extra white spaces:

1
2
// this passes because all extra white spaces are removed$this->assertSame('Some Title Text',$crawler->filter('.class-1')->text(null,true));

In addition to trimming white spaces from the beginning and the end of the string, this feature also replaces two or more white spaces inside the contents by a single white space. For example, if the original text isfoo bar baz, it returns foo bar baz.


Be trained by Symfony experts - 2019-10-14 Clichy - 2019-10-21 Lyon - 2019-10-28 Berlin

A Week of Symfony #667 (7-13 October 2019)

$
0
0

This week, Symfony 3.4.32 and 4.3.5 maintenance versions were released. Meanwhile, the upcoming Symfony 4.4 version improved the syntax for defining method calls in YAML, improved performance of filesystem-based caches and allowed to omit the event name when registering listeners.

Symfony development highlights

3.4 changelog:

  • 7432601: [Validator] fixed ValidValidator group cascading usage
  • fefb2ff: [Dotenv] search variable values in ENV first then env file
  • a8a4aad: [HttpFoundation] added plus character + to legal mime subtype
  • 1201085: [Cache] fixed TagAwareAdapter returning invalid cache
  • 9869754: [Validator] added the missing Swedish translations
  • c281b3b: [Validator] added the missing Norwegian Bokmål translations
  • 49ad46e: [VarDumper] fixed resetting the "bold" state in CliDumper
  • 1201085: [Cache] fixed TagAwareAdapter returning invalid cache

4.3 changelog:

  • bee0056: [HttpClient] fixed exploding values of headers
  • 38b3dc8: [Messenger] ensure auto setup in DoctrineTransport is only done once
  • 4223a5b: [HttpKernel] fix to populate $dotenvVars in data collector when not using putenv()
  • 0d49141: [Form] preserved microseconds and used \DateTime::createFromImmutable() when available
  • 49dfa8a: [Cache] clean tags folder on invalidation
  • ac422db: [FrameworkBundle] allowed to set SameSite config to 'none'
  • 6f58438: [Cache] removed implicit dependency on symfony/filesystem
  • 585a7a4: [HttpClient] send Accept: / by default and remove it when needed
  • 76f44df: [Cache] ignored unserialization failures in AbstractTagAwareAdapter::doDelete()
  • b17ebdf: [DependencyInjection] added extra type check to php dumper

4.4 changelog:

  • 4364850: [Intl] updated the ICU data to 65.1
  • b43f255: [VarDumper] added a support for casting Ramsey/Uuid
  • ce7c0b4: [Messenger] allowed to configure the db index on Redis transport
  • 1998814: [HttpClient] async HTTPlug client
  • 62216ea: added types to constructors and private/final/internal methods
  • 7db5be6: [DependencyInjection] enabled improved syntax for defining method calls in YAML
  • 0094884: [EventDispatcher] allowed to omit the event name when registering listeners
  • 41dfd98: [Cache] improved performance of pruning for fs-based adapters
  • 1c81349: keeping backward compatibility with legacy FlattenException usage
  • 28f9536: [Cache] added TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter
  • 38b9a27: [ErrorHandler] reworked fatal errors
  • a84ec3a: [Mailer] added ReplyTo option for PostmarkApiTransport
  • 0e84d3d: [Cache] fixed 2RTT + race condition in AbstractTagAwareAdapter::deleteItems()
  • 211c651: [HttpClient] resolved promise chains on HttplugClient::wait()

Master changelog:

  • 2dba6e7: [String] renamed core classes to Byte/CodePoint/UnicodeString
  • f6d207c: [Console] replaced posix_isatty with cross-platform and always available stream_isatty
  • 90ca602: [String] added $lastGlue argument to join() methods

Symfony Binary

The Symfony binary, which provides tools for developing Symfony applications in your local machine, released its new4.7.2 and4.7.3 with the following changes:

  • Disable interactivity in CI (even if they expose themselves as a TTY)
  • Fix the use of API Tokens requests new OAuth token for each request
  • Add a warning when the local CA should be regenerated
  • Fix server:ca:install --force does not properly regenerate CA
  • Add --renew flag to server:ca:install to force CA regeneration
  • Fix server:ca:install does not re-install certificate when using --force flag
  • Add proxy:domain:detach
  • Add attached domain names in the output of server:status

Newest issues and pull requests

They talked about us

Call to Action


Be trained by Symfony experts - 2019-10-14 Clichy - 2019-10-21 Lyon - 2019-10-28 Berlin

New in Symfony 4.4: Improved Type Constraint

$
0
0
Jan Schädlich

Contributed by
Jan Schädlich
in #31351.

The Type constraint included in the Validator component validates that a given value is of a specific data type. This type can be any of thevalid PHP types, any of the PHP ctype functions (e.g. alnum, alpha,digit, etc.) and also the FQCN of any class:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
// src/Entity/Author.phpnamespaceApp\Entity;useSymfony\Component\Validator\ConstraintsasAssert;classAuthor{/**     * @Assert\Type("Ramsey\Uuid\UuidInterface")     */protected$id;/**     * @Assert\Type("string")     */protected$firstName;// ...}

Starting from Symfony 4.4, the checked type can be an array of types, so you can validate that the given value type is one of several possible types. In the following example, the $accessCode property can contain only letters or only digits, but not both:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
// src/Entity/Author.phpnamespaceApp\Entity;useSymfony\Component\Validator\ConstraintsasAssert;classAuthor{// .../**     * @Assert\Type(type={"alpha", "digit"})     */protected$accessCode;}

Be trained by Symfony experts - 2019-10-14 Clichy - 2019-10-21 Lyon - 2019-10-28 Berlin

New in Symfony 4.4: Messenger Middleware to Clear Doctrine Entity Manager

$
0
0
Konstantin Myakshin

Contributed by
Konstantin Myakshin
in #31334.

In the Messenger component, middleware is used to configure what happens when you dispatch a message to a message bus. In Symfony 4.4 we've added a new middleware to clear Doctrine's entity manager after each message is consumed.

Enable it by adding messenger.middleware.doctrine_clear_entity_manager to the middleware of your buses:

  • YAML
    1
    2
    3
    4
    5
    6
    7
    8
    9
    # config/packages/messenger.yamlframework:messenger:buses:messenger.bus.default:default_middleware:falsemiddleware:# ...-'messenger.middleware.doctrine_clear_entity_manager'
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <!-- config/packages/messenger.xml --><?xml version="1.0" encoding="UTF-8" ?><containerxmlns="http://symfony.com/schema/dic/services"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:framework="http://symfony.com/schema/dic/symfony"xsi:schemaLocation="http://symfony.com/schema/dic/services        https://symfony.com/schema/dic/services/services-1.0.xsd        http://symfony.com/schema/dic/symfony        https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"><framework:config><framework:messenger><!-- ... --><framework:middlewareid="messenger.middleware.doctrine_clear_entity_manager"/><framework:busname="messenger.bus.default"default-middleware="false"/></framework:messenger></framework:config></container>
  • PHP
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    // config/packages/messenger.php$container->loadFromExtension('framework',['messenger'=>['buses'=>['messenger.bus.default'=>['middleware'=>[// ...'messenger.middleware.doctrine_clear_entity_manager',],'default_middleware'=>false,],],],]);

The first advantage of this middleware is that it avoids memory leaks during the handling of messages. The second advantage is that it prevents unexpected side-effects. For example, in the case of a user account recovery process (where an email is sent asynchronously with Messenger and AMQP), if the email address is updated after the first try, the second email is sent to the old email address. Using this middleware will solve that problem.


Be trained by Symfony experts - 2019-10-21 Lyon - 2019-10-28 Berlin - 2019-10-28 Berlin

New in Symfony 4.4: PHPUnit Assertions for Email Messages

$
0
0
Fabien Potencier

Contributed by
Fabien Potencier
in #32930 and #33203.

The new Mailer and Mime components were introduced in Symfony 4.3 to replace the previous solution based on SwiftMailer. In Symfony 4.4 we've improved them with new PHPUnit assertions to test emails.

The new assertions follow the same philosophy of thetest assertions introduced in Symfony 4.3, with long but expressive method names:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
// tests/Controller/DefaultControllerTest.phpnamespaceApp\Tests\Controller;useSymfony\Bundle\FrameworkBundle\Test\WebTestCase;classDefaultControllerTestextendsWebTestCase{publicfunctiontestSomething(){$client=static::createClient();$client->request('GET','/newsletter-signup');// ...$this->assertEmailCount(2);$this->assertEmailIsQueued($this->getMailerEvent(0));$email=$this->getMailerMessage(0);$this->assertEmailHeaderSame($email,'To','fabien@symfony.com');$this->assertEmailTextBodyContains($email,'Welcome to Symfony!');$this->assertEmailAttachementCount($email,1);}}

This is the full list of mailer assertions:

  • assertEmailCount()
  • assertQueuedEmailCount()
  • assertEmailIsQueued()
  • assertEmailIsNotQueued()
  • assertEmailAttachementCount()
  • assertEmailTextBodyContains()
  • assertEmailTextBodyNotContains()
  • assertEmailHtmlBodyContains()
  • assertEmailHtmlBodyNotContains()
  • assertEmailHasHeader()
  • assertEmailNotHasHeader()
  • assertEmailHeaderSame()
  • assertEmailHeaderNotSame()
  • assertEmailAddressContains()

Be trained by Symfony experts - 2019-10-21 Lyon - 2019-10-28 Berlin - 2019-10-28 Berlin

New in Symfony 4.4: Password Migrations

$
0
0
Nicolas Grekas

Contributed by
Nicolas Grekas
in #31594,#31597, and #31843.

In Symfony 4.3 we introduced a native password encoder to hash your user passwords with the best possible algorithm available in your server:

1
2
3
4
5
6
7
# config/packages/security.yamlsecurity:# ...encoders:App\Entity\User:algorithm:autocost:14

This algorithm is selected automatically and can change over time, so different users will end up using different algorithms. Technically this is not a problem because Symfony knows how to hash and compare each password, so all users will be able to log in. However, it would be great if all users always used the best possible algorithm.

In Symfony 4.4, when a user successfully authenticates, Symfony checks if a better hashing algorithm is available and rehashes the password so you can store the updated hash. In practice, when using the entity user provider, you only need to update the Doctrine repository associated to users and implement thePasswordUpgraderInterface

This interface defines a single method named upgradePassword() which Symfony will call when the user password must be rehashed:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// src/Repository/UserRepository.phpnamespaceApp\Repository;// ...useSymfony\Component\Security\Core\User\PasswordUpgraderInterface;classUserRepositoryextendsEntityRepositoryimplementsPasswordUpgraderInterface{// ...publicfunctionupgradePassword(UserInterface$user,string$newEncodedPassword):void{// this code is only an example; the exact code will depend on// your own application needs$user->setPassword($newEncodedPassword);$this->getEntityManager()->flush($user);}}

Read the docs about this new feature to learn how to implement it when using a custom user provider or a custom password encoder.


Be trained by Symfony experts - 2019-10-21 Lyon - 2019-10-28 Berlin - 2019-10-28 Berlin

Scholarship program and its fundraising are open at SymfonyCon Amsterdam 2019

$
0
0

For the third year in a row, we’re very pleased to launch our scholarship program! We are super excited to open the scholarship process for this year’s SymfonyCon Amsterdam 2019, November 21st to 23rd. We hope to help the Symfony community members who can’t afford to attend the conference to be part of this great event. The scholarship program is part of the Diversity Initiative which was launched three years ago at SymfonyCon Cluj and is led by Lukas Kahwe Smith, a long time Symfony core team member.

Fundraising

This year, we’d like to call the entire Symfony community to contribute to our scholarship program by donating funds to help us cover the scholarships expenses for SymfonyCon Amsterdam 2019. We aim to offer 3 scholarships at SymfonyCon Amsterdam 2019 and we need your help. We’re thus opening a fundraising campaign to collect enough money to offer 3 scholarships to people who cannot join us at the conference for financial reasons. You can donate via our Symfony page on Open Collective website. Anyone can donate on Open Collective, a company or an individual. You can donate the amount you want and either become a backer or a Sponsor! After your donation, you’ll automatically get a PDF invoice.

Our objective is to receive enough money to cover the 3 scholarships we’d like to offer at SymfonyCon Amsterdam. In order to be able to cover these 3 scholarships, we aim to collect a minimum of 4 000€ ($4,500) to cover the conference ticket, travel (flight or train tickets from the city of departure to Amsterdam) and accommodation for 3 nights per grant recipient. If we exceed this minimum amount and have enough funds to provide more scholarships, we’d be very pleased to extend our scholarship offer to more people. All the available funds and the submitted expenses will be available on our page so everyone can see them. We’ve chosen Open Collective because of its mission to operate in full transparency and because we want to involve the community in this initiative as much as possible.

Scholarship process

Application process for scholarships at SymfonyCon Amsterdam 2019 is now open until November 3rd. You just need to fill in a form to submit your application. SymfonyCon’s scholarship program is aimed to support Symfony community members who want to attend the conference, but cannot without the scholarship. Anyone regardless of gender, gender identity and expression, sexual orientation, ability, physical appearance, race, ethnicity, age, religion, or socioeconomic status can apply for a scholarship.

We want to include, encourage and recognize people from all backgrounds no matter where you come from. If you cannot attend the conference without financial aid, you are eligible to our scholarship program. We will consider every application. Priority will be given to underrepresented groups such as women, minorities, LGBTQIA and people with disabilities, or other underrepresented groups who will be unable to attend the event without financial support. Students are welcome!

Within the Symfony community, we support diversity and inclusion and are proud to launch our third scholarship program.

Apply here for the SymfonyCon’s scholarship program until Sunday November 3rd 2019.

The selection process for the scholarship will be handled by the SymfonyCon Amsterdam organizers, Lukas Kahwe Smith (Diversity Initiative leader) and the CARE team. We’ll announce the grant recipients on November 8th.

We’d like to thank in advance all the people who will support the scholarship program and help us build the Diversity Initiative. If you have any questions regarding the scholarship program or the SymfonyCon Amsterdam, please contact us at event[at]symfony.com. If you want to have more information about our Code of Conduct, you can find it here.

See you soon at the conference!


Be trained by Symfony experts - 2019-10-21 Lyon - 2019-10-28 Berlin - 2019-10-28 Berlin

New in Symfony 4.4: Improved Welcome Page

$
0
0
Yonel Ceruto

Contributed by
Yonel Ceruto
in #33189.

When you browse a newly created Symfony project, you see a special "Welcome page" that looks like this:

The Symfony Welcome Page in Symfony 4.3 and earlier versions

Even if this is an error page (you are seeing that page because you haven't configured any URL yet) we designed it to make it look more friendly than a traditional error page, specially for newcomers.

This page confirms you that Symfony was successfully installed, shows you the directory of your application and provides a link to the most essential documentation for newcomers: How to create your first page in Symfony.

Even if this page is correct, its design was dull and uninspiring. That's why we decided to redesign it for Symfony 4.4/5.0. This is how the same page looks now:

The Symfony Welcome Page in Symfony 4.4 and newer versions

In addition to having a much better design, the page now provides more links to useful resources. Also, the main page color will randomly change each time you load the page, so keep reloading until the color matches your preferences.


Be trained by Symfony experts - 2019-10-21 Lyon - 2019-10-28 Berlin - 2019-10-28 Berlin

A Week of Symfony #668 (14-20 October 2019)

$
0
0

This week, the upcoming Symfony 4.4. version added a new feature for lazy computation of string values injected into services and continued working on the new feature to store secrets. Finally, the SymfonyCon Amsterdam 2019 conference announced a fundraising for its scholarship program.

Symfony development highlights

This week, 62 pull requests were merged (26 in code and 36 in docs) and 36 issues were closed (25 in code and 11 in docs). Excluding merges, 34 authors made 1,476 additions and 444 deletions. See details for code and docs.

3.4 changelog:

  • 52f8fc8: [Yaml] throw exception for tagged invalid inline elements
  • a054d88: [Dotenv] allowed LF in single-quoted strings
  • a54ecb0: [Routing] fixed route loading with wildcard when dir or file is empty

4.3 changelog:

  • 0c77296: [HttpClient] workaround curl_multi_select() issue
  • 537d373: [Mailer] fixed Mandrill Transport API payload for named addresses

4.4 changelog:

  • ff3e32c: [FrameworkBundle] improved the sorting of tagged services
  • 46e94d9: [HttpClient] added HttpClient::createForBaseUri()
  • 6253369: [TwigBridge] added show-deprecations option to the lint:twig command
  • e402f19: [ErrorRenderer] extended legacy exception for backwards compatibility
  • 537d373: [Mailer] fixed Mandrill Transport API payload for named addresses
  • c4b39b7: [HttpClient] improved StreamWrapper
  • b9ba0c5: replaced STDIN by php://stdin
  • 594e7ae: [DependencyInjection] added LazyString for lazy computation of string values injected into services
  • 004ee73: [Serializer] added context options to handle BOM in CSV

Master changelog:

  • 0065f75: [PropertyInfo] respect property name case when guessing from public method name
  • 805449d: [Mailer] added Message-Id to SentMessage when sending an email
  • b6d4690: [String] optimized equalsTo/startsWith/endsWith
  • 5880c5c: [String] added bytesAt() and codePointsAt()
  • e28bc78: [String] added AbstractString::toString() method

Newest issues and pull requests

They talked about us

Call to Action


Be trained by Symfony experts - 2019-10-21 Lyon - 2019-10-28 Berlin - 2019-10-28 Berlin
Viewing all 3054 articles
Browse latest View live