|
@@ -13,6 +13,7 @@ define('IS_DEDEAPI', TRUE); |
|
|
define('DEDEADMIN', str_replace("\\", '/', dirname(__FILE__))); |
|
|
define('DEDEADMIN', str_replace("\\", '/', dirname(__FILE__))); |
|
|
require_once(DEDEADMIN.'/../system/common.inc.php'); |
|
|
require_once(DEDEADMIN.'/../system/common.inc.php'); |
|
|
require_once(DEDEINC.'/userlogin.class.php'); |
|
|
require_once(DEDEINC.'/userlogin.class.php'); |
|
|
|
|
|
@set_time_limit(0); |
|
|
AjaxHead(); |
|
|
AjaxHead(); |
|
|
helper('cache'); |
|
|
helper('cache'); |
|
|
$action = isset($action) && in_array($action, array('is_need_check_code', 'has_new_version', 'get_changed_files', 'update_backup', 'get_update_versions', 'update', 'upload_image')) ? $action : ''; |
|
|
$action = isset($action) && in_array($action, array('is_need_check_code', 'has_new_version', 'get_changed_files', 'update_backup', 'get_update_versions', 'update', 'upload_image')) ? $action : ''; |
|
@@ -245,17 +246,21 @@ if ($action === 'is_need_check_code') { |
|
|
RmRecurse($backupVerPath); |
|
|
RmRecurse($backupVerPath); |
|
|
mkdir($backupVerPath); |
|
|
mkdir($backupVerPath); |
|
|
foreach ($fileList as $f) { |
|
|
foreach ($fileList as $f) { |
|
|
|
|
|
$realFile = $backupVerPath.$f->filename; |
|
|
if (!preg_match("/^\//", $f->filename)) { |
|
|
if (!preg_match("/^\//", $f->filename)) { |
|
|
//忽略src之外的目录 |
|
|
//忽略src之外的目录 |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
if (file_exists($realFile)) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
$fileUrl = DEDEBIZCDN.'/update/'.$ver->ver.'/src'.$f->filename; |
|
|
$fileUrl = DEDEBIZCDN.'/update/'.$ver->ver.'/src'.$f->filename; |
|
|
$dhd = new DedeHttpDown(); |
|
|
$dhd = new DedeHttpDown(); |
|
|
$dhd->OpenUrl($fileUrl); |
|
|
$dhd->OpenUrl($fileUrl); |
|
|
$fData = $dhd->GetHtml(); |
|
|
$fData = $dhd->GetHtml(); |
|
|
$dhd->Close(); |
|
|
$dhd->Close(); |
|
|
$f->filename = preg_replace('/^\/admin/', $curDir, $f->filename); |
|
|
$f->filename = preg_replace('/^\/admin/', $curDir, $f->filename); |
|
|
$realFile = $backupVerPath.$f->filename; |
|
|
|
|
|
|
|
|
|
|
|
@mkdir(dirname($realFile), 0777, true); |
|
|
@mkdir(dirname($realFile), 0777, true); |
|
|
file_put_contents($realFile, $fData); |
|
|
file_put_contents($realFile, $fData); |
|
|
} |
|
|
} |
|
|