: This article mainly introduces thinkphp source code parsing Version31-1, for PHP tutorials interested in students can refer to it. Thinkphp source code parsing (Version 3.1)-1
Index. php
- Define path constants
- Load the runtime Directory
Runtime. php
- Check php version
if(version_compare(PHP_VERSION,'5.2.0','<')) die('require PHP > 5.2.0 !');
System Information
define('IS_CGI',substr(PHP_SAPI, 0,3)=='cgi' ? 1 : 0 );
define('IS_WIN',strstr(PHP_OS, 'WIN') ? 1 : 0 );
$ _ SERVER ['php _ SELF '] indicates the address of the current PHP file relative to the website root directory, which is related to document root.
$ Url = "http: //" $ _ SERVER ['http _ host']. $ _ SERVER ['php _ SELF '] can be used to represent the current url;
Define path
defined('CORE_PATH') or define('CORE_PATH', THINK_PATH.'Lib/');
Runtime file
load_runtime_file()
Load the public function library, core control class, exception handling class, and behavior extension class. you can use array traversal to load the function.
Check the cache directory and delete the compilation cache in debug mode:
if(is_file(RUNTIME_FILE)) unlink(RUNTIME_FILE);
check_runtime()
build_runtime_cache()
Create a project directory structure
Execution entry
Think::Start();
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above introduces thinkphp source code parsing Version 31-1, including the content, hope to be helpful to friends interested in PHP tutorials.