Comparison of mainstream PHP frameworks abroad

Source: Internet
Author: User
Tags zend framework
Comparison of mainstream PHP frameworks abroad Edit responsibility:Xiao Xiong Author: Itpub Forum2009-02-03

Text Tag: open-source framework Web framework PHP open-source development language

[It168 technical analysis comment]
Recently, I have simply used several mainstream foreign PHP frameworks (excluding domestic frameworks) that are currently used in China. I have a rough idea about these frameworks. I would like to share them with you briefly, when selecting frameworks, you can use them as a reference.

The main reference frameworks include: codeigniter, CakePHP, zendframework, and symfony.

Note: I have not used many frameworks seriously. I just tried it for a while. Many ideas may be immature or incorrect. please correct me and grow together.

[Codeigniter]

Http://codeigniter.com

Chinese site: http://codeigniter.org.cn

Chinese manual: http://codeigniter.org.cn/user_guide

Video tutorial: http://codeigniter.org.cn/tutorials

Test version: codeigniter_1.6.1

Advantages:

1. the configuration is simple. All configurations are configured using PHP scripts with high execution efficiency. It has the basic routing function and can perform a certain degree of routing. It has the Preliminary Layout function, ability to make a certain degree of interface appearance; database layer encapsulation is good, with basic MVC Functions

2. Quick and concise, with few codes, high execution performance, simple framework, easy to use, low learning costs, and detailed documentation. It comes with many simple and easy-to-use libraries and is suitable for small applications.

Disadvantages:

1. A simple understanding of the model layer as a database operation

2. The framework is slightly simpler and can only meet the needs of small applications.

Rating:

In general, it is worthwhile to use codeigniter to complete simple and fast applications. At the same time, it can construct a certain degree of layout to facilitate template reuse. The data operation layer is well encapsulated, in addition, codeigniter does not use many complicated design modes, and the execution performance and code readability are both good. The additional library is also good, concise and efficient.

[CakePHP]

Http://www.cakephp.org

Chinese manual: http://www.1x3x.net/cakephp

Video tutorial: http://search.you.video.sina.com.cn/s? Key = CakePHP

Test version: cake_1.1.19.6305

Advantages:

1. cakePHP is the most similar to the ROR framework, including the design method and the active record mode for database operations. The design level is very elegant and there is no redundant library. All functions are pure frameworks, execution efficiency is good; hasone and hasone at the database layer have powerful functions and are suitable for complex business processing; routing and configuration functions are good; scaffold is powerful; suitable for medium-sized applications; basically implemented through each layer of MVC; with the ability to automatically operate command line scripts;

2. The document is comprehensive and has been successfully promoted in China. Most of them know CakePHP, and the learning cost is moderate.

Disadvantages:

1. a very serious problem with CakePHP is to regard the model as a database-layer operation, which seriously affects the operation capability other than the database.

2. the cache function of CakePHP is slightly weak, and the configuration function is slightly weak. CakePHP is not suitable for large applications and is only suitable for medium-sized applications. For small applications, the learning cost is slightly higher.

Rating:

In general, the CakePHP framework represents a very important era and representative of the PHP framework, and currently plays a very important role. Many self-written frameworks mimic the CakePHP method, cakePHP is a milestone product. CakePHP reveals ror's agile development method and regards database operations as the only model design idea. It is an excellent tool for developing fast applications and prototypes. Similarly, it is also worth choosing.

[Zend framework]

Http://framework.zend.com

Chinese manual: http://www.phpeye.com/zf

Video tutorial: http://framework.zend.com/docs/screencasts

Test version: ZendFramework-1.5.0

Advantages:

1. the official product comes with a lot of libraries. The framework itself uses a lot of design patterns to write, the architecture is very elegant, and the execution efficiency is moderate. In MVC design, it is concise and has routing functions, the configuration file is powerful (it can process XML and php ini), and various libraries are powerful. It is the most comprehensive function in all PHP frameworks, including not only a framework, it is also a big-class library (replacing pear), which is its main characteristic. It can intuitively support model layers other than database operations (better than codeigniter and CakePHP ), in addition, it is easy to use the loader function to load other new classes. The cache function is very powerful and supports both the front-end cache and the back-end cache, the backend cache supports memcache, APC, SQLite, and files. The database has powerful operations and supports various drivers (adapters)

2. The documentation is comprehensive and mature in domestic communities. Currently, many 2.0 web websites are in use, and the learning cost is moderate.

