Home >Backend Development >PHP Tutorial >thinkphp source code analysis Version 31 -1

thinkphp source code analysis Version 31 -1

WBOY
WBOYOriginal
2016-07-29 09:06:471150browse

PThinkphp source code analysis (version 3.1) -1

Index.php

Define path constant
  1. Radio Runtruntime.php
Check PHP version

(Version_compare (php_version, '5.2.0','<')) die('require PHP > 5.2.0 !');


  1. System informationdefine('IS_CGI',substr(PHP_SAPI, 0,3)== 'cgi' ? 1 : 0 );
  2. define('IS_WIN',strstr(PHP_OS, 'WIN') ? 1 : 0 );


    $_SERVER['PHP_SELF' ] Indicates the location address of the current php file relative to the website root directory, related to the document root.

$
url = “http://”

$

_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] is available To represent the current url;

defined 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. Here, use array traversal to load, you can give it a try. 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 the project directory structure
    build_app_dir()

    • Execution entry
    • Think::Start();
  • ').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i
    ').text(i)); }; $numbering.fadeIn(1700); }); }); The above introduces thinkphp source code analysis Version 31 -1, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.
  • Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn