Comparative evaluation of foreign mainstream PHP Framework



Recently used a simple comparison of the current in the country with more than a few major foreign PHP framework (not including domestic framework), there is a general framework for these intuitive feelings, simple share, for the selection of the framework of what to do whenRight when a reference.

The main frame of reference include: CodeIgniter, CakePHP, ZendFramework, Symfony.I do not seriously use a lot of the framework, simply try a bit immature, or may be a lot opinions is wrong, please correct me, to grow together.

CodeIgniter

Advantages:

1. Configuration simple, all configured to use PHP script to configure, execute with high efficiency; with basic routing capabilities to route a certain extent; a preliminary Layout function, able to produce some degree of look and feel; database layer of a good packagewith the basic function of MVC

2. Quick simple little code to implement high-performance, the framework is simple, easy to use, study, low cost, document in detail; comes with a lot of easy to use the library, the framework for small applications

Disadvantages:

1. The Model layer interpreted as a simple database operations

2. Framework somewhat simple, small applications can only be satisfied, a little less able to meet the needs of medium-sized applications

Rating:

Overall, the take to complete a quick and easy CodeIgniter application is still worth while to construct a certain degree of layout, easy template reuse, data manipulation layer is a good package, and CodeIgniter does not use many design patterns are too complex to implementperformance and code readability are good.As for the additional library is also good, simple and efficient.

CakePHP

Advantages:

1. CakePHP is the most similar to the RoR framework, including the design mode, Active Record database operation means; design level is very elegant, does not own extra library, all of the functions are pure framework, the efficiency is not bad; database layerThe hasOne, hasMany function is very powerful, more appropriate for complex business processes; routing, configuration is not bad; automatically build scaffold (scaffold) is very strong; suitable for medium-sized applications; the basic realization of the MVC over each layer; with automatic operation command-linescripting;

2. Comparison of the whole document, to promote more successful in the country, most of them know that CakePHP, learning costs moderate

Disadvantages:

1. CakePHP very serious problem is to be understood as the database layer Model operation has seriously affected the ability to operate outside of the database in addition to

2. CakePHP's cache function slightly weak, and configuration functions somewhat weak; CakePHP is not suitable for large-scale applications, only applications for medium and small applications, the cost of slightly high point of learning

Rating:

Overall, the PHP framework CakePHP framework represents an important and representative of an era, and is currently playing an important role, many have to write their own copy of the CakePHP framework of the way, is a milestone product; CakePHP reveal the RoR'sAgile development methods and the database operation that is the only Model design ideas, as rapid application development and prototyping is a perfect tool; also used to make Web2.0 site development framework, is also worthy of choice.

Zend Framework

Advantages:

1. The official produced, comes with a lot of library, the framework itself uses a lot of design patterns to write, very elegant structure, the efficiency of medium; MVC design, the relatively simple, with routing capabilities, more powerful configuration file (to handleXML and php INI), a variety of library is very powerful, all features PHP framework, the most comprehensive, including not only a framework, it is a big class library (instead of PEAR), which is its main feature; toIn addition to direct support for database operations outside the Model layer (stronger than CodeIgniter and CakePHP), and can be easily loaded using the Loader functions of other newly added Class; Cache function is very powerful, from the front to the back-end Cache Cache support,Cache back-end support of Memcache, APC, SQLite, files and more ways; database operations function is very powerful, supports a variety of drivers (adapters)

2. Documentation is very full, very mature community in the country, and many Web 2.0 sites now in use, the cost of secondary learning

Disadvantages:

1. MVC feature complete weak, View layer simple implementation (like did not achieve the same), not very strong control of the front page

2. There is no automated scripts to create an application, including the import file, all have their own hand-built, high cost of entry

3. Zend Framework application framework as a medium not a big problem, and can barely as a framework for large-scale applications, but as a very mature for large-scale PHP framework, but also takes some effort

Rating:

Produced as the official framework, Zend Framework's ambition is predictable, trying to squeeze out other frameworks, but many powerful library package that provides the framework for a one-stop service, and their development team is very strong, there is complete enoughability to develop products that come out very strong, it is essential to determine the Zend Framework promising, if it takes more time to perfect frame.Similarly, Zend Framework is relatively elegant architecture itself, that there are many master Zend official, the design is relatively advanced, although not perfect enough to achieve some features, such as the View layer, automated scripts, etc., which are dependent on futureupgrade.Overall, the most anticipated Zend Framework is a framework, of course, you now have to put your project is complete with no problem.

Symfony

Advantages

1. Symfony PHP framework that I know the most powerful, and I used a long time, but many features still not excavated; its complete implementation of the MVC layer, encapsulates everything, including the $ _POST, $ _GET data, exception handling, debugging, data detection; contains powerful cache function, automatic load Class (This feature is so cool), the powerful state of i18n support; have a very strong view layer operation can be fragmented multiple files containing a single; very powerful configuration capabilities, the use yml configuration to control the behavior of all the frames and running, strong enough to make people speechless; that is all their own arbitrary definition of class, and symfony will automatically load (auto load) the class,freely in the program can call; includes a strong multi-level projects and application management: Project -> Application -> Module -> Action, under a project to meet the needs of multiple applications, and each layer can be definedtheir own libraries, configuration files, layout; very powerful command line functions, including the establishment of projects, build applications, create modules, flush the cache and so on;

2. Symfony is definitely the first choice for developing large-scale complex projects, because the use of Symfony, will greatly save development costs, and collaboration over time, no problem, defined in the Project based on Class after class, any module can be reused,reuse much code

Disadvantages:

1. The database heavyweight operating model using propel and creole, but in the version I tested has been moved to the addon in them, may or may not

2. Caching can not control every time the cache is always development and debugging, need to perform symfony cc, symfony rc to clear and rebuild the cache;

3. Efficiency is not high, especially in parsing the configuration file templates and the process of reading, spend time a lot;

4. Learning cost is high and there are not any mature community and documentation, not even the Chinese manual, corresponding to master all the features, you need to spend more time

Rating:

Symfony is definitely enterprise-level framework, the only area which seems to powerful Java framework with something to compete; powerful things, natural learning complex, but also the corresponding development of the project more helpful, the natural complex projects is recommended to use Symfonyto deal with, think it is worth, the latter is relatively low maintenance costs, reusability is very strong.If you use the corresponding Symfony should all be more complex Internet projects, it is necessary to consider the corresponding problem of the distribution on the database, you need to abandon Symfony comes with the database operation level, needs its own definition, of course, Symfony supports an arbitrarystructural model layer.

Summary

Over several frameworks have their own characteristics, and are open source projects, but not the same as the framework for the project, in general, more suitable for small projects CodeIngiter, CakePHP and the Zend Framework is suitable for medium-sized projects, Symfony heavyweight more suitable for large-scale projects,When the project selection, we should fully consider the framework can be customized, scalability, because each project can not be sure if you will be changed as needs change.

Relatively speaking, Zend Framework and Symfony relatively strong ability to cope with change, in particular, can freely customize the model layer of the Class, can be very convenient to increase their business or data processing classes, I personally recommend the use of large-scale projects in the framework.

CodeIngiter and CakePHP same in small and medium projects can play a significant role in the development and rapid prototyping, target is not very suitable for the prototype development of the project clear.

Of course, perhaps, to write a framework more suitable.

General framework for the evaluation of several estimated that many things are not the point, we tentatively look for the same views and suggestions are welcome corrections!