简体   繁体   中英

What does this HTTP header mean? OpenCart (PHP) code

What does this HTTP header mean?

if (!defined('DIR_APPLICATION')) { 
    header('Location: install/index.php'); 
    exit; 
}

It is part of OpenCart (PHP) code.

Is DIR_APPLICATION a constant or a directory? What does header mean in that context?

After reading Mozilla Developer Network and W3C , I still can not understand.

Thanks in advance

DIR_APPLICATION是一个常量,很可能应该包含应用程序的安装目录,如果它未通过DIR_APPLICATION defined()检查,这意味着它尚未作为安装的一部分进行设置/定义,它将使用header()将HTTP标头发送给客户端,从而导致重定向到install/index.php

DIR_APPLICATION is actually the constant defined to say where the main directory holding the controller , language , model and view directories are for the Admin/Catalog sections of the application. It is a full path structure of the local file system to the directory that is written to the config.php when the installation is completed. It is defined in each of the two config.php files and as such if it isn't defined, OpenCart assumes that there's not been an installation and redirects to the installation script. Not sure why you've referred to it as a header though as it's in no way a header

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM