AvocadoAmber/AvocadoEdition_Light/install/install.inc.php

98 lines
3 KiB
PHP
Raw Normal View History

2022-09-17 20:50:50 +09:00
<?php
2024-09-19 20:48:52 +09:00
if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가
$data_path = '../' . G5_DATA_DIR;
2022-09-17 20:50:50 +09:00
2024-09-19 20:48:52 +09:00
if (!$title)
$title = G5_VERSION . " 설치";
2022-09-17 20:50:50 +09:00
?>
<!doctype html>
<html lang="ko">
2024-09-19 20:48:52 +09:00
2022-09-17 20:50:50 +09:00
<head>
2024-09-19 20:48:52 +09:00
<meta charset="utf-8">
<title><?php echo $title; ?></title>
<link rel="stylesheet" href="install.css">
2022-09-17 20:50:50 +09:00
</head>
2024-09-19 20:48:52 +09:00
2022-09-17 20:50:50 +09:00
<body>
2024-09-19 20:48:52 +09:00
<div id="ins_bar">
2022-09-17 20:50:50 +09:00
<span id="bar_img">AVOCADO EDITION</span>
<span id="bar_txt">INSTALLATION</span>
2024-09-19 20:48:52 +09:00
</div>
2022-09-17 20:50:50 +09:00
2024-09-19 20:48:52 +09:00
<?php
// 파일이 존재한다면 설치할 수 없다.
$dbconfig_file = $data_path . '/' . G5_DBCONFIG_FILE;
if (file_exists($dbconfig_file)) {
?>
<h1><?php echo G5_VERSION; ?> 프로그램이 이미 설치되어 있습니다.</h1>
2022-09-17 20:50:50 +09:00
2024-09-19 20:48:52 +09:00
<div class="ins_inner">
<p>프로그램이 이미 설치되어 있습니다.<br />새로 설치하시려면 다음 파일을 삭제 하신 새로고침 하십시오.</p>
<ul>
2022-09-17 20:50:50 +09:00
<li><?php echo $dbconfig_file ?></li>
2024-09-19 20:48:52 +09:00
</ul>
</div>
<?php
2022-09-17 20:50:50 +09:00
exit;
2024-09-19 20:48:52 +09:00
}
?>
2022-09-17 20:50:50 +09:00
2024-09-19 20:48:52 +09:00
<?php
$exists_data_dir = true;
// data 디렉토리가 있는가?
if (!is_dir($data_path)) {
?>
<h1><?php echo G5_VERSION; ?> 설치를 위해 아래 내용을 확인해 주십시오.</h1>
2022-09-17 20:50:50 +09:00
2024-09-19 20:48:52 +09:00
<div class="ins_inner">
<p>
2022-09-17 20:50:50 +09:00
루트 디렉토리에 아래로 <?php echo G5_DATA_DIR ?> 디렉토리를 생성하여 주십시오.<br />
(common.php 파일이 있는곳이 루트 디렉토리 입니다.)<br /><br />
$> mkdir <?php echo G5_DATA_DIR ?><br /><br />
윈도우의 경우 data 폴더를 하나 생성해 주시기 바랍니다.<br /><br />
명령 실행후 브라우저를 새로고침 하십시오.
2024-09-19 20:48:52 +09:00
</p>
</div>
<?php
2022-09-17 20:50:50 +09:00
$exists_data_dir = false;
2024-09-19 20:48:52 +09:00
}
?>
2022-09-17 20:50:50 +09:00
2024-09-19 20:48:52 +09:00
<?php
$write_data_dir = true;
// data 디렉토리에 파일 생성 가능한지 검사.
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
2022-09-17 20:50:50 +09:00
$sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cgi') {
2024-09-19 20:48:52 +09:00
if (!(is_readable($data_path) && is_executable($data_path))) {
2022-09-17 20:50:50 +09:00
?>
<div class="ins_inner">
2024-09-19 20:48:52 +09:00
<p>
<?php echo G5_DATA_DIR ?> 디렉토리의 퍼미션을 705로 변경하여 주십시오.<br /><br />
$> chmod 705 <?php echo G5_DATA_DIR ?> 또는 chmod uo+rx <?php echo G5_DATA_DIR ?><br /><br />
명령 실행후 브라우저를 새로고침 하십시오.
</p>
2022-09-17 20:50:50 +09:00
</div>
<?php
2024-09-19 20:48:52 +09:00
$write_data_dir = false;
}
2022-09-17 20:50:50 +09:00
} else {
2024-09-19 20:48:52 +09:00
if (!(is_readable($data_path) && is_writeable($data_path) && is_executable($data_path))) {
2022-09-17 20:50:50 +09:00
?>
<div class="ins_inner">
2024-09-19 20:48:52 +09:00
<p>
<?php echo G5_DATA_DIR ?> 디렉토리의 퍼미션을 707로 변경하여 주십시오.<br /><br />
$> chmod 707 <?php echo G5_DATA_DIR ?> 또는 chmod uo+rwx <?php echo G5_DATA_DIR ?><br /><br />
명령 실행후 브라우저를 새로고침 하십시오.
</p>
2022-09-17 20:50:50 +09:00
</div>
<?php
2024-09-19 20:48:52 +09:00
$write_data_dir = false;
}
2022-09-17 20:50:50 +09:00
}
2024-09-19 20:48:52 +09:00
}
?>