How to read a PHP open source code

Source: Internet
Author: User
Tags php source code
How to read a PHP open source code
Many friends are expected to download open source PHP source code on the Internet, PHP source code How to use very simple: the PHP source code copy to your environment, in the browser to enter the address to the source code of the install directory follow the steps to install the OK. Here bean sprouts focus on sharing the PHP source code analysis method.





Remember the bean sprouts before reprinted an article on how to read a PHP open source software, but not after all, not bean sprouts write their own, today and you share how I read a PHP source code, we have a faster way to also welcome to share ha.





Now the Open-source PHP source code is most of the use of MVC pattern developed, this will introduce the method is also for the use of MVC pattern Development Program, as the process-oriented programming methods are now rarely used, so here is too much bean sprouts to share.





One of the biggest benefits of the MVC pattern is the separation of the logic and presentation of the Web page, the controller in the MVC pattern embodies the greatest value, the access to each page is first through the controller controller, the controller to call the required model models and view. So, when we read an open source code, we just have to find the controller and then find the current method in the controller, and it's the quickest way to get familiar with the source code in a particular way. The current approach of the current controller is destined to call a model and view and find these models and views carefully digested. Such a controller to understand and familiar with, then the entire open source code you will know almost.




In fact, many friends may also follow the steps above to read open source code, but you will find that this will be very laborious. For example, you look at the code will be dizzy, in the end this code is what to do, open the back, the front is forgotten. I just started in the company, the boss does not want us to understand the meaning of each line of code, but directly to a demand, according to the requirements to complete the task. Just start the bean sprouts psychological still a little unhappy, even the code is not familiar with, how to achieve demand.




In fact, we are all wrong. You want to fully understand the logic of a set of open source programs and ideas, without the test of time, I guess you get down first. I recommend the method, but also I have used the method: to use which part of the function, first understand that function, and then to see the source code, first think about how you will achieve the same function.





In reading other people's code at the same time, you do not necessarily have to fully believe that the implementation of others, not necessarily the best way, but very worthy of our reference, after all, open source code are tested.



Bean sprouts do not recommend you to fully understand a complete set of PHP open source code, and even spend time to understand the design of the database. It's not necessary to figure out what you're interested in.

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.