-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathContentsPlanet.php
107 lines (93 loc) · 3.62 KB
/
ContentsPlanet.php
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
define('VERSION', '2022.08.31');
define('COPYRIGHT',
'<b>ContentsPlanet ' . VERSION . '</b>' .
' © 2016-2022' .
' <a href="https://contentsviewer.work/Master/ContentsPlanet/ContentsPlanet">ContentsPlanet Development Team</a>'
);
/**
* Defines the default internal character encoding.
* This deprecated feature will certainly be removed in the future.
* <https://www.php.net/manual/en/mbstring.configuration.php>
*
* Users should leave this empty and set default_charset instead.
*/
// ini_set('mbstring.internal_encoding' , '');
ini_set('default_charset' , 'UTF-8');
define('ROOT_DIR' , dirname(__FILE__));
define('MODULE_DIR' , ROOT_DIR . DIRECTORY_SEPARATOR . 'Module');
define('CONTENTS_HOME_DIR', ROOT_DIR . DIRECTORY_SEPARATOR . 'Home');
define('SERVICE_DIR' , ROOT_DIR . DIRECTORY_SEPARATOR . 'Service');
define('CLIENT_DIR' , ROOT_DIR . DIRECTORY_SEPARATOR . 'Client');
define('CACHE_DIR' , ROOT_DIR . DIRECTORY_SEPARATOR . 'Cache');
define('FRONTEND_DIR' , ROOT_DIR . DIRECTORY_SEPARATOR . 'Frontend');
define('LOCALES_DIR' , ROOT_DIR . DIRECTORY_SEPARATOR . 'Locales');
define('LOG_DIR' , ROOT_DIR);
$rootURI = str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), '', str_replace('\\', '/', __DIR__));
if(strlen($rootURI) != 0 && strpos($rootURI, '/') !== 0){
// パスがあって最初に'/'がないときは追加する.
$rootURI = '/' . $rootURI;
}
//
// + $_SERVER['DOCUMENT_ROOT']
// + ContentsPlanet
// + index.php
// + ...
//
// https://contentsviewer.work/ContentsPlanet/Master/Root
// >---------------------------< ... $_SERVER['REQUEST_URI']
// "/ContentsPlanet/Master/Root"
// >---------------< ... ROOT_URI
// "/ContentsPlanet"
// >------------< ... $vars['subURI']
// "/Master/Root"
//
//
// + $_SERVER['DOCUMENT_ROOT']
// + index.php
// + ...
//
// https://contentsviewer.work/Master/Root
// >------------< ... $_SERVER['REQUEST_URI']
// "/Master/Root"
// >< ... ROOT_URI
// ""
// >------------< ... $vars['subURI']
// "/Master/Root"
//
/**
* ex)
* "/ContentsPlanet",
* ""
*/
define('ROOT_URI', $rootURI);
define('CLIENT_URI', ROOT_URI . '/Client');
define('SERVICE_URI', ROOT_URI . '/Service');
/**
* サブURIに何も設定されていないときに参照される.
*/
define('DEFAULT_SUB_URI', '/Master/Root');
define('DEFAULT_CONTENTS_FOLDER', './Master/Contents');
define('META_FILE_NAME', '.metadata');
define('ROOT_FILE_NAME', 'Root');
define('INDEX_FILE_NAME', '.index');
define('DEFAULT_LAYER_NAME', 'en');
define('REDIRECT_HTTPS_ENABLED', false);
/**
* Session cookie parameter settings
*/
ini_set('session.cookie_secure', !empty($_SERVER["HTTPS"]));
ini_set('session.cookie_httponly', true);
define('USER_TABLE', [
'master' => [
'hashedPassword' => '',
'digest' => '',
'contentsFolder' => './Master/Contents',
'isPublic' => true,
'enableRemoteEdit' => false,
'remoteURL' => '',
'notifyingList' => [
// ['type' => 'mail', 'destination' => 'your.mail@address'],
]
],
]);