Thinkphp source code parsing Version31-1

Source: Internet
Author: User
: 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
  1. Define path constants
  2. Load the runtime Directory
Runtime. php

  1. Check php version
    if(version_compare(PHP_VERSION,'5.2.0','<')) die('require PHP > 5.2.0 !');
  2. 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
    • Build_app_dir ()
  • 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.

    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.