Is symfony much more powerful than other PHP frameworks?
某草草2017-05-16 16:48:24
Symfony 2 and Symfony 1 are two completely different frameworks, and they need to be treated differently when understanding them. Symfony 2 is the current focus of Symfony community development. To evaluate a framework, we must look at its current situation, as well as its development goals and prospects. Symfony 2 places great emphasis on flexibility (scalability), functional completeness and performance.
Symfony 2 has a high learning cost. For learners who have no actual development experience or are unfamiliar with software engineering concepts, the learning process can be described as painful. But for developers who have some experience or already know some heavy frameworks under Ruby on Rails, Django and Java, the learning cost is not high; and if you really need a lightweight framework, Silex is a simplified version of Symfony 2 , more suitable for developing simple applications than most PHP frameworks.
Development efficiency is more about personal habits. Zhang Fei plays with spears and Guan Yu plays with swords. It doesn’t matter which framework you choose. The key is to be proficient. On the other hand, the development community of Symfony 2 is very active, ranking first in the PHP category on GitHub, which means that the functionality you need has probably been implemented by other developers.
As for the performance issue, it should not be discussed in isolation from the deployment of web applications. If a small virtual host is used, the operating efficiency of Symfony 2 will definitely be low. However, if you develop commercial applications that emphasize technical architecture, Symfony 2 supports performance optimization in all operating aspects, and Symfony 2 does support very large websites such as DailyMotion and Youporn.
Symfony 2 is extremely scalable, the core components of the framework can be replaced, and each component can also be used independently. Well-known PHP open source projects such as Drupal, phpBB, and EzPublish all use the core components of Symfony 2 in their next versions, or are completely refactored based on Symfony 2.
PHP中文网2017-05-16 16:48:24
yes and no. SF is indeed more powerful than most frameworks. In addition to providing the basic mvc mode, it also provides many tools, covering development, testing, security, template development, maintainability, etc. that are almost encountered in web development. all aspects. But in terms of functions, SF is not the only one. For example, zendframework also provides many components that SF does not have, such as Zend_Service_Amazon, Zend_Pdf, etc.
At present, Symfony2 places more emphasis on flexibility and components. I am very optimistic about and agree with this direction. You can even use Symfony/Components to design and create frameworks yourself. @SS classmates have already mentioned this. Many open source projects have also begun to use sf components. I won’t waste any more words. If you are interested, you can read the "Create your own framework using Symfony components" series of tutorials by Fabien Potencier, the founder of the sf project. : http://fabien.potencier.org/article/5..., if you have difficulty reading English, you can also check the Chinese version I translated: http://chrisyue.com/posts/272.%E4%BD. .. The articles he writes are very easy to read and allow you to understand the essence of Symfony components step by step. It is worth reading.
Symfony2 uses a lot of object-oriented knowledge and skills to achieve maintainability and flexibility. This also makes the design of Symfony more complex and difficult to understand (if you are not familiar with componentization or even object-oriented), and the learning cost is relatively high. A request requires a lot of code to be executed, which makes direct execution of the framework relatively inefficient. In many benchmark results, Symfony2's score is not excellent, but Symfony2 has many optimization methods, which are worth spending time on. understand. For example, the routing component of Symfony2 can use the dump method to generate Apache rewrite rules, allowing Apache, which is better at URL parsing, to do the routing work, greatly shortening the routing query time. In addition, the documentation of Symfony2 also claims that it is an Http framework. You can use the knowledge of http and some optimization software that supports the http protocol such as reverse proxy servers like Varnish to do some optimization work. In some cases, you can even directly bypass the entire application. Dropped, so knowledge of http is also quite necessary.
In short, sf is an excellent framework, but if you want to master it well, you must be prepared to spend a lot of time studying it. The cost of learning is also a very important factor. You should weigh this yourself.
In addition, I have the idea of extending some components of SF into PHP, such as service container. Interested students can contact me and we will study together.
怪我咯2017-05-16 16:48:24
Symfony's functions are relatively complete, but considering functionality, development efficiency, and performance indicators, it does not stand out.
I think Symfony is better at object-oriented than other frameworks, or more like Java.
If you are choosing a framework, I suggest you choose some lighter frameworks based on your needs.
仅有的幸福2017-05-16 16:48:24
I have only used symfony2, and have briefly looked at others, including yii (http://www.yiiframework.com/), ci (http://codeigniter.com/).
Symfony2 is quite similar to rails. It basically has built-in ORM (toctrine), view template (twig), Controller mechanism, etc.
Expansion is also quite convenient.
My overall feeling:
1. Fully functional
2. Easy to get
3. Beautiful system
4. The documentation is quite complete
The only downside might be that the community isn't that big yet.
Compared to yii and ci, if it were me, I would still choose symfony.
It seems like zynga is using symfony?