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),
define(‘APP_PATH‘,‘./Application/‘);
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)