feat: GTSIT 사이트 구축
This commit is contained in:
29
config/app.php
Normal file
29
config/app.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'name' => '(주)지티에스정보통신',
|
||||
'legal_name' => '(주)지티에스정보통신',
|
||||
'base_url' => 'https://gtsit.co.kr',
|
||||
'base_path' => rtrim((string) (getenv('GTSIT_BASE_PATH') ?: ''), '/'),
|
||||
'app_root' => (string) (getenv('GTSIT_APP_ROOT') ?: dirname(__DIR__)),
|
||||
'public_root' => (string) (getenv('GTSIT_PUBLIC_ROOT') ?: dirname(__DIR__) . '/public'),
|
||||
'noindex' => filter_var(getenv('GTSIT_NOINDEX') ?: false, FILTER_VALIDATE_BOOL),
|
||||
'timezone' => 'Asia/Seoul',
|
||||
'session_name' => 'gtsit_session',
|
||||
'naver_maps' => [
|
||||
'client_id' => (string) (getenv('NAVER_MAPS_CLIENT_ID') ?: '0xuekem2qn'),
|
||||
'query' => '서울특별시 송파구 정의로7길 13',
|
||||
'latitude' => 37.48524,
|
||||
'longitude' => 127.11478,
|
||||
],
|
||||
'contact' => [
|
||||
'phone' => '1833-4917',
|
||||
'phone_sub' => '1833-4918',
|
||||
'fax' => '02-6442-0670',
|
||||
'email' => 'gts0201@naver.com',
|
||||
'address' => '서울시 송파구 정의로7길 13, B동 오피스 1020호',
|
||||
'business_hours' => '평일 09:00–18:00',
|
||||
],
|
||||
];
|
||||
36
config/database.php
Normal file
36
config/database.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$candidates = array_filter([
|
||||
getenv('GTSIT_DB_ENV') ?: null,
|
||||
dirname(__DIR__) . '/.secrets/db.env',
|
||||
'/home/hosting_users/gts0201/.gtsit-db.env',
|
||||
]);
|
||||
|
||||
$values = [];
|
||||
foreach ($candidates as $candidate) {
|
||||
if (!is_readable($candidate)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (file($candidate, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [] as $line) {
|
||||
$line = trim($line);
|
||||
if ($line === '' || str_starts_with($line, '#') || !str_contains($line, '=')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
[$key, $value] = array_map('trim', explode('=', $line, 2));
|
||||
$values[$key] = trim($value, "\"'");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return [
|
||||
'host' => $values['DB_HOST'] ?? 'localhost',
|
||||
'port' => (int) ($values['DB_PORT'] ?? 3306),
|
||||
'name' => $values['DB_NAME'] ?? '',
|
||||
'user' => $values['DB_USER'] ?? '',
|
||||
'password' => $values['DB_PASSWORD'] ?? '',
|
||||
'charset' => 'utf8mb4',
|
||||
];
|
||||
Reference in New Issue
Block a user