Symfony 2 Online Conference Report
So, on Tuesday, we organized a Moscow hub and conducted a live broadcast of the conference. For the organizers, as I understand it, this was the first experience in organizing events of this kind. And everything went fine. We connected to the session, the speaker was broadcasting in the background and leafing through the slides. There was no video. It was a little difficult to perceive the information by ear, but in general it is clear that the guys tried.
“Miscellaneous enhancements” Fabien Potencier
http://www.slideshare.net/fabpot/news-of-the-symfony2-world The
reports were slightly moved and Fabien first started with an introduction about various innovations.
What is now laid out and working is a preview release. The first alpha is planned to be laid out in September.
“Symfony 2 Meets Propel 1.5” François Zaninotto
http://www.slideshare.net/francoisz/symfony2-meets-propel-15-4
Francois introduced a new version, told how good it is and better than previous versions of the propel. But there was some uncertainty about the bright future of this ORM.
We were presented with new "killer features":
“What's new in the Doctrine 2 Symfony Integration” Jonathan Wage
http://www.slideshare.net/jwage/symfony2-and-doctrine2-integration
What we have:
Unit & Functional Tests Fabien Potencier
http://www.slideshare.net/fabpot/unit-and-functional-testing-with-symfony2
“The new form framework” Bernhard Schussek
http://www.slideshare.net/bschussek/the-new-form-framework
Again, all rewritten.
Now forms are just a visual representation. All validation is cleverly put into the model; see presentation.
The main question that arose for me: "What about custom forms?"
That's how:
But, at a minimum, testing will already be much easier.
“The Symfony 2 Killer Feature ...” Fabien Potencier
http://www.slideshare.net/fabpot/caching-on-the-edge-with-symfony2
As you might have guessed, this is caching.
Symfony2 presents a completely new look at caching, and benchmarks show an overwhelming difference in general. And the essence is in RFC 2616 (13. Caching in HTTP).
Firstly, in the controller we specify the cache lifetime and response generates the corresponding http headers. At first glance, this is nothing revolutionary if not for the built-in HTTP proxy. Which wraps the core of the application and controls the caching and does not allow requests to the application if it has a cache.
For partials that must be cached at different times, a technology similar to SSI is used, where the corresponding partial is connected and processed separately in accordance with its settings.
And if you put a reverse proxy, such as nginx, on top of this, then due to the caching headers the requests will not reach the application at all.
It is recommended to manage the cache after the time of "decay". But you can also disable specific URLs.
All.
The organizers, as promised, posted a new dock with descriptions of the individual components.
In summary: Symfony2 is a fundamentally new framework, not only compared to 1.x, but generally compared to other php frameworks. There is still a lot of work ahead, but most importantly, Symfony2 is already a reality. Join now!
Propiar Russian newsletter . I can’t say that she’s quite active, but I think this is a good gathering point. There I will announce all my initiatives, such as, for example, meetings at the Symfony code'n'coffe.
Reports
“Miscellaneous enhancements” Fabien Potencier
http://www.slideshare.net/fabpot/news-of-the-symfony2-world The
reports were slightly moved and Fabien first started with an introduction about various innovations.
- Introduced a fundamentally new DOM parser that supports all css3 selectors.
Parser :: cssToXpath ('h4> a: contains ("foo")');
This parser is the basis for another component - DomCrawler. - DomCrawler
see the presentation of how it looks and works.
First of all, this crawler is used in functional tests to work with the “answer”: select elements by condition, find and fill out a form, etc.
We get full and convenient access to the tree, nodes and their attributes.
Fabien presented an example of a simple browser based on such a crawler. - Finder An
advanced iterator for working with files: select a list of files by mask, filter, sort. Returns files as objects with attributes.
See details - Kernel
The core of the framework. Simple interface - 2 methods to accept a request and give an answer.
Such simplicity allows you to write your own "core", where you can sew any logic that will wrap the "request" and "response". You can write your own solutions for testing, profiling, caching, etc.
What is now laid out and working is a preview release. The first alpha is planned to be laid out in September.
“Symfony 2 Meets Propel 1.5” François Zaninotto
http://www.slideshare.net/francoisz/symfony2-meets-propel-15-4
Francois introduced a new version, told how good it is and better than previous versions of the propel. But there was some uncertainty about the bright future of this ORM.
We were presented with new "killer features":
- Model query
Abandoned the "criteria" and now the queries are written in a similar way as in the doctrine, only in a different paradigm.
Joins look original. And if we consider that instead of peers / tables we work with query, then it’s pretty nice to spread the logic (write your filters) according to the corresponding query and get rid of duplication in queries. - Concrete Table Inheritance
Implemented the inheritance of models from one table. Doctrine has something similar .
True, I did not like the solution when, when saving an object, data is written to a specific table and duplicated in the parent. I did not understand why.
In addition, duplication can be disabled. see doc .
In the doctrine, I like Column Aggregation Inheritance more . When all records are in the same table, where there is a column with the types of objects. When we select a list of objects, we get a collection of different types. And for each type, we can hang our own business logic. - Aggregate Column Behavior
Automatically updates a column that contains the result of an aggregate function when a dependent table changes. Those. automatically counts / caches the number of post comments, amounts, maximum and minimum values. See Doc .
Honestly, I do not really like this approach in terms of reliability. However, as always, everything depends on the conditions of the problem.
- "The Power of Propel Generator"
- "Propel not dead"
- "Propel vs Doctrine"
“What's new in the Doctrine 2 Symfony Integration” Jonathan Wage
http://www.slideshare.net/jwage/symfony2-and-doctrine2-integration
What we have:
- Doctrine 2 is not an Active Record. Congratulations to all the followers of the domain model. Now we can write our own business logic objects. We don’t inherit from anyone, our own constructor, no magic. And we entrust EntityManager to work with the database.
Our objects can contain data not only in the form of simple types, but also in the form of other objects. Those. we can write complex data types, such as currencies, date intervals, etc., and natively hydrogenate them from the database.
We can write a personal EntityManager with its own rules for working with the database and hydration of objects.
All in all, a lot more room than Active Record. - Migrations
Everyone rewrote and made this component independent. Now you can use migrations for any of your projects.
From what I did not see in 1.x:
- see the current status - what version is it, etc.
- show sql migration
- write sql migration to a file - MongoDB
Developers added support for MongoDB and moved it into a separate subproject. It will be interesting to try.
Unit & Functional Tests Fabien Potencier
http://www.slideshare.net/fabpot/unit-and-functional-testing-with-symfony2
- With the release of Symfony2, I think testing symfony projects will take it to a new level. It will become more convenient and transparent. Down with context and memliki!
In functional tests, we test only “output”. Forms, validation and everything that we can, we test in unit tests. And the test execution speed, I hope, will decrease.
Fabien showed an example of functional testing in conjunction:Client (browser) - Crawler (DOM) - Assert (phpunit)
see the presentation. - Application requests can be run in separate processes. Those. make 2 conditionally simultaneous requests in one test. Only I did not quite understand why. These are, after all, functional tests, not stress tests.
- Now this component is independent of the symphony application and can be used to test ANY web applications. Because he can both simulate a request for a symphony application and honestly go on http.
Therefore, if you do not have a symphony application or have inherited code, you can cover it with these tests, and if you transfer to symphony, you will not have to rewrite these tests. - I also liked the opportunity in tests to access the profiler / statistics in order to test, for example, the number of database queries, controller runtime, etc.
“The new form framework” Bernhard Schussek
http://www.slideshare.net/bschussek/the-new-form-framework
Again, all rewritten.
Now forms are just a visual representation. All validation is cleverly put into the model; see presentation.
The main question that arose for me: "What about custom forms?"
That's how:
- validation rules can be grouped and given to the form a specific group (with part of the fields, with individual rules)
- for a custom form, we write a personal model class, where we indicate the corresponding validation rules
But, at a minimum, testing will already be much easier.
“The Symfony 2 Killer Feature ...” Fabien Potencier
http://www.slideshare.net/fabpot/caching-on-the-edge-with-symfony2
As you might have guessed, this is caching.
Symfony2 presents a completely new look at caching, and benchmarks show an overwhelming difference in general. And the essence is in RFC 2616 (13. Caching in HTTP).
Firstly, in the controller we specify the cache lifetime and response generates the corresponding http headers. At first glance, this is nothing revolutionary if not for the built-in HTTP proxy. Which wraps the core of the application and controls the caching and does not allow requests to the application if it has a cache.
For partials that must be cached at different times, a technology similar to SSI is used, where the corresponding partial is connected and processed separately in accordance with its settings.
And if you put a reverse proxy, such as nginx, on top of this, then due to the caching headers the requests will not reach the application at all.
It is recommended to manage the cache after the time of "decay". But you can also disable specific URLs.
All.
The organizers, as promised, posted a new dock with descriptions of the individual components.
In summary: Symfony2 is a fundamentally new framework, not only compared to 1.x, but generally compared to other php frameworks. There is still a lot of work ahead, but most importantly, Symfony2 is already a reality. Join now!
Propiar Russian newsletter . I can’t say that she’s quite active, but I think this is a good gathering point. There I will announce all my initiatives, such as, for example, meetings at the Symfony code'n'coffe.