thinkphp Source Analysis (i)

Source: Internet
Author: User

In the work, I came into contact with the development of the thinkphp framework, perhaps for most children's shoes, is a simple use, but as a technology enthusiasts, or do not give up a glimmer of hope, seriously began to read the source of thinkphp, but for a lot of cows and cows, very simple, so easy! I am a rookie, I need more study place. As a later review of notes, save a copy, I usually too lazy, generally do not want to write blog: If there is PHP or architecture colleagues. Welcome to join our group: 13768387

First of all, I say, thinkphp version, I think a classic version is 3.1.3, but the current work is the classic version and 3.2 version, but they are very different, through the START process analysis you will find that many of them re-optimized

Starting the Portal file index.php is much simpler than before, just start with the introduction of thinkphp.php in the ingress (because the default framework already solves it),

 
   
  1. define(‘APP_PATH‘,‘./Application/‘);
  2. require ‘./ThinkPHP/ThinkPHP.php‘;

Let's go into thinkphp.php and see what this file is?

To be blunt is to examine the core things used in thinkphp, including version, suffix type, constant definition, server interface definition, etc., and finally through a

Require Core_path. ' Think '. EXT;
Application initialization
Think\think::start ();

This will give the startup program to the think below the think class, starting with the Start method (the next time in the analysis of this class, there are a lot of messy things)

Here, I say, my own opinion, just represents the current limited idea, the previous version of the launch in the runtime, I feel unreasonable, 3.2 changed to the framework of the boot file, but this file is not encapsulated, I also cried, as if the thinkphp code everywhere write the same, I have seen the Zend Framework source code, especially in the startup of those methods, learn Java students, you will be more cynical green, have the opportunity to join the group: 137,683,871 Refueling Learning!





Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

thinkphp Source Analysis (i)

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.