Disadvantages:

1. the MVC function is relatively weak, and the view layer is simple to implement (the same as not implemented), so it cannot control the front-end page very effectively.

2. There is no automated script. To create an application, including the entry file, all the files must be built manually. The entry cost is high.

3. Zend framework, as a medium-sized application framework, has little problem and can barely serve as a large-scale application framework. However, as a very mature large PHP framework, some efforts are required.

Rating:

As an official framework, Zend Framework's ambition is foreseeable. It also encapsulates many powerful class libraries to provide one-stop Framework Services, in addition, their development teams are very powerful and fully capable of developing powerful products. Therefore, we can basically determine that Zend framework has a promising future. If they spend more time improving the framework. Similarly, the Zend framework architecture itself is relatively elegant. It indicates that Zend has many experts and its design concepts are advanced. Although some functions are not complete enough, such as the view layer, automated scripts and so on, all of which depend on future upgrades. In general, Zend framework is the most promising framework. Of course, you have to invest in your project to use it.

[Symfony]

Http://www.symfony-project.org

Chinese site: http://symfony-project.cn

Authoritative guide to http://www.symfony-project.org/book

Learning reference: http://sf.thecodecentral.com

Test version: symfony-1.0.13

Advantages:

1. symfony is the most powerful php framework I know, and I have been using it for a long time, but many functions have not been mined. It fully implements the MVC Layer 3 and encapsulates everything, including $ _ post, $ _ get data, exception handling, debugging, and data detection. It includes powerful cache functions and automatically loads class (this function is great ), powerful i18n national support; powerful view-layer operations that can contain a single file in a fraction; very powerful configuration functions, yml configuration can control all the frameworks and program running behaviors, strong enough to make people speechless; can define various classes at will, and symfony can automatically load these classes, can be freely called in the program; powerful multi-level project and Application Management: Project --> Application --> module --> action can meet the needs of multiple applications under a project, in addition, each layer can define its own class library, configuration file, and layout; very powerful command line operation functions, including creating projects, applications, modules, and cache refreshing;

2. symfony is definitely the first choice for developing large and complex projects, because the use of symfony will greatly save development costs, and there will be no problems when many people collaborate, after defining the basic class at the project level, any module can be reused, greatly reusing code

Disadvantages:

1. The database operation model adopts the heavyweight propel and Creole, but they have been moved to addon in the version I tested. They are available but not needed.

2. the cache function cannot be controlled. Every development and debugging is always cached. You need to execute symfony CC and symfony RC to clear and recreate the cache;

3. The efficiency is not very high. It takes a lot of time to parse the template and read the configuration file;

4. The learning cost is very high, and there are no mature communities and documents in China, even Chinese manuals. It takes a lot of time to master all functions.

Rating:

Symfony is definitely an enterprise-level framework. It is the only thing that seems to be able to compete with powerful frameworks in the Java field. Powerful things are naturally complicated to learn, but they are also helpful for project development, naturally, it is worthwhile to recommend complicated projects to use symfony for processing. Later maintenance costs are relatively low and the reusability is very strong. If symfony is used in a complex Internet project, you need to consider the database distribution issue. Therefore, you need to discard the database operation layer that comes with symfony and define it by yourself, of course, symfony supports constructing the model layer at will.

[General evaluation]

The above several frameworks have their own characteristics and are all open-source projects, but the frameworks are not the same. codeingiter is generally suitable for small projects, and CakePHP and Zend framework are suitable for medium-sized projects, symfony is suitable for large heavyweight projects. When selecting a project, you must fully consider the customization and scalability of the framework, because each project cannot determine whether you will change as the demand changes.

Relatively speaking, Zend framework and symfony have strong ability to cope with changes, especially the ability to customize model-layer classes at will, which makes it very convenient to add their own business or data processing classes, I personally recommend the framework used in medium and large projects. Codeingiter and CakePHP can also play a major role in small and medium-sized projects, rapid development and prototyping, and are very suitable for the development of target and unclear prototype projects. The best way to understand a framework is to use it. The best way to learn it is to watch videos. :-)

Wise, wise, and wise. When selecting a framework for a project, carefully examine the needs of the project and future changes, and then select a suitable framework, a reasonable balance between the project development speed and the maintainability in the later stage. Of course, it may be better to write a framework by yourself.

I have commented on several frameworks in general. I don't think many things have come up with ideas. Let's just look at them. I also welcome your comments!

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.