-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathConfig.php
More file actions
106 lines (80 loc) · 3.12 KB
/
Copy pathConfig.php
File metadata and controls
106 lines (80 loc) · 3.12 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/*!
*
* Config.php - end2end.tech
* (c) 2023 ActiveTK.
*
* Released under the MIT license.
*
*/
/* -------------------------------- */
/* -------- 設定はここから -------- */
/* -------------------------------- */
/* システム全般の設定 */
// ドメイン名
define( "Domain", "localhost:3000" );
// TLSの有無
define( "EnableSSL", false );
// 「お問い合わせ」の通知先メールアドレス
define( "NotificationEmail", "notification@localhost" );
// APIをサブドメインで有効にする
define( "EnableAPIAsSubDomain", false );
// アップロードできる最大サイズ
define( "MaxUploadSize", 1024 * 1024 * 100 );
// デバッグモード
define( "DEBUG", false );
// 管理者の削除用パスワード
define( "ForceRemovePassword", "password" );
/* MySQLの設定 */
// データベース名
define( "DB_Name", "MyDatabase" );
// データベースのホスト
define( "DB_Host", "localhost" );
// データベースの文字コード
define( "DB_Charset", "UTF8" );
// データベースのユーザー名
define( "DB_USER", "root" );
// データベースのパスワード
define( "DB_PASS", "password" );
/* -------------------------------- */
/* -------- 設定はここまで -------- */
/* -------------------------------- */
mb_language( "Japanese" );
mb_internal_encoding( "UTF-8" );
define( "FullURL",
( EnableSSL ? "https" : "http" ) . "://" . Domain . "/"
);
define( "APIEndPoint",
( EnableAPIAsSubDomain ?
( ( EnableSSL ? "https" : "http" ) . "://api." . Domain . "/" ) :
( ( EnableSSL ? "https" : "http" ) . "://" . Domain . "/api.end2end.tech/index.php?request=" )
)
);
define( "DSN", "mysql:dbname=" . DB_Name . ";host=" . DB_Host . ";charset=" . DB_Charset );
// デバッグモードの場合
if ( defined( "DEBUG" ) ) {
ini_set('display_errors', "On");
ini_set( 'error_reporting', E_ALL );
}
// 管理者にメールで通知する関数
function NotificationAdmin( string $title = "", string $str = "" ) {
if ( empty( NotificationEmail ) )
return;
try{
$body = '<body style="background-color:#e6e6fa;text:#363636;"><div align="center"><p>【' . htmlspecialchars( $title ) . '】</p><hr color="#363636" size="2">' . $str .
'<br><hr color="#363636" size="2"><font style="background-color:#06f5f3;">Copyright © 2023 ActiveTK. All rights reserved.</font></div></body>';
define( "MAIL_SUBJECT", $title );
define( "MAIL_BODY", $body );
define( "MAIL_FROM_ADDRESS", "no-reply@" . Domain );
define( "MAIL_FROM_NAME", "no-reply@" . Domain );
define( "MAIL_HEADER",
"Content-Type: text/html; charset=UTF-8 \n".
"From: " . MAIL_FROM_NAME . "\n".
"Sender: " . MAIL_FROM_ADDRESS ." \n".
"Return-Path: " . MAIL_FROM_ADDRESS . " \n".
"Reply-To: " . MAIL_FROM_ADDRESS . " \n".
"Content-Transfer-Encoding: BASE64\n");
@mb_send_mail( NotificationEmail, MAIL_SUBJECT, MAIL_BODY, MAIL_HEADER, "-f " . MAIL_FROM_ADDRESS );
}
catch (Exception $e) { }
}