To be advanced Phper want to read through an open source project source code, should study which is better?

Source: Internet
Author: User
Tags php source code yii

Reply content:

In fact, read PHP source code should help the most. The premise is that there are some operating systems and C-language basics http://www. php-internals.com/ There is no project for everyone, reading the code is best for you to find interesting, GitHub has a lot trending PHP repositories on GitHub this month GitHub I think thinkphp is good. We recommend that you read the work that our team developed framework has developed on its basis.
Frame: zentaophp
Products: Zentao, Ranzhi, Chanzhi
We have different views on many of the frameworks on the market, so we have developed our own framework and implemented a variety of open source products based on this framework, each with dozens of function modules, multi-lingual support, deep extension mechanism, API call mechanism and so on. If you are reading the framework code for PHP, then I suggest you look at the more well-known frameworks, such as Symfony2, Lavavel, YII2, but in fact each framework is not so simple to understand the source, you also need to supplement the design patterns and new language features knowledge. It is important to learn the ideas inside rather than the language techniques. According to several open source frameworks that you tag, my personal opinion is as follows:

1. WP: Do not recommend over-study, this blog system used to be good, but also to do business sites, but the source of the use of the design model is particularly special, a large number of global variables, can not be regarded as an advanced way, if you want to research strange tricks, this can be seen;
2. discuz!: There is research value, of course, including the Discuz home of several other open source systems, ucenter,uchome, learning some of his multi-system integration architecture, can provide you with a lot of new ideas;
3. YII: It is recommended to study well, especially YII2, whether it is a directory structure or OOP design patterns are worth learning. The disadvantage is that domestic information is not much, it takes a little time;
4. Symfony: The use is not much, cannot give the objective opinion. The best research is to write code, make projects,
Suggest that you participate in, only enough project experience to distinguish good or bad, experience is not good or bad to distinguish.
can participate in my open source project
Https://git.oschina.net/yiiany/yiiany Personally think two directions
    • One: Web Overall architecture class
    • The second: Business logic class

First, the whole Web architecture class.
The best products are the popular framework, the recommended yii,symfony,zendframework, this kind of structure is complete, tightly encapsulated, fully functional web development framework. When you look at these frameworks, you will experience the concepts in the Web.
For example, if you are studying Yii, you will find that yii places the encapsulation of the cookie on the request and response objects, which will make it clearer to you that the cookie needs to be fetched from the browser at the request and that it needs to be set to the browser side when the response is requested.
And, in addition to the concept of the Web, you can also learn from the excellent framework of good design, design ideas, implementation strategies and so on.
For example, in Yii, if a controller action code reuse is required, the behavior can be used to scale, and a common operation is injected into the controller. At this point, you can imagine that if there is a need to break the structure of functional reuse, you can choose to use the injection class technology to achieve. And then you think, how is this injected class implemented? After code tracing, you will find that the traits mechanism is used in object-oriented. This expands the learning surface.
(PS: The reason for using Yii as an example is the recent release of some articles about Yii, nothing else)


Besides, the business logic class
The so-called business logic class, is the market can achieve some specific functions of the product, such as ECSHOP,PHPCMS. This type of product is characterized by the fact that typical business logic has been implemented and implemented very well, so that when you learn the code, you take a look at the typical business logic of a certain aspect and know what to do when doing something.
Or for example, if you're learning ecshop, then you'll know the business logic that a typical mall should have, with less effort when it comes to similar functions.
PS: There are many such products, you can put your eyes on the world, not only domestic, but the domestic products, you later use of the odds will be capitalized)

Any of the above products, must choose one to read, study, do not put a lot of time in the choice, time long, enthusiasm decreases, you find that you have not formally started to read, just completed the choice, it is very regrettable!

Finally, it is strongly recommended that the manual read through 2 times, say the other, must! Laravel Bar Symfony inside with a lot of Java commonly used design patterns, if used to learn, I think it is more appropriate to wait for me, although many of the old and too large.

Laravel is separated from the symfony, writing and technology are relatively new.

Yaf and Phalcon This is a practical application of the trend, php+c, both performance and development efficiency, read some C code is also necessary
  • 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.