28if (!defined(
'DOL_DOCUMENT_ROOT')) {
29 define(
'DOL_DOCUMENT_ROOT',
'..');
32require_once DOL_DOCUMENT_ROOT.
'/core/class/conf.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/translate.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
41$_REQUEST[
"logtohtml"] = 1;
45if (isset($_SERVER[
"DOCUMENT_URI"]) && $_SERVER[
"DOCUMENT_URI"]) {
46 $_SERVER[
"PHP_SELF"] = $_SERVER[
"DOCUMENT_URI"];
50$includeconferror =
'';
53$conffiletoshowshort =
"conf.php";
55$conffile =
"../conf/conf.php";
56$conffiletoshow =
"htdocs/conf/conf.php";
66if (!defined(
'DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > 8) {
67 $result = include_once $conffile;
69 if (empty($dolibarr_main_db_type)) {
70 $dolibarr_main_db_type =
'mysql';
74 if ($dolibarr_main_db_type ==
'mysql') {
75 $dolibarr_main_db_type =
'mysqli';
78 if (!isset($dolibarr_main_db_port) && ($dolibarr_main_db_type ==
'mysqli')) {
79 $dolibarr_main_db_port =
'3306';
83 $dolibarr_main_data_root = isset($dolibarr_main_data_root) ? trim($dolibarr_main_data_root) :
'';
84 $dolibarr_main_url_root = isset($dolibarr_main_url_root) ? trim($dolibarr_main_url_root) :
'';
85 $dolibarr_main_url_root_alt = isset($dolibarr_main_url_root_alt) ? trim($dolibarr_main_url_root_alt) :
'';
86 $dolibarr_main_document_root = isset($dolibarr_main_document_root) ? trim($dolibarr_main_document_root) :
'';
87 $dolibarr_main_document_root_alt = isset($dolibarr_main_document_root_alt) ? trim($dolibarr_main_document_root_alt) :
'';
90 if (!empty($dolibarr_main_document_root) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_document_root)) {
91 $dolibarr_main_document_root = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_document_root);
93 if (!empty($dolibarr_main_url_root) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_url_root)) {
94 $dolibarr_main_url_root = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_url_root);
96 if (!empty($dolibarr_main_data_root) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_data_root)) {
97 $dolibarr_main_data_root = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_data_root);
99 if (!empty($dolibarr_main_document_root_alt) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_document_root_alt)) {
100 $dolibarr_main_document_root_alt = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_document_root_alt);
102 if (!empty($dolibarr_main_url_root_alt) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_url_root_alt)) {
103 $dolibarr_main_url_root_alt = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_url_root_alt);
107 if (!empty($dolibarr_main_document_root)) {
108 $result =
loadconf($dolibarr_main_document_root);
112 if (!empty($dolibarr_main_document_root) && !empty($dolibarr_main_db_type)) {
113 $result = include_once $dolibarr_main_document_root.
"/core/db/".$dolibarr_main_db_type.
'.class.php';
115 $includeconferror =
'ErrorBadValueForDolibarrMainDBType';
119 $includeconferror =
'ErrorBadValueForDolibarrMainDocumentRoot';
122 $includeconferror =
'ErrorBadFormatForConfFile';
125$conf->global->MAIN_LOGTOHTML = 1;
128if (!isset($dolibarr_main_db_prefix) || !$dolibarr_main_db_prefix) {
129 $dolibarr_main_db_prefix =
'llx_';
131define(
'MAIN_DB_PREFIX', (isset($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix :
''));
133define(
'DOL_CLASS_PATH',
'class/');
134define(
'DOL_DATA_ROOT', (isset($dolibarr_main_data_root) ? $dolibarr_main_data_root :
''));
135define(
'DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root) ? $dolibarr_main_url_root :
''));
136$uri = preg_replace(
'/^http(s?):\/\//i',
'', constant(
'DOL_MAIN_URL_ROOT'));
137$suburi = strstr($uri,
'/');
141define(
'DOL_URL_ROOT', $suburi);
143if (empty($character_set_client)) {
144 $character_set_client =
"UTF-8";
146$conf->file->character_set_client = strtoupper($character_set_client);
147if (empty($dolibarr_main_db_character_set)) {
148 $dolibarr_main_db_character_set = ($conf->db->type ==
'mysqli' ?
'utf8' :
'');
150$conf->db->character_set = $dolibarr_main_db_character_set;
151if (empty($dolibarr_main_db_collation)) {
152 $dolibarr_main_db_collation = ($conf->db->type ==
'mysqli' ?
'utf8_unicode_ci' :
'');
154$conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation;
155if (empty($dolibarr_main_db_encryption)) {
156 $dolibarr_main_db_encryption = 0;
158$conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;
159if (empty($dolibarr_main_db_cryptkey)) {
160 $dolibarr_main_db_cryptkey =
'';
162$conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey;
164if (empty($conf->db->user)) {
165 $conf->db->user =
'';
172 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
174 $langs->setDefaultLang(
'auto');
187 global $dolibarr_main_db_type;
188 global $dolibarr_main_db_host;
189 global $dolibarr_main_db_port;
190 global $dolibarr_main_db_name;
191 global $dolibarr_main_db_user;
192 global $dolibarr_main_db_pass;
193 global $character_set_client;
196 if (!class_exists(
'Conf')) {
197 $return = include_once $dolibarr_main_document_root.
'/core/class/conf.class.php';
204 $conf->db->type = trim($dolibarr_main_db_type);
205 $conf->db->host = trim($dolibarr_main_db_host);
206 $conf->db->port = trim($dolibarr_main_db_port);
207 $conf->db->name = trim($dolibarr_main_db_name);
208 $conf->db->user = trim($dolibarr_main_db_user);
209 $conf->db->pass = trim($dolibarr_main_db_pass);
211 if (empty($conf->db->dolibarr_main_db_collation)) {
212 $conf->db->dolibarr_main_db_collation =
'utf8_unicode_ci';
227function pHeader($soutitre, $next, $action =
'none')
229 global $conf, $langs;
231 $langs->loadLangs(array(
"main",
"admin"));
234 header(
"Content-type: text/html; charset=".$conf->file->character_set_client);
237 header(
"X-Content-Type-Options: nosniff");
238 header(
"X-Frame-Options: SAMEORIGIN");
240 print
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'.
"\n";
242 print
'<meta http-equiv="content-type" content="text/html; charset='.$conf->file->character_set_client.
'">'.
"\n";
243 print
'<meta name="robots" content="index,follow">'.
"\n";
244 print
'<meta name="viewport" content="width=device-width, initial-scale=1.0">'.
"\n";
245 print
'<meta name="keywords" content="help, center, dolibarr, doliwamp">'.
"\n";
246 print
'<meta name="description" content="Dolibarr help center">'.
"\n";
247 print
'<link rel="stylesheet" type="text/css" href="../install/default.css">'.
"\n";
248 print
'<title>'.$langs->trans(
"DolibarrHelpCenter").
'</title>'.
"\n";
249 print
'</head>'.
"\n";
251 print
'<body class="center">'.
"\n";
253 print
'<div class="noborder centpercent center valignmiddle inline-block">';
254 print
'<img src="helpcenter.png" alt="logohelpcenter" class="inline-block"><br><br>';
255 print
'<span class="titre inline-block">'.$soutitre.
'</span>'.
"\n";
269 $langs->load(
"main");
270 $langs->load(
"admin");
272 print
'</body>'.
"\n";
273 print
'</html>'.
"\n";
Class to stock current configuration.
Class to manage translations.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
pHeader($subtitle, $next, $action='set', $param='', $forcejqueryurl='', $csstable='main-inside')
Show HTML header of install pages.
pFooter($nonext=0, $setuplang='', $jscheckfunction='', $withpleasewait=0, $morehtml='')
Print HTML footer of install pages.
loadconf($dolibarr_main_document_root)
Load conf file (file must exists)