App Startup Project-php Framework Selection

Source: Internet
Author: User
Tags php framework codeigniter zend framework
This article discusses the development framework for PHP-based language selection following the app startup Project-backend language selection. PHP has emerged from the birth of hundreds of size framework, others say that PHP is inherently anti-frame free language, the use of the framework will reduce the performance of PHP. Indeed, the introduction of complex architectures has led to a reduction in performance, but I think from a team-based perspective, the development of a unified framework helps to expand cooperation and future. The superiority of the framework is related to the performance of the program, and also to the efficiency of development, performance and development efficiency many times in the field of programming is a pair of contradictions, as C and Java, a performance known, a development efficiency and popular. Finding balance in contradiction is one that has never been right or wrong.

There is still a balance between performance and efficiency in many of PHP's frameworks, and the reputation of laravel is called the most elegant framework, YAF, Phalcon as the fastest frame, and Yii, CodeIgniter, Zend framework and other well-known frameworks. It's not that elegance is unpleasant or fast, it's just a relative evaluation. So how do we choose the framework?

First, what is the basis of choice? Is it performance, or efficiency?

Although Laravel official website homepage big word "Love beautiful code?" We do too. " Show its elegant characteristics, this does not affect the elegance of Phalcon, YII, Zend framework, in the development efficiency is not significantly improved, but different frameworks in the performance gap is more obvious. See Performance comparison, the Web page from JSON, single query, multi-query and other aspects of the framework performance comparison, in addition to PHP native, Phalcon-micro, YAF, Phalcon are several times the performance of Laravel.

Second, how much do we need the framework for? Is it an all-inclusive nanny type, or a minimalist dad type?

All-inclusive nanny-style frame like a nanny to help you think carefully, take care of you basically can not live independently. This kind of framework takes into account all aspects of web development as much as possible, the framework has more restrictive development patterns, the developers are best to follow their limitations, smaller projects will be efficient and easy, and as development progresses, there will be a dilemma between constraints and breakthroughs.

The minimalist frame of the father gives you the guidance of the general direction as well as the small details to give you free. This kind of framework only implements the framework of the implementation of the route, MVC, Request, Response, Autoloader,orm, Cache, ACL and other important functions are freely implemented by the developer.

Phalcon and Laravel are well-decoupled in architecture, and they can be used as nanny-type or as dads. Phalcon also provides a PHALCON-MICRO simplified framework to further improve performance.

The following is a brief analysis of Phalcon, YAF and Laravel.

Phalcon

Development of C-language extensions compiled to PHP based on the Zephir language, built for high performance.

The Phalcon team provides the Zephir language, a language that is very similar to PHP, and is designed to write PHP extensions that developers can base on Zephir development project-related PHP extensions, such as database connectivity components, which require a user name and password to be written to the configuration file when the PHP project connects to the database. Get to the configuration file to get the account password, if the database connection part compiled to C extension, can be guaranteed to some extent the security of the user name and password. For core components that are common to the team and trained, you can compile as a C extension, which developers can take to improve performance and protect core code. For commercial software, compiling all C extensions is also a must.

The Phalcon core is based on the idea of dependency injection, and the plugin and middleware mechanisms are based on event-driven patterns. Dependency Injection enables runtime resource management, and event-driven programming provides a framework for developers to extend their possibilities.

PHALCON-MICRO enables ultra-lightweight application development.

The Phalcon code organization is highly similar to the Zend Framework and is easy to get started.

Can not be in the framework of debugging breakpoints, novice development, not familiar with the framework, writing code when there is an unknown problem, to debug within the framework, there are only two ways, one is to listen to intra-frame events, judgment business logic, but this method is limited by the event throw location, and observable data is limited. Second, the use of Zephir language to modify the framework source code after recompilation, this is a relatively time-consuming thing.

Yaf

Domestic development, most of Baidu's projects are based on its development. As with Phalcon and C compiled into PHP extensions, performance is equivalent to Phalcon-micro. It is an ultra-lightweight framework that, in addition to the core MVC, is presented to the developers themselves, and is suitable for experienced developers for large-scale project development, almost without the developer community. It is just as phalcon as it is for in-frame debugging.

Laravel

The hottest PHP framework on GitHub, several times the Phalcon developer's activity, is known for its beautiful code. The project code pursues artistry, even the command line is named with Artisan. The framework is fully decoupled while providing a rich set of components, and the development style is similar to Python's Django framework. But the code style is too unconventional, such as the core code at the level of registration for illuminate, with eloquent to express ORM, have PHP other framework experience will appear unfamiliar.

Summarize

This paper analyzes the basis of the selection framework and compares the advantages and disadvantages of the three frames of Phalcon, Yaf and Laravel. If your team does not have much interest in the C extension boost performance, the development experience is not enough, it is recommended to choose Laravel; If your team has a deep understanding of the design pattern, the PHP framework source code has a certain research, the ability to modify and extend the framework source code, recommended to choose Phalcon, have Zend Framework framework experience should choose Phalcon; If you want to learn to write a frame of your own from scratch, consider starting with YAF. The frameworks of Yii, CodeIgniter, thinkphp and so on are not analyzed, and they do not affect their existence as an excellent framework.

——————————————–

This site in addition to mark [FW] and information articles are original articles, reproduced please note:

Reprint Source: Coming X

Original link: App Startup Project-php Framework Selection

——————————————–

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.