ThinkPHP portal File Settings and related precautions analysis _ php instance

Source: Internet
Author: User
This article mainly introduces ThinkPHP portal File Settings and related precautions, and analyzes in detail the meanings and setting skills of related settings when setting the portal file in the form of annotations, which is of great practical value, for more information about ThinkPHP entry File Settings and related precautions, see the following examples. Share it with you for your reference. The details are as follows:

The Code is as follows:

<? Php
/* Meaning of the first layer:
* It defines the directory path of the core framework file related to thinkphp. It can be used to find this path during future running of this constant,
* Ensure that there will be no problems in the future running process (there will be no errors in the loading path of the entire project );
* Layer 2 meaning:
* An operation (Wall jumping) prevents direct access to our sensitive files. How can this problem be avoided? A page can contain the entire
* For sensitive pages, user access must be performed through page (A) and security-related matters should be handled on page */

Define ("THINK_PATH", "./thinkphp /");

/* APP_PATH: Project path
* Develop a CMS, blog, Forum project,
* APP_PATH: Application Path (Project path), divided into foreground and background applications
* At this time, a folder is placed in the foreground application, and a folder is put in the background application. This is more scientific and standardized */

Define ("APP_PATH", "./home /");

/* APP_NAME: Project name (Application name)
* One: Makes thinkphp well differentiated during loading.
* Two: in the future, we will be able to control the front-end and back-end permissions and separate them when managing RBAC permissions;
*/

Define ("APP_NAME", "home ");
// Enable the debug mode. Once the debug mode is enabled,
// 1) it automatically helps us identify the case in linux;
// 2) the method name is case sensitive to the Template Name;
// 3) the simulated folder is case-insensitive;
Define ('app _ debug', true );

// Contains the entire thinkphp framework portal file; require contains failed, interrupt the entire program running
Require THINK_PATH. 'thinkphp. php ';
// App is a class and run is a static method;
// App: run ();
?>

I hope this article will help you design PHP programs based on the ThinkPHP framework.

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.