-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.php
More file actions
81 lines (69 loc) · 2.52 KB
/
setup.php
File metadata and controls
81 lines (69 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
// îòêëþ÷åíèå âûâîäà ñîîáùåíèé îá îøèáêàõ
//error_reporting(0);
// âðåìàåííàÿ çîíà ïî óìîë÷àíèþ
date_default_timezone_set('Europe/London');
//date_default_timezone_set('Asia/Yekaterinburg');
// áàçîâûå äàííûå
$l_sDBDirectoryName = 'db'; // èìÿ ïàïêè äëÿ áàçû äàííûõ
$l_sClassesDirectoryName = 'classes'; // èìÿ ïàïêè ãäå ëåæàò îñíîâíûå êëàññû
$l_sUploadDirectoryName = 'uploaded'; // èìÿ ïàïêè äëÿ çàãðóçêè ôàéëîâ
$l_sHostName = 'Rik.in';
$l_sPathOnHost = '';
// ïðåäâîðèòåüíûå äàííûå
$l_sURL = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'; // îïðåäåëåíèå òèïà url
$l_sSelfDirectoryPath = dirname(__FILE__); // ëîêàëüíàÿ ïàïêà
// çàãðóçêà ðåãèñòðà
include_once($l_sSelfDirectoryPath . DIRECTORY_SEPARATOR . $l_sClassesDirectoryName . DIRECTORY_SEPARATOR . 'cregistry.php');
include_once($l_sSelfDirectoryPath . DIRECTORY_SEPARATOR . $l_sClassesDirectoryName . DIRECTORY_SEPARATOR . 'csession.php');
// çàïîëíåíèå ðåãèñòðà
CSession::GetInstance();
CRegistry::GetInstance();
CRegistry::GetInstance()->Set('local_db_path', $l_sSelfDirectoryPath . DIRECTORY_SEPARATOR . $l_sDBDirectoryName . DIRECTORY_SEPARATOR);
CRegistry::GetInstance()->Set('local_classes_path', $l_sSelfDirectoryPath . DIRECTORY_SEPARATOR . $l_sClassesDirectoryName . DIRECTORY_SEPARATOR);
CRegistry::GetInstance()->Set('local_upload_path', $l_sSelfDirectoryPath . DIRECTORY_SEPARATOR . $l_sUploadDirectoryName . DIRECTORY_SEPARATOR);
CRegistry::GetInstance()->Set('www_host_name', $l_sHostName);
CRegistry::GetInstance()->Set('www_work_path', $l_sURL . $l_sHostName . '/' . ((trim($l_sPathOnHost)) ? ($l_sPathOnHost . '/') : ''));
// óäàëåíèå ýêðàíèðóþùèõ ñèìâîëîâ
if(get_magic_quotes_gpc())
{
// îáõîä ìàññèâà
foreach($_POST as $i => $data1)
{
// åñëè ìàññèâ
if(is_array($data1))
{
// îáõîä ìàññèâà
foreach($data1 as $j => $data2)
{
// ñîõðàíåíèå çíà÷åíèÿ
$_POST[$i][$j] = stripslashes($data2);
}
// ñòðîêà äàííûõ
} else
{
// ñîõðàíåíèå çíà÷åíèÿ
$_POST[$i] = stripslashes($data1);
}
}
// îáõîä ìàññèâà
foreach($_GET as $i => $data1)
{
// åñëè ìàññèâ
if(is_array($data1))
{
// îáõîä ìàññèâà
foreach($data1 as $j => $data2)
{
// ñîõðàíåíèå çíà÷åíèÿ
$_GET[$i][$j] = stripslashes($data2);
}
// ñòðîêà äàííûõ
} else
{
// ñîõðàíåíèå çíà÷åíèÿ
$_GET[$i] = stripslashes($data1);
}
}
}
?>