SoFunction
Updated on 2025-03-09

Analysis of ThinkPHP entry file settings and related precautions

<?php
/*The first level of significance:
*Defines the core framework file directory path related to thinkphp. It can use this constant to find this path when it is run in the future.
* Ensure that there will be no problems during the future operation (there will never be errors in the entire project running load path);
*The second level of significance:
*Doing an operation (putting over the wall) is to prevent direct access to our sensitive files. How to avoid it? I can make a page that contains the entire one.
*Sensitive pages, users must access the access through page (A), and security-related matters must be handled in page A */
  
define("THINK_PATH","./thinkphp/"); 
 
/*APP_PATH: Project path
*Develop a CMS, blog, forum project,
*APP_PATH: Application path (project path), divided into front-end applications and back-end applications
*At this time, the front desk application puts a folder, and the back desk application puts a folder, which is more scientific and standardized to use. */
  
define ("APP_PATH","./home/"); 
 
/*APP_NAME: Project name (application name)
*one: When thinkingphp is loaded, it can make good distinction.
*two: It allows us to control the permissions of the front and backend well when we are doing permissions RBAC management in the future and separate them;
  */
 
define ("APP_NAME","home"); 
// Turn on debug mode, once the debug mode is turned on,
//1) It will simulate linux and automatically help us recognize upper and lower case;
//2) The case of the method name is related to the case of the template name;
//3) The simulated folder is case-insensitive;
define('APP_DEBUG',true);
 
//Include the entire entry file of the thinkphp framework; require failed to include, interrupting the entire program operation.
require THINK_PATH.''; 
//App is a class, and run is a static method;
//App::run(); 
?>