Example of how PHP checks whether the system has been installed in CMS

Source: Internet
Author: User
This article mainly introduces how to use PHP in CMS to determine whether the system has been installed. if you need it, you can refer to many common CMS systems that have installed programs for your convenience, before using the new downloaded system, the system will determine whether the CMS system has been installed. if it is installed, a prompt will be displayed, which does not require repeated installation. if it is not installed, the installation interface will be displayed, instruct the user to install CMS smoothly according to steps. how does the PHP-based CMS use code to implement this judgment mechanism? The following is an example code:

<? Phpdefine ("PHPOK_SET", true); define ("APP_ID", "www"); // define the root directory of the application! (This is not the ROOT directory of the system) This program limits the application directory to define ("ROOT", str_replace ("\\","/", dirname (_ FILE __)). "/"); // if the program goes out, change ROOT to the following line. // define ("ROOT ",". /"); // define the FRAMEWORK define (" FRAMEWORK ", ROOT. "framework/"); // check whether it has been installed. if it is not installed, go to the installation page. // We recommend that you remove this check after the installation is successful. If (! Is_file (ROOT. "data/install. lock ") // This file is generated after the system is installed. it is used to determine whether {header (" Location: install/index. php "); exit ;}?>

The above code is excerpted from PHPok and added comments to help readers understand it. it has some reference value for readers to develop their own CMS systems.

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.