CMS in PHP to determine whether the system has been installed methods sample _php Tips

Source: Internet
Author: User

Many of today's common CMS systems are equipped with installers, in order to facilitate the use of users, the new download system before use, will determine whether the CMS system has been installed, if installed then give a hint, do not need to repeat the installation, if not installed then enter the installation interface, guide the user to follow the steps to successfully install the CMS, So based on the PHP environment of the CMS in the end is how to use code to achieve this kind of judgment mechanism? The following is illustrated by an instance code:

<?php
define ("Phpok_set", true);
Define ("app_id", "www");
Define the root directory of the application! (This is not the root of the system) This program limits the application directory to
define ("root", Str_replace ("\", "/", DirName (__file__)) under the standalone application. /");
If the program is out of process, change root to the following line
//define ("ROOT", "./");
Define frame
define ("framework", ROOT.) framework/");
Detect if it is installed, such as not installing jump to Installation page
//recommend that you remove this judgment after the installation is successful.
if (!is_file (ROOT.) Data/install.lock ")//This file is generated when the system is installed, especially to determine if the
{
 header (" location:install/index.php ") has been installed;
 Exit;
}
? >

The above code is extracted from the Phpok, in order to help readers understand the added annotation, for the reader to develop their own CMS system has a certain reference value.

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.