mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 14:52:24 +09:00
english comments added
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0_english@8278 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
693e215bc1
commit
4d272994dd
219 changed files with 6407 additions and 8705 deletions
|
|
@ -2,58 +2,50 @@
|
|||
/**
|
||||
* @class installController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief install module의 Controller class
|
||||
* @brief install module of the Controller class
|
||||
**/
|
||||
|
||||
class installController extends install {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
// 설치가 되어 있으면 오류
|
||||
// Error occurs if already installed
|
||||
if(Context::isInstalled()) {
|
||||
return new Object(-1, 'msg_already_installed');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 입력받은 정보로 설치를 함
|
||||
* @brief Install with received information
|
||||
**/
|
||||
function procInstall() {
|
||||
// 설치가 되어 있는지에 대한 체크
|
||||
// Check if it is already installed
|
||||
if(Context::isInstalled()) return new Object(-1, 'msg_already_installed');
|
||||
|
||||
// 설치시 임시로 최고관리자로 지정
|
||||
// Assign a temporary administrator when installing
|
||||
$logged_info->is_admin = 'Y';
|
||||
$_SESSION['logged_info'] = $logged_info;
|
||||
Context::set('logged_info', $logged_info);
|
||||
|
||||
// DB와 관련된 변수를 받음
|
||||
// Get DB-related variables
|
||||
$db_info = Context::gets('db_type','db_port','db_hostname','db_userid','db_password','db_database','db_table_prefix','time_zone','use_rewrite');
|
||||
if($db_info->use_rewrite!='Y') $db_info->use_rewrite = 'N';
|
||||
if(!$db_info->default_url) $db_info->default_url = Context::getRequestUri();
|
||||
$db_info->lang_type = Context::getLangType();
|
||||
|
||||
// DB의 타입과 정보를 등록
|
||||
// Set DB type and information
|
||||
Context::setDBInfo($db_info);
|
||||
|
||||
// DB Instance 생성
|
||||
// Create DB Instance
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// DB접속이 가능한지 체크
|
||||
// Check if available to connect to the DB
|
||||
$output = $oDB->getError();
|
||||
if(!$oDB->isConnected()) return $oDB->getError();
|
||||
|
||||
// firebird는 설치시에 트랜젝션을 사용하지 않음
|
||||
// When installing firebire DB, transaction will not be used
|
||||
if($db_info->db_type != "firebird") $oDB->begin();
|
||||
|
||||
// 모든 모듈의 설치
|
||||
// Install all the modules
|
||||
$this->installDownloadedModule();
|
||||
|
||||
if($db_info->db_type != "firebird") $oDB->commit();
|
||||
|
||||
// config 파일 생성
|
||||
// Create a config file
|
||||
if(!$this->makeConfigFile()) return new Object(-1, 'msg_install_failed');
|
||||
|
||||
// load script
|
||||
|
|
@ -65,12 +57,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
// 설치 완료 메세지 출력
|
||||
// Display a message that installation is completed
|
||||
$this->setMessage('msg_install_completed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FTP 정보 등록
|
||||
* @brief Set FTP Information
|
||||
**/
|
||||
function procInstallFTP() {
|
||||
if(Context::isInstalled()) return new Object(-1, 'msg_already_installed');
|
||||
|
|
@ -85,8 +77,7 @@
|
|||
$buff .= sprintf("\$ftp_info->%s = '%s';\n", $key, str_replace("'","\\'",$val));
|
||||
}
|
||||
$buff .= "?>";
|
||||
|
||||
// safe_mode 일 경우
|
||||
// If safe_mode
|
||||
if(ini_get('safe_mode')) {
|
||||
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new Object(-1,'msg_safe_mode_ftp_needed');
|
||||
|
||||
|
|
@ -160,40 +151,33 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 인스톨 환경을 체크하여 결과 return
|
||||
* @brief Result returned after checking the installation environment
|
||||
**/
|
||||
function checkInstallEnv() {
|
||||
// 각 필요한 항목 체크
|
||||
// Check each item
|
||||
$checklist = array();
|
||||
|
||||
// 0. php 버전 체크 (5.2.2는 설치 불가)
|
||||
// 0. check your version of php (5.2.2 is not supported)
|
||||
if(phpversion()=='5.2.2') $checklist['php_version'] = false;
|
||||
else $checklist['php_version'] = true;
|
||||
|
||||
// 1. permission 체크
|
||||
// 1. Check permission
|
||||
if(is_writable('./')||is_writable('./files')) $checklist['permission'] = true;
|
||||
else $checklist['permission'] = false;
|
||||
|
||||
// 2. xml_parser_create함수 유무 체크
|
||||
// 2. Check if xml_parser_create exists
|
||||
if(function_exists('xml_parser_create')) $checklist['xml'] = true;
|
||||
else $checklist['xml'] = false;
|
||||
|
||||
// 3. ini_get(session.auto_start)==1 체크
|
||||
// 3. Check if ini_get (session.auto_start) == 1
|
||||
if(ini_get(session.auto_start)!=1) $checklist['session'] = true;
|
||||
else $checklist['session'] = false;
|
||||
|
||||
// 4. iconv 체크
|
||||
// 4. Check if iconv exists
|
||||
if(function_exists('iconv')) $checklist['iconv'] = true;
|
||||
else $checklist['iconv'] = false;
|
||||
|
||||
// 5. gd 체크 (imagecreatefromgif함수)
|
||||
// 5. Check gd(imagecreatefromgif function)
|
||||
if(function_exists('imagecreatefromgif')) $checklist['gd'] = true;
|
||||
else $checklist['gd'] = false;
|
||||
|
||||
if(!$checklist['php_version'] || !$checklist['permission'] || !$checklist['xml'] || !$checklist['session']) $install_enable = false;
|
||||
else $install_enable = true;
|
||||
|
||||
// 체크 결과를 Context에 저장
|
||||
// Save the checked result to the Context
|
||||
Context::set('checklist', $checklist);
|
||||
Context::set('install_enable', $install_enable);
|
||||
|
||||
|
|
@ -201,8 +185,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief files 및 하위 디렉토리 생성
|
||||
* DB 정보를 바탕으로 실제 install하기 전에 로컬 환경 설저d
|
||||
* @brief Create files and subdirectories
|
||||
* Local evironment setting before installation by using DB information
|
||||
**/
|
||||
function makeDefaultDirectory() {
|
||||
$directory_list = array(
|
||||
|
|
@ -218,17 +202,16 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 모든 모듈의 설치
|
||||
* @brief Install all the modules
|
||||
*
|
||||
* 모든 module의 schemas 디렉토리를 확인하여 schema xml을 이용, 테이블 생성
|
||||
* Create a table by using schema xml file in the shcema directory of each module
|
||||
**/
|
||||
function installDownloadedModule() {
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// 각 모듈의 schemas/*.xml 파일을 모두 찾아서 table 생성
|
||||
// Create a table ny finding schemas/*.xml file in each module
|
||||
$module_list = FileHandler::readDir('./modules/', NULL, false, true);
|
||||
foreach($module_list as $module_path) {
|
||||
// 모듈 이름을 구함
|
||||
// Get module name
|
||||
$tmp_arr = explode('/',$module_path);
|
||||
$module = $tmp_arr[count($tmp_arr)-1];
|
||||
|
||||
|
|
@ -236,15 +219,13 @@
|
|||
if(!$xml_info) continue;
|
||||
$modules[$xml_info->category][] = $module;
|
||||
}
|
||||
|
||||
// module 모듈은 미리 설치
|
||||
// Install "module" module in advance
|
||||
$this->installModule('module','./modules/module');
|
||||
$oModule = &getClass('module');
|
||||
if($oModule->checkUpdate()) $oModule->moduleUpdate();
|
||||
|
||||
// 모듈을 category에 의거 설치 순서를 정함
|
||||
// Determine the order of module installation depending on category
|
||||
$install_step = array('system','content','member');
|
||||
// 나머지 모든 모듈 설치
|
||||
// Install all the remaining modules
|
||||
foreach($install_step as $category) {
|
||||
if(count($modules[$category])) {
|
||||
foreach($modules[$category] as $module) {
|
||||
|
|
@ -257,8 +238,7 @@
|
|||
unset($modules[$category]);
|
||||
}
|
||||
}
|
||||
|
||||
// 나머지 모든 모듈 설치
|
||||
// Install all the remaining modules
|
||||
if(count($modules)) {
|
||||
foreach($modules as $category => $module_list) {
|
||||
if(count($module_list)) {
|
||||
|
|
@ -280,13 +260,12 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 개별 모듈의 설치
|
||||
* @brief Install an each module
|
||||
**/
|
||||
function installModule($module, $module_path) {
|
||||
// db instance생성
|
||||
// create db instance
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 해당 모듈의 schemas 디렉토리를 검사하여 schema xml파일이 있으면 생성
|
||||
// Create a table if the schema xml exists in the "schemas" directory of the module
|
||||
$schema_dir = sprintf('%s/schemas/', $module_path);
|
||||
$schema_files = FileHandler::readDir($schema_dir, NULL, false, true);
|
||||
|
||||
|
|
@ -296,8 +275,7 @@
|
|||
if(!$file || substr($file,-4)!='.xml') continue;
|
||||
$output = $oDB->createTableByXmlFile($file);
|
||||
}
|
||||
|
||||
// 테이블 설치후 module instance를 만들고 install() method를 실행
|
||||
// Create a table and module instance and then execute install() method
|
||||
unset($oModule);
|
||||
$oModule = &getClass($module);
|
||||
if(method_exists($oModule, 'moduleInstall')) $oModule->moduleInstall();
|
||||
|
|
@ -306,8 +284,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief config 파일을 생성
|
||||
* 모든 설정이 이상없이 끝난 후에 config파일 생성
|
||||
* @brief Create config file
|
||||
* Create the config file when all settings are completed
|
||||
**/
|
||||
function makeConfigFile() {
|
||||
$config_file = Context::getConfigFile();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue