From cb13f541e8c581a304ce293abde6870f5414d858 Mon Sep 17 00:00:00 2001 From: ngleader Date: Fri, 8 Jul 2011 07:41:15 +0000 Subject: [PATCH] issue 73 Supporting easy install (autoinstall module) for each local(enlish, korean, etc) git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8580 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/autoinstall/autoinstall.admin.controller.php | 10 ++++++---- modules/autoinstall/autoinstall.admin.view.php | 4 ++-- modules/autoinstall/autoinstall.class.php | 4 +--- modules/autoinstall/autoinstall.lib.php | 7 ++++++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/autoinstall/autoinstall.admin.controller.php b/modules/autoinstall/autoinstall.admin.controller.php index 7c61f96b8..2c1f00824 100644 --- a/modules/autoinstall/autoinstall.admin.controller.php +++ b/modules/autoinstall/autoinstall.admin.controller.php @@ -35,7 +35,7 @@ $params["act"] = "getResourceapiUpdate"; $body = XmlGenerater::generate($params); - $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); + $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml"); $xml = new XmlParser(); $xmlDoc = $xml->parse($buff); $this->updateCategory($xmlDoc); @@ -187,7 +187,7 @@ function updateCategory(&$xmlDoc) { - executeQuery("autoinstall.deleteCategory", $args); + executeQuery("autoinstall.deleteCategory"); $oModel =& getModel('autoinstall'); if(!is_array($xmlDoc->response->categorylist->item)) { @@ -199,7 +199,7 @@ $args->category_srl = $item->category_srl->body; $args->parent_srl = $item->parent_srl->body; $args->title = $item->title->body; - executeQuery("autoinstall.insertCategory", $args); + $output = executeQuery("autoinstall.insertCategory", $args); } } @@ -224,7 +224,7 @@ { $oModuleInstaller = new SFTPModuleInstaller($package); } - else if(function_exists(ftp_connect)) + else if(function_exists('ftp_connect')) { $oModuleInstaller = new PHPFTPModuleInstaller($package); } @@ -233,6 +233,8 @@ $oModuleInstaller = new FTPModuleInstaller($package); } + $oModuleInstaller->setServerUrl(_XE_DOWNLOAD_SERVER_); + $oModuleInstaller->setPassword($ftp_password); $output = $oModuleInstaller->uninstall(); if(!$output->toBool()) return $output; diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index 54e0ed7af..cff0defba 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -13,8 +13,8 @@ function init() { $template_path = sprintf("%stpl/",$this->module_path); - Context::set('original_site', $this->original_site); - Context::set('uri', $this->uri); + Context::set('original_site', _XE_LOCATION_SITE_); + Context::set('uri', _XE_DOWNLOAD_SERVER_); $this->setTemplatePath($template_path); $ftp_info = Context::getFTPInfo(); diff --git a/modules/autoinstall/autoinstall.class.php b/modules/autoinstall/autoinstall.class.php index 4d4dbc062..070806026 100644 --- a/modules/autoinstall/autoinstall.class.php +++ b/modules/autoinstall/autoinstall.class.php @@ -22,7 +22,7 @@ function getXmlDoc(&$params) { $body = XmlGenerater::generate($params); - $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); + $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml"); if(!$buff) return; $xml = new XmlParser(); $xmlDoc = $xml->parse($buff); @@ -31,8 +31,6 @@ } class autoinstall extends ModuleObject { - var $uri = "http://download.xpressengine.com/"; - var $original_site = "http://www.xpressengine.com/"; var $tmp_dir = './files/cache/autoinstall/'; /** diff --git a/modules/autoinstall/autoinstall.lib.php b/modules/autoinstall/autoinstall.lib.php index 28c905ffa..958ef1d20 100644 --- a/modules/autoinstall/autoinstall.lib.php +++ b/modules/autoinstall/autoinstall.lib.php @@ -2,7 +2,7 @@ class ModuleInstaller { var $package = null; - var $base_url = 'http://download.xpressengine.com/'; + var $base_url; var $temp_dir = './files/cache/autoinstall/'; var $target_path; var $download_file; @@ -10,6 +10,11 @@ var $download_path; var $ftp_password; + function setServerUrl($url) + { + $this->base_url = $url; + } + function uninstall() { $oModel =& getModel('autoinstall');