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

Source: Internet
Author: User

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

This article describes how to use PHP in CMS to determine whether the system has been installed. For more information, see

Many common CMS systems today have installation programs. For the convenience of users, the new downloaded system will determine whether the CMS system has been installed before use, if the installation is complete, a prompt is displayed, which does not require repeated installation. If the installation is not complete, the installation interface is displayed to instruct the user to install the CMS smoothly According to the steps, so 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 ;}?>

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.