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.