Thinkphp, qeephp, cakephp, zendframework, symfony _ PHP Tutorial

Source: Internet
Author: User
Comparison between Thinkphp, qeephp, cakephp, zendframework, and symfony. Demon believes that an excellent framework is not just a few business flows. it should be scalable, rich, set, and discrete. Simply put, it is the contradiction of all things. game demon thinks that an excellent framework is not just a few business flows, and it should be extensible,
Is rich, is a set, is discrete. Simply put, it is the contradiction between all things, which is both free and aggregated.

Volume cut-in:

Framework VolumeCake_1.2.2.81202.01MBqeephp-2.1.2116993KBThinkPHP 1.5947KBZendFramework-1.7.8-minimal16.1MBsymfony 1.2.511.1MB

Note: The above are the minimum sizes after deleting unnecessary files such as doc and test.

Roughly think:

Domestic frameworks are generally relatively small, and foreign frameworks are generally large -.. -Here we cannot simply think that the small size is better.


Directory structure:

Thinkphp

The left side is the directory structure of thinkphp,
Demon roughly looked:
When common is run,
Function library, universal file lang estimation is the core internal language
Lib/org is a common tool: date, io, net, rbac, text, and other lib/think are the core,
Focus on the adaptation plug-in under the mvc process plugin
Conclusion: it is too small,
You can see everything at a glance
Demon analyzes the thinkphp process from the perspective of beginners:
Initialize and load the necessary files, including the classes in common and core,
You can call the new app (),
Then the worker runs with init.
Guess that the app instantiates diapatcher and then calls a method similar to run,
Start the routing action.

Qeephp

Look at the directory structure of qeephp,
Very comfortable,
The layers are clear,
Each folder corresponds to a function domain.
And each file has an exception.
Note the command line shortcut,
Behavior in extend is bound to the model.
Decorate mode.
In qeephp, we can see that some design modes are used to meet scalability,
Single responsibility.
Qeephp startup method ..
Cannot be found at the moment.
This is due to the benefit of a single responsibility.
Refer to the official documentation:
See:
// Obtain application startup information
$ App_config = require (dirname (_ FILE _). '/../config/boot. php ');
// Load the QeePHP framework and application object according to the settings in the startup information
Require $ app_config ['qeephp _ dir']. '/library/q. php ';
Require $ app_config ['app _ dir']. '/myapp. php ';
// Construct the application object and start the MVC mode
Echo MyApp: instance ($ app_config)-> dispatching ();
Very comfortable...
However, it is not simplified enough,
In particular, myapp. php and the following MyApp: instance ($ app_config)-> dispatching ();
. (I think the author's intention is to think of multiple applications with multiple portals and deployment modes,
But the entry should not perceive the file name, but the index)
For example:
// Load the QeePHP framework and application object according to the settings in the startup information
Require $ app_config ['qeephp _ dir']. '/library/q. php ';
// Obtain application startup information
$ App_config = qee_App: getConfiguration ("myapp ");
// Construct an application object,
And start the MVC mode
Qee_App: createInstance ($ app_config)-> dispatching ();
This is not better.
No cumbersome manual loading,
You only need to know the name of the app you want to run.
Summary:
It can be said that qeephp looks at the current directory structure,
Yes.
Of course there are still some problems.
Qeephp has a better directory structure than thinkphp.

Cakephp

The cake directory is very interesting:
An empty app project directory.
Then there are four core caches, controller, model, and view. they are really mvc...
Very simple, too simple,
Cakephp provides cli to initialize a basic mvc application.
So the startup method is similar to qeephp.

Zend

Zend has to use thumbnails,
Too many are too big.
Zend is clearly clear,
It is clearer than qeephp and symfony,
It is comprehensive.
The feature is that Folders can complete some tasks in a single way,
This allows all classes to be separated separately,
The external php file is encapsulated,
The corresponding directory is the class contained in the class,
Use the combination mode.
The zend startup method is unfamiliar.
But it should not be bad.

Symfony

The symfony structure is also relatively clear,
But its granularity is more delicate than zend.
It separates controller, response, and request.
However, the overall line is inferior to zend,
Incomplete,
Not discrete enough.
Some symfony components,
There is a certain degree of dependency.

Summary:

Criteria:

1. Whether the directory level is clear

2. Whether the meaning of a directory is consistent with its internal class'

3. Directory structure consistency

From the directory, zend> symfony> qeephp> cakephp> thinkphp

Class diagram

Thinkphp

Core class diagram, we can see a single inheritance, derived from base. Almost all classes in think are inherited from the base.

Util class diagrams are all from the base. I use a simple hierarchical relationship to describe the structure of thinkphp.

Base-centered, outward radiating structure.

Qeephp

The root class graph in ea is a q, more comfortable, and in other classes, it is not pattern for the mode.

Figure:

As you can see, there is no relation between a single class and is cited as the context class to manage the application context. this is a good design idea. Because we should use symfony for reference. It will be analyzed later.

Qeephp class levels can be said to be free and scattered.

Symfony

It took 8 minutes for the class graph student to achieve this.

Remove the orm layer plug-in (mvc of symfony, supported by plug-ins, propel or doctince)

The application plug-in mechanism symfony can be flexibly changed to m.

There is no associated single class, and different configuration files can be read by means of derivation.

Symfony uses derivation in many cases. The configuration driver is uniformly driven by sfcontext and managed by sfconfig. A good architecture and a single responsibility allow multiple classes to complete the mvc business flow driven by sfcontext.

The position of sfcontext is util, basic suite. that is to say, if you do not need to run the mvc mode, you only need to call the dispatcher of sfcontext to create a runtime context, mvc or command line mode depends on the method you call.

Elegant and simple.

A context class manages all the components required for mvc.

Zend

It is also elegant and simple. It also manages everything with a context.

If zend is relatively large, the image will not be published.

Cakephp

Cakephp is easy to say. It's too weak. Demon classifies it as thinkphp, qeephp, and cakephp.

It took three hours to make a preliminary comparison. Of course, the most suitable for you is the best.

Symfony and zend are suitable for demon, so you can handle them yourself.

Summary:

Attention is rich, a set, and a discrete. Simply put, it is the contradiction between all things...

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.