Compare commits
23 Commits
27
UPDATE.md
Normal file
27
UPDATE.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
## PicHome Home1.1 更新说明
|
||||||
|
|
||||||
|
### 1.去掉原库设置中缩略图转换开关,站点设置增加存储位置设置,存储位置目前支持本地(默认),腾讯云存储
|
||||||
|
|
||||||
|
### 2.本地存储位置图片处理功能开启关闭,将控制普通目录图片类文件缩略图和颜色信息获取,支持GD和imagick两种设置,其中imagick将支持特殊格式图片缩略图获取,包括并不限于ai、psd等格式,具体支持格式可在设置界面内查看
|
||||||
|
|
||||||
|
### 3.本地存储位置视频处理功能开启关闭,将控制普通目录音视频类文件缩略图和信息获取,支持不能直接播放媒体文件转码,目前使用ffmpeg作为支持,具体支持格式可在设置界面内查看
|
||||||
|
|
||||||
|
### 4.本地存储位置文档处理功能开启关闭,将控制普通目录文档类文件缩略图获取,支持文档在线预览(不限于普通目录),目前使用onlyoffice作为支持,具体支持格式可在设置界面内查看
|
||||||
|
|
||||||
|
### 5.腾讯云位置图片处理功能开启关闭,将控制腾讯云存储中普通目录图片类文件缩略图和颜色信息获取,具体支持格式可在设置界面内查看
|
||||||
|
|
||||||
|
### 6.腾讯云位置位置视频处理功能开启关闭,将控制腾讯云存储中普通目录音视频类文件缩略图和信息获取,支持不能直接播放媒体文件转码,具体支持格式可在设置界面内查看
|
||||||
|
|
||||||
|
### 7.腾讯云位置位置文档处理功能开启关闭,将控制腾讯云存储中普通目录文档类文件缩略图,支持文档在线预览(不限于普通目录),具体支持格式可在设置界面内查看
|
||||||
|
|
||||||
|
### 8.修复billfish库导入颜色权重未写入问题
|
||||||
|
|
||||||
|
### 9.修改缩略图处理结构,优化缩略图处理逻辑,并支持billfish中特殊格式详情页高清图
|
||||||
|
|
||||||
|
### 10.库设置中增加腾讯云存储位置库添加
|
||||||
|
|
||||||
|
### 11.优化界面处理,修复已知界面问题
|
||||||
|
|
||||||
|
### 12.优化库删除逻辑
|
||||||
|
|
||||||
|
### 13.其他已知bug修复
|
||||||
28
admin.php
28
admin.php
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
define('IN_ADMIN', TRUE);
|
define('IN_ADMIN', TRUE);
|
||||||
define('NOROBOT', TRUE);
|
define('NOROBOT', TRUE);
|
||||||
define('ADMINSCRIPT', basename(__FILE__));
|
define('ADMINSCRIPT', basename(__FILE__));
|
||||||
define('BASESCRIPT', basename(__FILE__));
|
define('BASESCRIPT', basename(__FILE__));
|
||||||
define('CURSCRIPT', 'admin');
|
define('CURSCRIPT', 'admin');
|
||||||
define('APPTYPEID', 0);
|
define('APPTYPEID', 0);
|
||||||
require __DIR__.'/core/adminstart.php';
|
require __DIR__.'/core/adminstart.php';
|
||||||
@@ -1,395 +1,395 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
if(!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if(!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
function runquery($sql) {
|
function runquery($sql) {
|
||||||
global $_G;
|
global $_G;
|
||||||
$tablepre = $_G['config']['db'][1]['tablepre'];
|
$tablepre = $_G['config']['db'][1]['tablepre'];
|
||||||
$dbcharset = $_G['config']['db'][1]['dbcharset'];
|
$dbcharset = $_G['config']['db'][1]['dbcharset'];
|
||||||
|
|
||||||
$sql = str_replace(array(' dzz_', ' `dzz_',' oaooa_', ' `oaooa_' ), array(' {tablepre}', ' `{tablepre}',' {tablepre}', ' `{tablepre}' ), $sql);
|
$sql = str_replace(array(' dzz_', ' `dzz_',' oaooa_', ' `oaooa_' ), array(' {tablepre}', ' `{tablepre}',' {tablepre}', ' `{tablepre}' ), $sql);
|
||||||
|
|
||||||
$sql = str_replace("\r", "\n", str_replace(array(' {tablepre}', ' `{tablepre}'), array(' '.$tablepre, ' `'.$tablepre), $sql));
|
$sql = str_replace("\r", "\n", str_replace(array(' {tablepre}', ' `{tablepre}'), array(' '.$tablepre, ' `'.$tablepre), $sql));
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
$num = 0;
|
$num = 0;
|
||||||
foreach(explode(";\n", trim($sql)) as $query) {
|
foreach(explode(";\n", trim($sql)) as $query) {
|
||||||
$queries = explode("\n", trim($query));
|
$queries = explode("\n", trim($query));
|
||||||
foreach($queries as $query) {
|
foreach($queries as $query) {
|
||||||
$ret[$num] .= $query[0] == '#' || $query[0].$query[1] == '--' ? '' : $query;
|
$ret[$num] .= $query[0] == '#' || $query[0].$query[1] == '--' ? '' : $query;
|
||||||
}
|
}
|
||||||
$num++;
|
$num++;
|
||||||
}
|
}
|
||||||
unset($sql);
|
unset($sql);
|
||||||
|
|
||||||
foreach($ret as $query) {
|
foreach($ret as $query) {
|
||||||
$query = trim($query);
|
$query = trim($query);
|
||||||
if($query) {
|
if($query) {
|
||||||
|
|
||||||
if(substr($query, 0, 12) == 'CREATE TABLE') {
|
if(substr($query, 0, 12) == 'CREATE TABLE') {
|
||||||
$name = preg_replace("/CREATE TABLE ([a-z0-9_]+) .*/is", "\\1", $query);
|
$name = preg_replace("/CREATE TABLE ([a-z0-9_]+) .*/is", "\\1", $query);
|
||||||
DB::query(createtable($query, $dbcharset));
|
DB::query(createtable($query, $dbcharset));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DB::query($query);
|
DB::query($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createtable($sql, $dbcharset) {
|
function createtable($sql, $dbcharset) {
|
||||||
$type = strtoupper(preg_replace("/^\s*CREATE TABLE\s+.+\s+\(.+?\).*(ENGINE|TYPE)\s*=\s*([a-z]+?).*$/isU", "\\2", $sql));
|
$type = strtoupper(preg_replace("/^\s*CREATE TABLE\s+.+\s+\(.+?\).*(ENGINE|TYPE)\s*=\s*([a-z]+?).*$/isU", "\\2", $sql));
|
||||||
$type = in_array($type, array('MYISAM', 'HEAP')) ? $type : 'MYISAM';
|
$type = in_array($type, array('MYISAM', 'HEAP')) ? $type : 'MYISAM';
|
||||||
return preg_replace("/^\s*(CREATE TABLE\s+.+\s+\(.+?\)).*$/isU", "\\1", $sql).
|
return preg_replace("/^\s*(CREATE TABLE\s+.+\s+\(.+?\)).*$/isU", "\\1", $sql).
|
||||||
( " ENGINE=$type DEFAULT CHARSET=$dbcharset");
|
( " ENGINE=$type DEFAULT CHARSET=$dbcharset");
|
||||||
}
|
}
|
||||||
|
|
||||||
function cron_create($app, $filename='', $name='', $weekday=-1, $day=-1, $hour=-1, $minute=-1) {
|
function cron_create($app, $filename='', $name='', $weekday=-1, $day=-1, $hour=-1, $minute=-1) {
|
||||||
$pluginid = $app['identifier'];
|
$pluginid = $app['identifier'];
|
||||||
$app_path = $app['app_path'];
|
$app_path = $app['app_path'];
|
||||||
if(!ispluginkey($pluginid)) {
|
if(!ispluginkey($pluginid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$dir = DZZ_ROOT.'./'.$app_path.'/'.$pluginid.'/cron';
|
$dir = DZZ_ROOT.'./'.$app_path.'/'.$pluginid.'/cron';
|
||||||
if(!file_exists($dir)) {
|
if(!file_exists($dir)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$crondir = dir($dir);
|
$crondir = dir($dir);
|
||||||
while($filename = $crondir->read()) {
|
while($filename = $crondir->read()) {
|
||||||
if(!in_array($filename, array('.', '..')) && preg_match("/^cron\_[\w\.]+$/", $filename)) {
|
if(!in_array($filename, array('.', '..')) && preg_match("/^cron\_[\w\.]+$/", $filename)) {
|
||||||
$content = file_get_contents($dir.'/'.$filename);
|
$content = file_get_contents($dir.'/'.$filename);
|
||||||
preg_match("/cronname\:(.+?)\n/", $content, $r);$name = trim($r[1]);
|
preg_match("/cronname\:(.+?)\n/", $content, $r);$name = trim($r[1]);
|
||||||
preg_match("/week\:(.+?)\n/", $content, $r);$weekday = trim($r[1]) ? intval($r[1]) : -1;
|
preg_match("/week\:(.+?)\n/", $content, $r);$weekday = trim($r[1]) ? intval($r[1]) : -1;
|
||||||
preg_match("/day\:(.+?)\n/", $content, $r);$day = trim($r[1]) ? intval($r[1]) : -1;
|
preg_match("/day\:(.+?)\n/", $content, $r);$day = trim($r[1]) ? intval($r[1]) : -1;
|
||||||
preg_match("/hour\:(.+?)\n/", $content, $r);$hour = trim($r[1]) ? intval($r[1]) : -1;
|
preg_match("/hour\:(.+?)\n/", $content, $r);$hour = trim($r[1]) ? intval($r[1]) : -1;
|
||||||
preg_match("/minute\:(.+?)\n/", $content, $r);$minute = trim($r[1]) ? trim($r[1]) : 0;
|
preg_match("/minute\:(.+?)\n/", $content, $r);$minute = trim($r[1]) ? trim($r[1]) : 0;
|
||||||
$minutenew = explode(',', $minute);
|
$minutenew = explode(',', $minute);
|
||||||
foreach($minutenew as $key => $val) {
|
foreach($minutenew as $key => $val) {
|
||||||
$minutenew[$key] = $val = intval($val);
|
$minutenew[$key] = $val = intval($val);
|
||||||
if($val < 0 || $var > 59) {
|
if($val < 0 || $var > 59) {
|
||||||
unset($minutenew[$key]);
|
unset($minutenew[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$minutenew = array_slice(array_unique($minutenew), 0, 12);
|
$minutenew = array_slice(array_unique($minutenew), 0, 12);
|
||||||
$minutenew = implode("\t", $minutenew);
|
$minutenew = implode("\t", $minutenew);
|
||||||
$filename = $app_path.':'.$pluginid.':'.$filename;
|
$filename = $app_path.':'.$pluginid.':'.$filename;
|
||||||
$cronid = C::t('cron')->get_cronid_by_filename($filename);
|
$cronid = C::t('cron')->get_cronid_by_filename($filename);
|
||||||
if(!$cronid) {
|
if(!$cronid) {
|
||||||
C::t('cron')->insert(array(
|
C::t('cron')->insert(array(
|
||||||
'available' => 1,
|
'available' => 1,
|
||||||
'type' => 'app',
|
'type' => 'app',
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'filename' => $filename,
|
'filename' => $filename,
|
||||||
'weekday' => $weekday,
|
'weekday' => $weekday,
|
||||||
'day' => $day,
|
'day' => $day,
|
||||||
'hour' => $hour,
|
'hour' => $hour,
|
||||||
'minute' => $minutenew,
|
'minute' => $minutenew,
|
||||||
), true);
|
), true);
|
||||||
} else {
|
} else {
|
||||||
C::t('cron')->update($cronid, array(
|
C::t('cron')->update($cronid, array(
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'weekday' => $weekday,
|
'weekday' => $weekday,
|
||||||
'day' => $day,
|
'day' => $day,
|
||||||
'hour' => $hour,
|
'hour' => $hour,
|
||||||
'minute' => $minutenew,
|
'minute' => $minutenew,
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function cron_delete($app) {
|
function cron_delete($app) {
|
||||||
$pluginid = $app['identifier'];
|
$pluginid = $app['identifier'];
|
||||||
$app_path = $app['app_path'];
|
$app_path = $app['app_path'];
|
||||||
|
|
||||||
if(!ispluginkey($pluginid)) {
|
if(!ispluginkey($pluginid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$dir = DZZ_ROOT.'./'.$app_path.'/'.$pluginid.'/cron';
|
$dir = DZZ_ROOT.'./'.$app_path.'/'.$pluginid.'/cron';
|
||||||
if(!file_exists($dir)) {
|
if(!file_exists($dir)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$crondir = dir($dir);
|
$crondir = dir($dir);
|
||||||
$count = 0;
|
$count = 0;
|
||||||
while($filename = $crondir->read()) {
|
while($filename = $crondir->read()) {
|
||||||
if(!in_array($filename, array('.', '..')) && preg_match("/^cron\_[\w\.]+$/", $filename)) {
|
if(!in_array($filename, array('.', '..')) && preg_match("/^cron\_[\w\.]+$/", $filename)) {
|
||||||
$filename = $app_path.':'.$pluginid.':'.$filename;
|
$filename = $app_path.':'.$pluginid.':'.$filename;
|
||||||
$cronid = C::t('cron')->get_cronid_by_filename($filename);
|
$cronid = C::t('cron')->get_cronid_by_filename($filename);
|
||||||
C::t('cron')->delete($cronid);
|
C::t('cron')->delete($cronid);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $count;
|
return $count;
|
||||||
}
|
}
|
||||||
function isplugindir($dir) {
|
function isplugindir($dir) {
|
||||||
return preg_match("/^[a-z]+[a-z0-9_]*\/$/", $dir);
|
return preg_match("/^[a-z]+[a-z0-9_]*\/$/", $dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ispluginkey($key) {
|
function ispluginkey($key) {
|
||||||
return preg_match("/^[a-z]+[a-z0-9_]*$/i", $key);
|
return preg_match("/^[a-z]+[a-z0-9_]*$/i", $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dir_writeable($dir) {
|
function dir_writeable($dir) {
|
||||||
if(!is_dir($dir)) {
|
if(!is_dir($dir)) {
|
||||||
@mkdir($dir, 0777);
|
@mkdir($dir, 0777);
|
||||||
}
|
}
|
||||||
if(is_dir($dir)) {
|
if(is_dir($dir)) {
|
||||||
if($fp = @fopen("$dir/test.txt", 'w')) {
|
if($fp = @fopen("$dir/test.txt", 'w')) {
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
@unlink("$dir/test.txt");
|
@unlink("$dir/test.txt");
|
||||||
$writeable = 1;
|
$writeable = 1;
|
||||||
} else {
|
} else {
|
||||||
$writeable = 0;
|
$writeable = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $writeable;
|
return $writeable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function exportdata($name, $filename, $data) {
|
function exportdata($name, $filename, $data) {
|
||||||
global $_G;
|
global $_G;
|
||||||
require_once libfile('class/xml');
|
require_once libfile('class/xml');
|
||||||
$root = array(
|
$root = array(
|
||||||
'Title' => $name,
|
'Title' => $name,
|
||||||
'Version' => $_G['setting']['version'],
|
'Version' => $_G['setting']['version'],
|
||||||
'Time' => dgmdate(TIMESTAMP, 'Y-m-d H:i'),
|
'Time' => dgmdate(TIMESTAMP, 'Y-m-d H:i'),
|
||||||
'From' => $_G['setting']['bbname'].' ('.$_G['siteurl'].')',
|
'From' => $_G['setting']['bbname'].' ('.$_G['siteurl'].')',
|
||||||
'Data' => exportarray($data, 1)
|
'Data' => exportarray($data, 1)
|
||||||
);
|
);
|
||||||
$filename = strtolower(str_replace(array('!', ' '), array('', '_'), $name)).'_'.$filename.'.xml';
|
$filename = strtolower(str_replace(array('!', ' '), array('', '_'), $name)).'_'.$filename.'.xml';
|
||||||
$plugin_export = array2xml($root, 1);
|
$plugin_export = array2xml($root, 1);
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||||
dheader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
dheader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||||
dheader('Cache-Control: no-cache, must-revalidate');
|
dheader('Cache-Control: no-cache, must-revalidate');
|
||||||
dheader('Pragma: no-cache');
|
dheader('Pragma: no-cache');
|
||||||
dheader('Content-Encoding: none');
|
dheader('Content-Encoding: none');
|
||||||
dheader('Content-Length: '.strlen($plugin_export));
|
dheader('Content-Length: '.strlen($plugin_export));
|
||||||
dheader('Content-Disposition: attachment; filename='.$filename);
|
dheader('Content-Disposition: attachment; filename='.$filename);
|
||||||
dheader('Content-Type: text/xml');
|
dheader('Content-Type: text/xml');
|
||||||
echo $plugin_export;
|
echo $plugin_export;
|
||||||
define('FOOTERDISABLED' , 1);
|
define('FOOTERDISABLED' , 1);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
function imagetobase64($file){
|
function imagetobase64($file){
|
||||||
$type=getimagesize($file);//取得图片的大小,类型等
|
$type=getimagesize($file);//取得图片的大小,类型等
|
||||||
$fp=fopen($file,"r")or die("Can't open file");
|
$fp=fopen($file,"r")or die("Can't open file");
|
||||||
$file_content=chunk_split(base64_encode(fread($fp,filesize($file))));//base64编码
|
$file_content=chunk_split(base64_encode(fread($fp,filesize($file))));//base64编码
|
||||||
switch($type[2]){//判读图片类型
|
switch($type[2]){//判读图片类型
|
||||||
case 1:$img_type="gif";break;
|
case 1:$img_type="gif";break;
|
||||||
case 2:$img_type="jpg";break;
|
case 2:$img_type="jpg";break;
|
||||||
case 3:$img_type="png";break;
|
case 3:$img_type="png";break;
|
||||||
}
|
}
|
||||||
$img='data:image/'.$img_type.';base64,'.$file_content;//合成图片的base64编码
|
$img='data:image/'.$img_type.';base64,'.$file_content;//合成图片的base64编码
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
return $img;
|
return $img;
|
||||||
}
|
}
|
||||||
function base64toimage($data,$dir='appimg',$target=''){
|
function base64toimage($data,$dir='appimg',$target=''){
|
||||||
global $_G;
|
global $_G;
|
||||||
$dataarr=explode(',',$data);
|
$dataarr=explode(',',$data);
|
||||||
$imgcontent=base64_decode($dataarr[1]);
|
$imgcontent=base64_decode($dataarr[1]);
|
||||||
$imgext=str_replace(array('data:image/',';base64'),'',$dataarr[0]);
|
$imgext=str_replace(array('data:image/',';base64'),'',$dataarr[0]);
|
||||||
if(!$target) {
|
if(!$target) {
|
||||||
$imageext=array('jpg','jpeg','png','gif');
|
$imageext=array('jpg','jpeg','png','gif');
|
||||||
if(!in_array($imgext,$imageext)) $ext='jpg';
|
if(!in_array($imgext,$imageext)) $ext='jpg';
|
||||||
$subdir = $subdir1 = $subdir2 = '';
|
$subdir = $subdir1 = $subdir2 = '';
|
||||||
$subdir1 = date('Ym');
|
$subdir1 = date('Ym');
|
||||||
$subdir2 = date('d');
|
$subdir2 = date('d');
|
||||||
$subdir = $subdir1.'/'.$subdir2.'/';
|
$subdir = $subdir1.'/'.$subdir2.'/';
|
||||||
$target1=$_G['setting']['attachdir'].$dir.'/'.$subdir.''.date('His').''.strtolower(random(16)).'.'.$imgext;
|
$target1=$_G['setting']['attachdir'].$dir.'/'.$subdir.''.date('His').''.strtolower(random(16)).'.'.$imgext;
|
||||||
$target=str_replace($_G['setting']['attachdir'],'',$target1);
|
$target=str_replace($_G['setting']['attachdir'],'',$target1);
|
||||||
}else{
|
}else{
|
||||||
$target1=$_G['setting']['attachdir'].$target;
|
$target1=$_G['setting']['attachdir'].$target;
|
||||||
}
|
}
|
||||||
$targetpath = dirname($target1);
|
$targetpath = dirname($target1);
|
||||||
dmkdir($targetpath);
|
dmkdir($targetpath);
|
||||||
if(file_put_contents($target1, $imgcontent)){
|
if(file_put_contents($target1, $imgcontent)){
|
||||||
if(@filesize($target1)<200) {
|
if(@filesize($target1)<200) {
|
||||||
@unlink($target1);
|
@unlink($target1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $target;
|
return $target;
|
||||||
}else return false;
|
}else return false;
|
||||||
}
|
}
|
||||||
function importByarray($arr,$force=0){
|
function importByarray($arr,$force=0){
|
||||||
$app=$arr['app'];
|
$app=$arr['app'];
|
||||||
//判断应用是否已经存在
|
//判断应用是否已经存在
|
||||||
$oapp=DB::fetch_first("select * from %t where identifier=%s and app_path=%s ",array('app_market', $app['identifier'],$app['app_path']));
|
$oapp=DB::fetch_first("select * from %t where identifier=%s and app_path=%s ",array('app_market', $app['identifier'],$app['app_path']));
|
||||||
if(!$force && $oapp){
|
if(!$force && $oapp){
|
||||||
showmessage('application_been');
|
showmessage('application_been');
|
||||||
}
|
}
|
||||||
|
|
||||||
//转化应用图标
|
//转化应用图标
|
||||||
if($app['appico']){
|
if($app['appico']){
|
||||||
$app['appico']=base64toimage($app['appico'],'appico');
|
$app['appico']=base64toimage($app['appico'],'appico');
|
||||||
}
|
}
|
||||||
|
|
||||||
$app['extra']=serialize($app['extra']);
|
$app['extra']=serialize($app['extra']);
|
||||||
|
|
||||||
if($oapp){
|
if($oapp){
|
||||||
$appid=$oapp['appid'];
|
$appid=$oapp['appid'];
|
||||||
C::t('app_market')->update($appid,$app);
|
C::t('app_market')->update($appid,$app);
|
||||||
}else{
|
}else{
|
||||||
$app['available']=0;
|
$app['available']=0;
|
||||||
$appid=$app['appid']=C::t('app_market')->insert($app,1);
|
$appid=$app['appid']=C::t('app_market')->insert($app,1);
|
||||||
}
|
}
|
||||||
if($arr['hooks']){//初始化钩子
|
if($arr['hooks']){//初始化钩子
|
||||||
C::t('hooks')->insert_by_appid($appid,$arr['hooks'],$arr['_attributes']['hooks']);
|
C::t('hooks')->insert_by_appid($appid,$arr['hooks'],$arr['_attributes']['hooks']);
|
||||||
}
|
}
|
||||||
if($appid){
|
if($appid){
|
||||||
C::t('app_open')->insert_by_exts($appid,($app['fileext']?explode(',',$app['fileext']):array()));
|
C::t('app_open')->insert_by_exts($appid,($app['fileext']?explode(',',$app['fileext']):array()));
|
||||||
C::t('app_tag')->addtags(($app['tag']?explode(',',$app['tag']):array()),$appid);
|
C::t('app_tag')->addtags(($app['tag']?explode(',',$app['tag']):array()),$appid);
|
||||||
}
|
}
|
||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
function upgradeinformation($status = 0) {
|
function upgradeinformation($status = 0) {
|
||||||
global $_G, $upgrade_step;
|
global $_G, $upgrade_step;
|
||||||
|
|
||||||
if(empty($upgrade_step)) {
|
if(empty($upgrade_step)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if($status==1 && $upgrade_step['step']==2) return '';
|
if($status==1 && $upgrade_step['step']==2) return '';
|
||||||
$update = array();
|
$update = array();
|
||||||
$siteuniqueid = C::t('setting')->fetch('siteuniqueid');
|
$mcode = C::t('setting')->fetch('machinecode');
|
||||||
$update['siteurl']=$_G['siteurl'];
|
$update['siteurl']=$_G['siteurl'];
|
||||||
$update['sitename']=$_G['setting']['sitename'];
|
$update['sitename']=$_G['setting']['sitename'];
|
||||||
$update['uniqueid'] = $siteuniqueid;
|
$update['mcode'] = $mcode;
|
||||||
$update['curversion'] = $upgrade_step['curversion'];
|
$update['curversion'] = $upgrade_step['curversion'];
|
||||||
$update['currelease'] = $upgrade_step['currelease'];
|
$update['currelease'] = $upgrade_step['currelease'];
|
||||||
$update['upgradeversion'] = $upgrade_step['version'];
|
$update['upgradeversion'] = $upgrade_step['version'];
|
||||||
$update['upgraderelease'] = $upgrade_step['release'];
|
$update['upgraderelease'] = $upgrade_step['release'];
|
||||||
$update['step'] = $upgrade_step['step'] == 'dbupdate' ? 4 : $upgrade_step['step'];
|
$update['step'] = $upgrade_step['step'] == 'dbupdate' ? 4 : $upgrade_step['step'];
|
||||||
$update['status'] = $status;
|
$update['status'] = $status;
|
||||||
$update['version_level'] = CORE_VERSION_LEVEL;
|
$update['version_level'] = CORE_VERSION_LEVEL;
|
||||||
|
|
||||||
$data = '';
|
$data = '';
|
||||||
foreach($update as $key => $value) {
|
foreach($update as $key => $value) {
|
||||||
$data .= $key.'='.rawurlencode($value).'&';
|
$data .= $key.'='.rawurlencode($value).'&';
|
||||||
}
|
}
|
||||||
$upgradeurl = APP_CHECK_URL."market/system/upgrade/".rawurlencode(base64_encode($data))."/".TIMESTAMP;
|
$upgradeurl = APP_CHECK_URL."authlicense/count//upgrade/".rawurlencode(base64_encode($data))."/".TIMESTAMP;
|
||||||
dfsockopen($upgradeurl,0, '', '', FALSE, '',0.2);
|
dfsockopen($upgradeurl,0, '', '', FALSE, '',0.2);
|
||||||
return '';
|
return '';
|
||||||
//return '<img src="'.$upgradeurl.'" width="0" height="0" />';
|
//return '<img src="'.$upgradeurl.'" width="0" height="0" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgradeinformation_app($status = 0) {
|
function upgradeinformation_app($status = 0) {
|
||||||
global $_G, $appinfo;
|
global $_G, $appinfo;
|
||||||
if(empty($appinfo)) {
|
if(empty($appinfo)) {
|
||||||
return '';
|
return '';
|
||||||
}else{
|
}else{
|
||||||
if( isset($appinfo['upgradeinfo']) ){
|
if( isset($appinfo['upgradeinfo']) ){
|
||||||
$lastversion=$appinfo['upgradeinfo']['version'];
|
$lastversion=$appinfo['upgradeinfo']['version'];
|
||||||
$mid=$appinfo['upgradeinfo']['mid'];
|
$mid=$appinfo['upgradeinfo']['mid'];
|
||||||
}else{
|
}else{
|
||||||
$lastversion=$appinfo['version'];
|
$lastversion=$appinfo['version'];
|
||||||
$mid=$appinfo['mid'];
|
$mid=$appinfo['mid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($status==0) return '';
|
if($status==0) return '';
|
||||||
$update = array();
|
$update = array();
|
||||||
$siteuniqueid = C::t('setting')->fetch('siteuniqueid');
|
$siteuniqueid = C::t('setting')->fetch('siteuniqueid');
|
||||||
$update['siteurl']=$_G['siteurl'];
|
$update['siteurl']=$_G['siteurl'];
|
||||||
$update['sitename']=$_G['setting']['sitename'];
|
$update['sitename']=$_G['setting']['sitename'];
|
||||||
$update['uniqueid'] = $siteuniqueid;
|
$update['uniqueid'] = $siteuniqueid;
|
||||||
$update['mid'] = $mid;
|
$update['mid'] = $mid;
|
||||||
$update['curversion'] = $appinfo['version'];
|
$update['curversion'] = $appinfo['version'];
|
||||||
$update['lastversion'] = $lastversion;
|
$update['lastversion'] = $lastversion;
|
||||||
$update['identifier'] = $appinfo['identifier'];
|
$update['identifier'] = $appinfo['identifier'];
|
||||||
$update['lastversion'] = $lastversion;
|
$update['lastversion'] = $lastversion;
|
||||||
$update['status'] = $status;
|
$update['status'] = $status;
|
||||||
$update['version_level'] = CORE_VERSION_LEVEL;
|
$update['version_level'] = CORE_VERSION_LEVEL;
|
||||||
|
|
||||||
$data = '';
|
$data = '';
|
||||||
foreach($update as $key => $value) {
|
foreach($update as $key => $value) {
|
||||||
$data .= $key.'='.rawurlencode($value).'&';
|
$data .= $key.'='.rawurlencode($value).'&';
|
||||||
}
|
}
|
||||||
$upgradeurl=APP_CHECK_URL."market/appinstall/".rawurlencode(base64_encode($data)); //APP_CHECK_URL."index.php?mod=dzzmarket&op=installinfo&data=".rawurlencode(base64_encode($data)).'×tamp='.TIMESTAMP;
|
$upgradeurl=APP_CHECK_URL."market/appinstall/".rawurlencode(base64_encode($data)); //APP_CHECK_URL."index.php?mod=dzzmarket&op=installinfo&data=".rawurlencode(base64_encode($data)).'×tamp='.TIMESTAMP;
|
||||||
dfsockopen($upgradeurl,0, '', '', FALSE, '',0.2);
|
dfsockopen($upgradeurl,0, '', '', FALSE, '',0.2);
|
||||||
return '';
|
return '';
|
||||||
//return '<img src="'.$upgradeurl.'" width="0" height="0" />';
|
//return '<img src="'.$upgradeurl.'" width="0" height="0" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getwheres($intkeys, $strkeys, $randkeys, $likekeys, $pre='') {
|
function getwheres($intkeys, $strkeys, $randkeys, $likekeys, $pre='') {
|
||||||
|
|
||||||
$wherearr = array();
|
$wherearr = array();
|
||||||
$urls = array();
|
$urls = array();
|
||||||
|
|
||||||
foreach ($intkeys as $var) {
|
foreach ($intkeys as $var) {
|
||||||
$value = isset($_GET[$var])?$_GET[$var]:'';
|
$value = isset($_GET[$var])?$_GET[$var]:'';
|
||||||
if(strlen($value)) {
|
if(strlen($value)) {
|
||||||
$urls[] = "$var=$value";
|
$urls[] = "$var=$value";
|
||||||
$var = addslashes($var);
|
$var = addslashes($var);
|
||||||
$wherearr[] = "{$pre}{$var}='".intval($value)."'";
|
$wherearr[] = "{$pre}{$var}='".intval($value)."'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($strkeys as $var) {
|
foreach ($strkeys as $var) {
|
||||||
$value = isset($_GET[$var])?trim($_GET[$var]):'';
|
$value = isset($_GET[$var])?trim($_GET[$var]):'';
|
||||||
if(strlen($value)) {
|
if(strlen($value)) {
|
||||||
$urls[] = "$var=".rawurlencode($value);
|
$urls[] = "$var=".rawurlencode($value);
|
||||||
$var = addslashes($var);
|
$var = addslashes($var);
|
||||||
$value = addslashes($value);
|
$value = addslashes($value);
|
||||||
$wherearr[] = "{$pre}{$var}='$value'";
|
$wherearr[] = "{$pre}{$var}='$value'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($randkeys as $vars) {
|
foreach ($randkeys as $vars) {
|
||||||
$value1 = isset($_GET[$vars[1].'1'])?$vars[0]($_GET[$vars[1].'1']):'';
|
$value1 = isset($_GET[$vars[1].'1'])?$vars[0]($_GET[$vars[1].'1']):'';
|
||||||
$value2 = isset($_GET[$vars[1].'2'])?$vars[0]($_GET[$vars[1].'2']):'';
|
$value2 = isset($_GET[$vars[1].'2'])?$vars[0]($_GET[$vars[1].'2']):'';
|
||||||
if($value1) {
|
if($value1) {
|
||||||
$urls[] = "{$vars[1]}1=".rawurlencode($_GET[$vars[1].'1']);
|
$urls[] = "{$vars[1]}1=".rawurlencode($_GET[$vars[1].'1']);
|
||||||
$vars[1] = addslashes($vars[1]);
|
$vars[1] = addslashes($vars[1]);
|
||||||
$value1 = addslashes($value1);
|
$value1 = addslashes($value1);
|
||||||
$wherearr[] = "{$pre}{$vars[1]}>='$value1'";
|
$wherearr[] = "{$pre}{$vars[1]}>='$value1'";
|
||||||
}
|
}
|
||||||
if($value2) {
|
if($value2) {
|
||||||
$wherearr[] = "{$pre}{$vars[1]}<='$value2'";
|
$wherearr[] = "{$pre}{$vars[1]}<='$value2'";
|
||||||
$vars[2] = addslashes($vars[2]);
|
$vars[2] = addslashes($vars[2]);
|
||||||
$value2 = addslashes($value2);
|
$value2 = addslashes($value2);
|
||||||
$urls[] = "{$vars[1]}2=".rawurlencode($_GET[$vars[1].'2']);
|
$urls[] = "{$vars[1]}2=".rawurlencode($_GET[$vars[1].'2']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($likekeys as $var) {
|
foreach ($likekeys as $var) {
|
||||||
$value = isset($_GET[$var])?stripsearchkey($_GET[$var]):'';
|
$value = isset($_GET[$var])?stripsearchkey($_GET[$var]):'';
|
||||||
if(strlen($value)>1) {
|
if(strlen($value)>1) {
|
||||||
$urls[] = "$var=".rawurlencode($_GET[$var]);
|
$urls[] = "$var=".rawurlencode($_GET[$var]);
|
||||||
$var = addslashes($var);
|
$var = addslashes($var);
|
||||||
$value = addslashes($value);
|
$value = addslashes($value);
|
||||||
$wherearr[] = "{$pre}{$var} LIKE BINARY '%$value%'";
|
$wherearr[] = "{$pre}{$var} LIKE BINARY '%$value%'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('wherearr'=>$wherearr, 'urls'=>$urls);
|
return array('wherearr'=>$wherearr, 'urls'=>$urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getorders($alloworders, $default, $pre='') {
|
function getorders($alloworders, $default, $pre='') {
|
||||||
$orders = array('sql'=>'', 'urls'=>array());
|
$orders = array('sql'=>'', 'urls'=>array());
|
||||||
if(empty($_GET['orderby']) || !in_array($_GET['orderby'], $alloworders)) {
|
if(empty($_GET['orderby']) || !in_array($_GET['orderby'], $alloworders)) {
|
||||||
$_GET['orderby'] = $default;
|
$_GET['orderby'] = $default;
|
||||||
if(empty($_GET['ordersc'])) $_GET['ordersc'] = 'desc';
|
if(empty($_GET['ordersc'])) $_GET['ordersc'] = 'desc';
|
||||||
}
|
}
|
||||||
|
|
||||||
$orders['sql'] = " ORDER BY {$pre}$_GET[orderby] ";
|
$orders['sql'] = " ORDER BY {$pre}$_GET[orderby] ";
|
||||||
$orders['urls'][] = "orderby=$_GET[orderby]";
|
$orders['urls'][] = "orderby=$_GET[orderby]";
|
||||||
|
|
||||||
if(!empty($_GET['ordersc']) && $_GET['ordersc'] == 'desc') {
|
if(!empty($_GET['ordersc']) && $_GET['ordersc'] == 'desc') {
|
||||||
$orders['urls'][] = 'ordersc=desc';
|
$orders['urls'][] = 'ordersc=desc';
|
||||||
$orders['sql'] .= ' DESC ';
|
$orders['sql'] .= ' DESC ';
|
||||||
} else {
|
} else {
|
||||||
$orders['urls'][] = 'ordersc=asc';
|
$orders['urls'][] = 'ordersc=asc';
|
||||||
}
|
}
|
||||||
return $orders;
|
return $orders;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace admin\login\classes;
|
namespace admin\login\classes;
|
||||||
use \core as C;
|
use \core as C;
|
||||||
class Adminlogin{
|
class Adminlogin{
|
||||||
public function run(){
|
public function run(){
|
||||||
$dzz = C::app();
|
$dzz = C::app();
|
||||||
$dzz->init();
|
$dzz->init();
|
||||||
$admincp = new \dzz_admincp();
|
$admincp = new \dzz_admincp();
|
||||||
$admincp->core = $dzz;
|
$admincp->core = $dzz;
|
||||||
$return = $admincp->init();
|
$return = $admincp->init();
|
||||||
if(defined('IS_API') && IS_API && $return === 0){
|
if(defined('IS_API') && IS_API && $return === 0){
|
||||||
exit(json_encode(array('loginstatus'=>0,'hash'=>FORMHASH)));
|
exit(json_encode(array('loginstatus'=>0,'hash'=>FORMHASH)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,130 +1,130 @@
|
|||||||
input:-webkit-autofill {
|
input:-webkit-autofill {
|
||||||
box-shadow: 0 0 0px 1000px white inset !important;
|
box-shadow: 0 0 0px 1000px white inset !important;
|
||||||
}
|
}
|
||||||
.mainContainer {
|
.mainContainer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
.loginContainer {
|
.loginContainer {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%
|
width: 100%
|
||||||
}
|
}
|
||||||
.logintips {
|
.logintips {
|
||||||
color: red;
|
color: red;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
width: 350px;
|
width: 350px;
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border: 1px solid #e3e3e3;
|
border: 1px solid #e3e3e3;
|
||||||
-webkit-box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
-webkit-box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
||||||
-moz-box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
-moz-box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
||||||
box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
||||||
}
|
}
|
||||||
#loginform {
|
#loginform {
|
||||||
width: 350px;
|
width: 350px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.login h4 {
|
.login h4 {
|
||||||
height: 35px;
|
height: 35px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.avatarContainer {
|
.avatarContainer {
|
||||||
margin-bottom: 50px;
|
margin-bottom: 50px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.avatarContainer img {
|
.avatarContainer img {
|
||||||
max-width: 128px;
|
max-width: 128px;
|
||||||
max-height: 128px;
|
max-height: 128px;
|
||||||
}
|
}
|
||||||
.avatarContainer .maintitle{
|
.avatarContainer .maintitle{
|
||||||
font-size:20px;
|
font-size:20px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
padding-top:10px;
|
padding-top:10px;
|
||||||
}
|
}
|
||||||
#admin_password_Container {
|
#admin_password_Container {
|
||||||
padding: 30px 0 30px 0;
|
padding: 30px 0 30px 0;
|
||||||
}
|
}
|
||||||
#admin_password_Container .input-black {
|
#admin_password_Container .input-black {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.loginformContainer {
|
.loginformContainer {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: #FFF;
|
background-color: #FFF;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border: 1px solid #e3e3e3;
|
border: 1px solid #e3e3e3;
|
||||||
-webkit-box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
-webkit-box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
||||||
-moz-box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
-moz-box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
||||||
box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
box-shadow: 0 5px 15px RGBA(0,0,0,.3);
|
||||||
}
|
}
|
||||||
.loginformContainer .username {
|
.loginformContainer .username {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 10px 0 0;
|
margin: 10px 0 0;
|
||||||
min-height: 1em;
|
min-height: 1em;
|
||||||
}
|
}
|
||||||
.loginformContainer .email {
|
.loginformContainer .email {
|
||||||
color: #404040;
|
color: #404040;
|
||||||
line-height: 2;
|
line-height: 2;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
input[type="password"], input[type="text"] {
|
input[type="password"], input[type="text"] {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
outline: none;
|
outline: none;
|
||||||
width: 286px\0;
|
width: 286px\0;
|
||||||
*width:286px;
|
*width:286px;
|
||||||
}
|
}
|
||||||
input[type="submit"] {
|
input[type="submit"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
width: 286px\0;
|
width: 286px\0;
|
||||||
*width:286px;
|
*width:286px;
|
||||||
}
|
}
|
||||||
input[type="password"]:focus, input[type="text"]:focus {
|
input[type="password"]:focus, input[type="text"]:focus {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
.footer .copyright {
|
.footer .copyright {
|
||||||
border: medium none;
|
border: medium none;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
position: static;
|
position: static;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.copyright {
|
.copyright {
|
||||||
color: #899;
|
color: #899;
|
||||||
font-family: "微软雅黑";
|
font-family: "微软雅黑";
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
left: 5px;
|
left: 5px;
|
||||||
line-height: 150%;
|
line-height: 150%;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
.copyright a {
|
.copyright a {
|
||||||
color: #899;
|
color: #899;
|
||||||
}
|
}
|
||||||
.wrapper-placeholder {
|
.wrapper-placeholder {
|
||||||
text-align: left
|
text-align: left
|
||||||
}
|
}
|
||||||
.Topcarousel {
|
.Topcarousel {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
line-height: 100px;
|
line-height: 100px;
|
||||||
font-size: 45px;
|
font-size: 45px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,170 +1,170 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('IN_OAOOA') ) {
|
if (!defined('IN_OAOOA') ) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
if (!function_exists('ajaxshowheader')) {
|
if (!function_exists('ajaxshowheader')) {
|
||||||
function ajaxshowheader() {
|
function ajaxshowheader() {
|
||||||
global $_G;
|
global $_G;
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
@header("Expires: -1");
|
@header("Expires: -1");
|
||||||
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
|
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
|
||||||
@header("Pragma: no-cache");
|
@header("Pragma: no-cache");
|
||||||
header("Content-type: application/xml");
|
header("Content-type: application/xml");
|
||||||
echo "<?xml version=\"1.0\" encoding=\"" . CHARSET . "\"?>\n<root><![CDATA[";
|
echo "<?xml version=\"1.0\" encoding=\"" . CHARSET . "\"?>\n<root><![CDATA[";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('ajaxshowfooter')) {
|
if (!function_exists('ajaxshowfooter')) {
|
||||||
function ajaxshowfooter() {
|
function ajaxshowfooter() {
|
||||||
echo ']]></root>';
|
echo ']]></root>';
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($admincp->core ->var['inajax']) {
|
if ($admincp->core ->var['inajax']) {
|
||||||
ajaxshowheader();
|
ajaxshowheader();
|
||||||
ajaxshowfooter();
|
ajaxshowfooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($admincp -> cpaccess == -3) {
|
if ($admincp -> cpaccess == -3) {
|
||||||
html_login_header(false);
|
html_login_header(false);
|
||||||
} else {
|
} else {
|
||||||
html_login_header();
|
html_login_header();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($admincp -> cpaccess == -3) {
|
if ($admincp -> cpaccess == -3) {
|
||||||
echo '<p class="logintips">' . lang('login_cp_noaccess') . '</p>';
|
echo '<p class="logintips">' . lang('login_cp_noaccess') . '</p>';
|
||||||
|
|
||||||
} elseif ($admincp -> cpaccess == -1) {
|
} elseif ($admincp -> cpaccess == -1) {
|
||||||
$ltime = $admincp -> sessionlife - (TIMESTAMP - $admincp -> adminsession['dateline']);
|
$ltime = $admincp -> sessionlife - (TIMESTAMP - $admincp -> adminsession['dateline']);
|
||||||
echo '<p class="logintips">' . lang('login_cplock', array('ltime' => $ltime)) . '</p>';
|
echo '<p class="logintips">' . lang('login_cplock', array('ltime' => $ltime)) . '</p>';
|
||||||
|
|
||||||
} elseif ($admincp -> cpaccess == -4) {
|
} elseif ($admincp -> cpaccess == -4) {
|
||||||
$ltime = $admincp -> sessionlife - (TIMESTAMP - $admincp -> adminsession['dateline']);
|
$ltime = $admincp -> sessionlife - (TIMESTAMP - $admincp -> adminsession['dateline']);
|
||||||
echo '<p class="logintips">' . lang('login_user_lock') . '</p>';
|
echo '<p class="logintips">' . lang('login_user_lock') . '</p>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
html_login_form();
|
html_login_form();
|
||||||
}
|
}
|
||||||
|
|
||||||
html_login_footer();
|
html_login_footer();
|
||||||
|
|
||||||
function html_login_header($form = true) {
|
function html_login_header($form = true) {
|
||||||
global $_G;
|
global $_G;
|
||||||
$uid = getglobal('uid');
|
$uid = getglobal('uid');
|
||||||
$charset = CHARSET;
|
$charset = CHARSET;
|
||||||
$lang = &lang();
|
$lang = &lang();
|
||||||
$title = $lang['login_title'];
|
$title = $lang['login_title'];
|
||||||
$tips = $lang['login_tips'];
|
$tips = $lang['login_tips'];
|
||||||
|
|
||||||
echo <<<EOT
|
echo <<<EOT
|
||||||
<!DOCTYPE>
|
<!DOCTYPE>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>$title</title>
|
<title>$title</title>
|
||||||
<base href="{$_G['siteurl']}">
|
<base href="{$_G['siteurl']}">
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=$charset" />
|
<meta http-equiv="Content-Type" content="text/html;charset=$charset" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||||
<link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css" type="text/css" media="all" />
|
||||||
<link rel="stylesheet" href="admin/login/images/adminlogin.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="admin/login/images/adminlogin.css" type="text/css" media="all" />
|
||||||
<link rel="stylesheet" href="static/css/common.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="static/css/common.css" type="text/css" media="all" />
|
||||||
<script type="text/javascript" src="static/js/md5.js"></script>
|
<script type="text/javascript" src="static/js/md5.js"></script>
|
||||||
<script type="text/javascript" src="static/jquery/jquery.min.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/jquery/jquery.min.js?{VERHASH}"></script>
|
||||||
<script type="text/javascript" src="static/js/common.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/js/common.js?{VERHASH}"></script>
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
<script src="static/js/jquery.placeholder.js" type="text/javascript"></script>
|
<script src="static/js/jquery.placeholder.js" type="text/javascript"></script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<meta content="oaooa.com" name="Copyright" />
|
<meta content="oaooa.com" name="Copyright" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
EOT;
|
EOT;
|
||||||
|
|
||||||
if ($form) {
|
if ($form) {
|
||||||
$loginset_img=$_G['setting']['loginset']['img']?$_G['setting']['loginset']['img']:'user/login/images/login.jpg';
|
$loginset_img=$_G['setting']['loginset']['img']?$_G['setting']['loginset']['img']:'user/login/images/login.jpg';
|
||||||
$loginset_bcolor=$_G['setting']['loginset']['bcolor']?$_G['setting']['loginset']['bcolor']:'#76838f';
|
$loginset_bcolor=$_G['setting']['loginset']['bcolor']?$_G['setting']['loginset']['bcolor']:'#76838f';
|
||||||
echo <<<EOT
|
echo <<<EOT
|
||||||
<div id="wrapper_div" style="width: 100%;height:100%; position: absolute; top: 0px; left: 0px; margin: 0px; padding: 0px; overflow: hidden;z-index:0; font-size: 0px; background:$loginset_bcolor;">
|
<div id="wrapper_div" style="width: 100%;height:100%; position: absolute; top: 0px; left: 0px; margin: 0px; padding: 0px; overflow: hidden;z-index:0; font-size: 0px; background:$loginset_bcolor;">
|
||||||
|
|
||||||
<img src="$loginset_img" name="imgbg" id="imgbg" style="right: 0px; bottom: 0px; top: 0px; left: 0px; z-index:1;margin:0;padding:0;overflow:hidden; position: absolute;width:100%;height:100%" height="100%" width="100%">
|
<img src="$loginset_img" name="imgbg" id="imgbg" style="right: 0px; bottom: 0px; top: 0px; left: 0px; z-index:1;margin:0;padding:0;overflow:hidden; position: absolute;width:100%;height:100%" height="100%" width="100%">
|
||||||
</div>
|
</div>
|
||||||
<div class="mainContainer">
|
<div class="mainContainer">
|
||||||
<table class="loginContainer" wide="100%" height="100%">
|
<table class="loginContainer" wide="100%" height="100%">
|
||||||
<tr><td align="center" valign="middle">
|
<tr><td align="center" valign="middle">
|
||||||
EOT;
|
EOT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function html_login_footer($halt = true) {
|
function html_login_footer($halt = true) {
|
||||||
$version = CORE_VERSION;
|
$version = CORE_VERSION;
|
||||||
$release = CORE_RELEASE;
|
$release = CORE_RELEASE;
|
||||||
echo <<<EOT
|
echo <<<EOT
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
EOT;
|
EOT;
|
||||||
$halt && exit();
|
$halt && exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
function html_login_form() {
|
function html_login_form() {
|
||||||
global $_G;
|
global $_G;
|
||||||
$uid = getglobal('uid');
|
$uid = getglobal('uid');
|
||||||
$isguest = !getglobal('uid');
|
$isguest = !getglobal('uid');
|
||||||
$lang1 = lang();
|
$lang1 = lang();
|
||||||
$year=dgmdate(TIMESTAMP,'Y');
|
$year=dgmdate(TIMESTAMP,'Y');
|
||||||
$maintitle=lang('title_admincp');
|
$maintitle=lang('title_admincp');
|
||||||
$loginuser = $isguest ? '<input class="form-control" name="admin_email" type="text" title="" onfocus="if(this.value==\'' . lang('login_email_username') . '\'){this.value=\'\'}" onblur="if(this.value==\'\'){this.value=\'' . lang('login_email_username') . '\'}" autocomplete="off" />' : '<div class="username">' . $_G['member']['username'] . '</div><div class="email">' . $_G['member']['email'] . '</div>';
|
$loginuser = $isguest ? '<input class="form-control" name="admin_email" type="text" title="" onfocus="if(this.value==\'' . lang('login_email_username') . '\'){this.value=\'\'}" onblur="if(this.value==\'\'){this.value=\'' . lang('login_email_username') . '\'}" autocomplete="off" />' : '<div class="username">' . $_G['member']['username'] . '</div><div class="email">' . $_G['member']['email'] . '</div>';
|
||||||
$sid = getglobal('sid');
|
$sid = getglobal('sid');
|
||||||
$avatarstatus=getglobal('avatarstatus','member');
|
$avatarstatus=getglobal('avatarstatus','member');
|
||||||
if(!$uid ){
|
if(!$uid ){
|
||||||
$avastar ='<img src="'.($_G['setting']['sitelogo']?\IO::getFileUri('attach::'.$_G['setting']['sitelogo']):'static/image/common/logo.png').'" />';
|
$avastar ='<img src="data/attachment/sitelogo/sitelogo.png" />';
|
||||||
}else{
|
}else{
|
||||||
$avastar = avatar_block($uid);
|
$avastar = avatar_block($uid);
|
||||||
}
|
}
|
||||||
$avastar.='<div class="maintitle">'.$maintitle.'</div>';
|
$avastar.='<div class="maintitle">'.$maintitle.'</div>';
|
||||||
$extra = BASESCRIPT . '?' . $_SERVER['QUERY_STRING'];
|
$extra = BASESCRIPT . '?' . $_SERVER['QUERY_STRING'];
|
||||||
$forcesecques = '<option value="0">' . ($_G['config']['admincp']['forcesecques'] ? $lang1['forcesecques'] : $lang1['security_question_0']) . '</option>';
|
$forcesecques = '<option value="0">' . ($_G['config']['admincp']['forcesecques'] ? $lang1['forcesecques'] : $lang1['security_question_0']) . '</option>';
|
||||||
echo <<<EOT
|
echo <<<EOT
|
||||||
|
|
||||||
<form method="post" name="login" id="loginform" action="$extra" onsubmit="pwmd5('admin_password')">
|
<form method="post" name="login" id="loginform" action="$extra" onsubmit="pwmd5('admin_password')">
|
||||||
<input type="hidden" name="sid" value="$sid">
|
<input type="hidden" name="sid" value="$sid">
|
||||||
<input type="hidden" name="referer" value="$_GET[referer]">
|
<input type="hidden" name="referer" value="$_GET[referer]">
|
||||||
<div class="loginformContainer">
|
<div class="loginformContainer">
|
||||||
<div class="avatarContainer">$avastar</div>
|
<div class="avatarContainer">$avastar</div>
|
||||||
|
|
||||||
$loginuser
|
$loginuser
|
||||||
<div id="admin_password_Container">
|
<div id="admin_password_Container">
|
||||||
<input name="admin_password" id="admin_password" type="password" class="form-control" value="" autocomplete="off" placeholder="$lang1[password]" />
|
<input name="admin_password" id="admin_password" type="password" class="form-control" value="" autocomplete="off" placeholder="$lang1[password]" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<input name="submit" value="$lang1[login]" type="submit" class="btn btn-primary" />
|
<input name="submit" value="$lang1[login]" type="submit" class="btn btn-primary" />
|
||||||
<div class="copyright">Powered by <a href="https://www.oaooa.com/" target="_blank">oaooa</a> © 2012-$year</div>
|
<div class="copyright">Powered by <a href="https://www.oaooa.com/" target="_blank">oaooa</a> © 2012-$year</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
<script type="text/JavaScript">
|
<script type="text/JavaScript">
|
||||||
jQuery(document).ready(function(e) {
|
jQuery(document).ready(function(e) {
|
||||||
jQuery('#loginform .form-control:first').focus();
|
jQuery('#loginform .form-control:first').focus();
|
||||||
if(jQuery('.ie8,.ie9').length){ //ie8模拟placeholder;
|
if(jQuery('.ie8,.ie9').length){ //ie8模拟placeholder;
|
||||||
jQuery(':input[placeholder]').each(function(){
|
jQuery(':input[placeholder]').each(function(){
|
||||||
jQuery(this).placeholder();
|
jQuery(this).placeholder();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
EOT;
|
EOT;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Created by PhpStorm.
|
* Created by PhpStorm.
|
||||||
* User: Administrator
|
* User: Administrator
|
||||||
* Date: 2020/9/7
|
* Date: 2020/9/7
|
||||||
* Time: 16:24
|
* Time: 16:24
|
||||||
*/
|
*/
|
||||||
$return = updatesession();
|
$return = updatesession();
|
||||||
exit(json_encode(array('status'=>$return)));
|
exit(json_encode(array('status'=>$return)));
|
||||||
3454
admin/oaooafiles.md5
3454
admin/oaooafiles.md5
File diff suppressed because it is too large
Load Diff
@@ -1,49 +1,49 @@
|
|||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
function checkAll(type, form, value, checkall, changestyle) {
|
function checkAll(type, form, value, checkall, changestyle) {
|
||||||
var checkall = checkall ? checkall : 'chkall';
|
var checkall = checkall ? checkall : 'chkall';
|
||||||
for(var i = 0; i < form.elements.length; i++) {
|
for(var i = 0; i < form.elements.length; i++) {
|
||||||
var e = form.elements[i];
|
var e = form.elements[i];
|
||||||
if(type == 'option' && e.type == 'radio' && e.value == value && e.disabled != true) {
|
if(type == 'option' && e.type == 'radio' && e.value == value && e.disabled != true) {
|
||||||
e.checked = true;
|
e.checked = true;
|
||||||
} else if(type == 'value' && e.type == 'checkbox' && e.getAttribute('chkvalue') == value) {
|
} else if(type == 'value' && e.type == 'checkbox' && e.getAttribute('chkvalue') == value) {
|
||||||
e.checked = form.elements[checkall].checked;
|
e.checked = form.elements[checkall].checked;
|
||||||
if(changestyle) {
|
if(changestyle) {
|
||||||
multiupdate(e);
|
multiupdate(e);
|
||||||
}
|
}
|
||||||
} else if(type == 'prefix' && e.name && e.name != checkall && (!value || (value && e.name.match(value)))) {
|
} else if(type == 'prefix' && e.name && e.name != checkall && (!value || (value && e.name.match(value)))) {
|
||||||
e.checked = form.elements[checkall].checked;
|
e.checked = form.elements[checkall].checked;
|
||||||
if(changestyle) {
|
if(changestyle) {
|
||||||
if(e.parentNode && e.parentNode.tagName.toLowerCase() == 'li') {
|
if(e.parentNode && e.parentNode.tagName.toLowerCase() == 'li') {
|
||||||
e.parentNode.className = e.checked ? 'checked' : '';
|
e.parentNode.className = e.checked ? 'checked' : '';
|
||||||
}
|
}
|
||||||
if(e.parentNode.parentNode && e.parentNode.parentNode.tagName.toLowerCase() == 'div') {
|
if(e.parentNode.parentNode && e.parentNode.parentNode.tagName.toLowerCase() == 'div') {
|
||||||
e.parentNode.parentNode.className = e.checked ? 'item checked' : 'item';
|
e.parentNode.parentNode.className = e.checked ? 'item checked' : 'item';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function fixTree_organization(el){
|
function fixTree_organization(el){
|
||||||
el.find('.tree-heng1').each(function(){
|
el.find('.tree-heng1').each(function(){
|
||||||
var tr=jQuery(this).parent().parent().parent();
|
var tr=jQuery(this).parent().parent().parent();
|
||||||
var dep=jQuery(this).parent().find('.tree-su').length;
|
var dep=jQuery(this).parent().find('.tree-su').length;
|
||||||
|
|
||||||
tr.nextAll().each(function(){
|
tr.nextAll().each(function(){
|
||||||
var child_org=jQuery(this).find('.child-org');
|
var child_org=jQuery(this).find('.child-org');
|
||||||
var dep1=child_org.find('.tree-su').length;
|
var dep1=child_org.find('.tree-su').length;
|
||||||
if(dep1<=dep) return false;
|
if(dep1<=dep) return false;
|
||||||
else{
|
else{
|
||||||
child_org.find('.tree-su').eq(dep).removeClass('tree-su');
|
child_org.find('.tree-su').eq(dep).removeClass('tree-su');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,184 +1,184 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!defined('IN_OAOOA')) {
|
if(!defined('IN_OAOOA')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
global $_G;
|
global $_G;
|
||||||
Hook::listen('adminlogin');
|
Hook::listen('adminlogin');
|
||||||
$uid = $_G['uid'];
|
$uid = $_G['uid'];
|
||||||
include libfile('function/filerouterule');
|
include libfile('function/filerouterule');
|
||||||
require libfile('function/code');
|
require libfile('function/code');
|
||||||
$operation = $_GET['operation'] ? trim($_GET['operation']) : '';
|
$operation = $_GET['operation'] ? trim($_GET['operation']) : '';
|
||||||
if($operation == 'getApp'){//获取当前用户应用
|
if($operation == 'getApp'){//获取当前用户应用
|
||||||
$config = array();
|
$config = array();
|
||||||
if($_G['uid']){
|
if($_G['uid']){
|
||||||
$config= dzz_userconfig_init();
|
$config= dzz_userconfig_init();
|
||||||
if(!$config){
|
if(!$config){
|
||||||
//$config= dzz_userconfig_init();
|
//$config= dzz_userconfig_init();
|
||||||
if($config['applist']){
|
if($config['applist']){
|
||||||
$applist=explode(',',$config['applist']);
|
$applist=explode(',',$config['applist']);
|
||||||
}else{
|
}else{
|
||||||
$applist=array();
|
$applist=array();
|
||||||
}
|
}
|
||||||
}else{//检测不允许删除的应用,重新添加进去
|
}else{//检测不允许删除的应用,重新添加进去
|
||||||
if($config['applist']){
|
if($config['applist']){
|
||||||
$applist=explode(',',$config['applist']);
|
$applist=explode(',',$config['applist']);
|
||||||
}else{
|
}else{
|
||||||
$applist=array();
|
$applist=array();
|
||||||
}
|
}
|
||||||
if($applist_n =array_keys(C::t('app_market')->fetch_all_by_notdelete($_G['uid']))) {
|
if($applist_n =array_keys(C::t('app_market')->fetch_all_by_notdelete($_G['uid']))) {
|
||||||
|
|
||||||
$newappids = array();
|
$newappids = array();
|
||||||
foreach ($applist_n as $appid) {
|
foreach ($applist_n as $appid) {
|
||||||
if (!in_array($appid, $applist)) {
|
if (!in_array($appid, $applist)) {
|
||||||
$applist[] = $appid;
|
$applist[] = $appid;
|
||||||
$newappids[] = $appid;
|
$newappids[] = $appid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($newappids) C::t('app_user')->insert_by_uid($_G['uid'], $newappids);
|
if ($newappids) C::t('app_user')->insert_by_uid($_G['uid'], $newappids);
|
||||||
C::t('user_field')->update($_G['uid'], array('applist' => implode(',', $applist)));
|
C::t('user_field')->update($_G['uid'], array('applist' => implode(',', $applist)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$applist =array_keys(C::t('app_market')->fetch_all_by_default());
|
$applist =array_keys(C::t('app_market')->fetch_all_by_default());
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取已安装应用
|
//获取已安装应用
|
||||||
$app=C::t('app_market')->fetch_all_by_appid($applist);
|
$app=C::t('app_market')->fetch_all_by_appid($applist);
|
||||||
|
|
||||||
$applist_1=array();
|
$applist_1=array();
|
||||||
$applist_2=array();
|
$applist_2=array();
|
||||||
$identifier=array('imageTool','picture');
|
$identifier=array('imageTool','picture');
|
||||||
foreach($app as $key => $value){
|
foreach($app as $key => $value){
|
||||||
if($value['isshow']<1) continue;
|
if($value['isshow']<1) continue;
|
||||||
if($value['available']<1) continue;
|
if($value['available']<1) continue;
|
||||||
if($value['position']<1) continue;//位置为无的忽略
|
if($value['position']<1) continue;//位置为无的忽略
|
||||||
//判断管理员应用
|
//判断管理员应用
|
||||||
if($_G['adminid']!=1 && $value['group']==3){
|
if($_G['adminid']!=1 && $value['group']==3){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$params=array('name'=>$value['identifier'],'perm'=>1,'return_type'=>'bool');
|
$params=array('name'=>$value['identifier'],'perm'=>1,'return_type'=>'bool');
|
||||||
if(Hook::listen('rolecheck',$params,null,true)===false) continue;
|
if(Hook::listen('rolecheck',$params,null,true)===false) continue;
|
||||||
//if($value['system'] == 2) continue;
|
//if($value['system'] == 2) continue;
|
||||||
if(in_array($value['identifier'], $identifier)){
|
if(in_array($value['identifier'], $identifier)){
|
||||||
$applist_1[] = $value;
|
$applist_1[] = $value;
|
||||||
}else{
|
}else{
|
||||||
$applist_2[] = $value;
|
$applist_2[] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//获取虚拟应用
|
//获取虚拟应用
|
||||||
$params=array();
|
$params=array();
|
||||||
$vapps=Hook::listen('vapplist',$params,null,true);
|
$vapps=Hook::listen('vapplist',$params,null,true);
|
||||||
foreach($vapps as $key => $value){
|
foreach($vapps as $key => $value){
|
||||||
$params=array('name'=>'vapp/'.$value['identifier'],'perm'=>1,'return_type'=>'bool');
|
$params=array('name'=>'vapp/'.$value['identifier'],'perm'=>1,'return_type'=>'bool');
|
||||||
if(Hook::listen('rolecheck',$params,null,true)===false) continue;
|
if(Hook::listen('rolecheck',$params,null,true)===false) continue;
|
||||||
$applist_1[] = $value;
|
$applist_1[] = $value;
|
||||||
}
|
}
|
||||||
//对应用根据disp 排序
|
//对应用根据disp 排序
|
||||||
if($applist_1){
|
if($applist_1){
|
||||||
$sort = array(
|
$sort = array(
|
||||||
'direction' => 'SORT_ASC', //排序顺序标志 SORT_DESC 降序;SORT_ASC 升序
|
'direction' => 'SORT_ASC', //排序顺序标志 SORT_DESC 降序;SORT_ASC 升序
|
||||||
'field' => 'disp', //排序字段
|
'field' => 'disp', //排序字段
|
||||||
);
|
);
|
||||||
$arrSort = array();
|
$arrSort = array();
|
||||||
foreach($applist_1 AS $uniqid => $row){
|
foreach($applist_1 AS $uniqid => $row){
|
||||||
foreach($row AS $key=>$value){
|
foreach($row AS $key=>$value){
|
||||||
$arrSort[$key][$uniqid] = $value;
|
$arrSort[$key][$uniqid] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($sort['direction']){
|
if($sort['direction']){
|
||||||
array_multisort($arrSort[$sort['field']], constant($sort['direction']), $applist_1);
|
array_multisort($arrSort[$sort['field']], constant($sort['direction']), $applist_1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit(json_encode(array('data'=>array_merge($applist_1,$applist_2))));
|
exit(json_encode(array('data'=>array_merge($applist_1,$applist_2))));
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// 地址栏名称
|
// 地址栏名称
|
||||||
$navtitle = $_G['setting']['sitename'];
|
$navtitle = $_G['setting']['sitename'];
|
||||||
// 获取hash
|
// 获取hash
|
||||||
$hash = FORMHASH;
|
$hash = FORMHASH;
|
||||||
|
|
||||||
// 获取当前用户信息
|
// 获取当前用户信息
|
||||||
$userData = array();
|
$userData = array();
|
||||||
$udata = DB::fetch_first("select u.uid,u.avatarstatus,u.username,u.groupid,u.adminid,u.nickname,s.svalue from %t u
|
$udata = DB::fetch_first("select u.uid,u.avatarstatus,u.username,u.groupid,u.adminid,u.nickname,s.svalue from %t u
|
||||||
left join %t s on s.uid = u.uid and s.skey=%swhere u.uid =%d",
|
left join %t s on s.uid = u.uid and s.skey=%swhere u.uid =%d",
|
||||||
array('user','user_setting','headerColor',$uid));
|
array('user','user_setting','headerColor',$uid));
|
||||||
if($udata['avatarstatus'] == 1){
|
if($udata['avatarstatus'] == 1){
|
||||||
$userData['icon'] = 'avatar.php?uid='.$udata['uid'];
|
$userData['icon'] = 'avatar.php?uid='.$udata['uid'].'&random='.VERHASH;
|
||||||
}elseif($udata['svalue']){
|
}elseif($udata['svalue']){
|
||||||
$userData['firstword'] = strtoupper(new_strsubstr($udata['username'],1,''));
|
$userData['firstword'] = strtoupper(new_strsubstr($udata['username'],1,''));
|
||||||
$userData['headerColor'] = $udata['svalue'];
|
$userData['headerColor'] = $udata['svalue'];
|
||||||
$userData['icon'] = false;
|
$userData['icon'] = false;
|
||||||
}else{
|
}else{
|
||||||
$colorkey = rand(1,15);
|
$colorkey = rand(1,15);
|
||||||
$headerColor = $colors[$colorkey];
|
$headerColor = $colors[$colorkey];
|
||||||
C::t('user_setting')->insert_by_skey('headerColor',$headerColor,$udata['uid']);
|
C::t('user_setting')->insert_by_skey('headerColor',$headerColor,$udata['uid']);
|
||||||
$userData['firstword'] = strtoupper(new_strsubstr($udata['username'],1,''));
|
$userData['firstword'] = strtoupper(new_strsubstr($udata['username'],1,''));
|
||||||
$userData['headerColor'] = $udata['svalue'];
|
$userData['headerColor'] = $udata['svalue'];
|
||||||
}
|
}
|
||||||
if( C::t('user')->checkfounder($udata)){
|
if( C::t('user')->checkfounder($udata)){
|
||||||
$userData['perm'] = 3;
|
$userData['perm'] = 3;
|
||||||
}elseif($udata['adminid'] == 1){
|
}elseif($udata['adminid'] == 1){
|
||||||
$userData['perm'] = 2;
|
$userData['perm'] = 2;
|
||||||
}else{
|
}else{
|
||||||
$userData['perm'] = 1;
|
$userData['perm'] = 1;
|
||||||
}
|
}
|
||||||
$userData['username'] = $udata['username'];
|
$userData['username'] = $udata['username'];
|
||||||
$userData['uid'] = $uid;
|
$userData['uid'] = $uid;
|
||||||
$userData['language'] = $_G[language];
|
$userData['language'] = $_G[language];
|
||||||
$userData['upgrade'] = $_G['setting']['upgrade'];
|
$userData['upgrade'] = $_G['setting']['upgrade'];
|
||||||
$userData['version'] = $_G['setting']['version'];
|
$userData['version'] = $_G['setting']['version'];
|
||||||
|
|
||||||
// 获取顶部应用
|
// 获取顶部应用
|
||||||
if($userData['language'] == 'en-US'){
|
if($userData['language'] == 'en-US'){
|
||||||
$navMenuNames = ['System setting','Cloud settings','Orguser','App','Statistics','System Tool'];
|
$navMenuNames = ['System setting','Cloud settings','Orguser','App','Statistics','System Tool'];
|
||||||
}else{
|
}else{
|
||||||
$navMenuNames = ['系统设置','云设置','用户','应用','统计','系统工具'];
|
$navMenuNames = ['系统设置','云设置','用户','应用','统计','系统工具'];
|
||||||
}
|
}
|
||||||
$navMenu = array(
|
$navMenu = array(
|
||||||
array(
|
array(
|
||||||
'name'=>$navMenuNames[0],
|
'name'=>$navMenuNames[0],
|
||||||
'index'=>'setting',
|
'index'=>'setting',
|
||||||
'type'=>'admin'
|
'type'=>'admin'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name'=>$navMenuNames[1],
|
'name'=>$navMenuNames[1],
|
||||||
'index'=>'cloudsetting',
|
'index'=>'cloudsetting',
|
||||||
'type'=>'admin'
|
'type'=>'admin'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name'=>$navMenuNames[2],
|
'name'=>$navMenuNames[2],
|
||||||
'index'=>'orguser',
|
'index'=>'orguser',
|
||||||
'type'=>'admin'
|
'type'=>'admin'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name'=>$navMenuNames[3],
|
'name'=>$navMenuNames[3],
|
||||||
'index'=>'app',
|
'index'=>'app',
|
||||||
'type'=>'admin'
|
'type'=>'admin'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name'=>$navMenuNames[4],
|
'name'=>$navMenuNames[4],
|
||||||
'index'=>'stats',
|
'index'=>'stats',
|
||||||
'type'=>'dzz'
|
'type'=>'dzz'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name'=>$navMenuNames[5],
|
'name'=>$navMenuNames[5],
|
||||||
'index'=>'system',
|
'index'=>'system',
|
||||||
'type'=>'admin'
|
'type'=>'admin'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
// 获取通知
|
// 获取通知
|
||||||
$notice_num=DB::result_first("select COUNT(*) from %t where new>0 and uid=%d",array('notification',$_G['uid']));
|
$notice_num=DB::result_first("select COUNT(*) from %t where new>0 and uid=%d",array('notification',$_G['uid']));
|
||||||
|
|
||||||
exit(json_encode(array('hash'=>$hash,'navMenu'=>$navMenu,'userData'=>$userData,'notice_num'=>$notice_num,'navtitle'=>$navtitle)));
|
exit(json_encode(array('hash'=>$hash,'navMenu'=>$navMenu,'userData'=>$userData,'notice_num'=>$notice_num,'navtitle'=>$navtitle)));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,200 +1,200 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
include_once libfile('function/cache');
|
include_once libfile('function/cache');
|
||||||
|
|
||||||
//error_reporting(E_ALL);
|
//error_reporting(E_ALL);
|
||||||
$op = $_GET['op'];
|
$op = $_GET['op'];
|
||||||
$navtitle = lang('cron') . ' - ' . lang('admin_navtitle');
|
$navtitle = lang('cron') . ' - ' . lang('admin_navtitle');
|
||||||
if (empty($_GET['edit']) && empty($_GET['run'])) {
|
if (empty($_GET['edit']) && empty($_GET['run'])) {
|
||||||
|
|
||||||
if (!submitcheck('cronssubmit')) {
|
if (!submitcheck('cronssubmit')) {
|
||||||
$crons = array();
|
$crons = array();
|
||||||
$query = DB::query("SELECT * FROM " . DB::table('cron') . " ORDER BY type DESC");
|
$query = DB::query("SELECT * FROM " . DB::table('cron') . " ORDER BY type DESC");
|
||||||
while ($cron = DB::fetch($query)) {
|
while ($cron = DB::fetch($query)) {
|
||||||
$disabled = $cron['weekday'] == -1 && $cron['day'] == -1 && $cron['hour'] == -1 && $cron['minute'] == '' ? 'disabled' : '';
|
$disabled = $cron['weekday'] == -1 && $cron['day'] == -1 && $cron['hour'] == -1 && $cron['minute'] == '' ? 'disabled' : '';
|
||||||
|
|
||||||
if ($cron['day'] > 0 && $cron['day'] < 32) {
|
if ($cron['day'] > 0 && $cron['day'] < 32) {
|
||||||
$cron['time'] = lang('monthly') . $cron['day'] . lang('day');
|
$cron['time'] = lang('monthly') . $cron['day'] . lang('day');
|
||||||
} elseif ($cron['weekday'] >= 0 && $cron['weekday'] < 7) {
|
} elseif ($cron['weekday'] >= 0 && $cron['weekday'] < 7) {
|
||||||
$cron['time'] = lang('weekly') . lang('misc_cron_week_day_' . $cron['weekday']);
|
$cron['time'] = lang('weekly') . lang('misc_cron_week_day_' . $cron['weekday']);
|
||||||
} elseif ($cron['hour'] >= 0 && $cron['hour'] < 24) {
|
} elseif ($cron['hour'] >= 0 && $cron['hour'] < 24) {
|
||||||
$cron['time'] = lang('everyday');
|
$cron['time'] = lang('everyday');
|
||||||
} else {
|
} else {
|
||||||
$cron['time'] = lang('per_hour');
|
$cron['time'] = lang('per_hour');
|
||||||
}
|
}
|
||||||
$cron['time'] .= $cron['hour'] >= 0 && $cron['hour'] < 24 ? sprintf('%02d', $cron[hour]) . lang('timeliness') : '';
|
$cron['time'] .= $cron['hour'] >= 0 && $cron['hour'] < 24 ? sprintf('%02d', $cron[hour]) . lang('timeliness') : '';
|
||||||
if (!in_array($cron['minute'], array(-1, ''))) {
|
if (!in_array($cron['minute'], array(-1, ''))) {
|
||||||
foreach ($cron['minute'] = explode("\t", $cron['minute']) as $k => $v) {
|
foreach ($cron['minute'] = explode("\t", $cron['minute']) as $k => $v) {
|
||||||
$cron['minute'][$k] = sprintf('%02d', $v);
|
$cron['minute'][$k] = sprintf('%02d', $v);
|
||||||
}
|
}
|
||||||
$cron['minute'] = implode(',', $cron['minute']);
|
$cron['minute'] = implode(',', $cron['minute']);
|
||||||
$cron['time'] .= $cron['minute'] . lang('point');
|
$cron['time'] .= $cron['minute'] . lang('point');
|
||||||
} else {
|
} else {
|
||||||
$cron['time'] .= '00' . lang('point');
|
$cron['time'] .= '00' . lang('point');
|
||||||
}
|
}
|
||||||
|
|
||||||
$cron['lastrun'] = $cron['lastrun'] ? dgmdate($cron['lastrun'], $_G['setting']['dateformat'] . "<\b\\r />" . $_G['setting']['timeformat']) : '<b>N/A</b>';
|
$cron['lastrun'] = $cron['lastrun'] ? dgmdate($cron['lastrun'], $_G['setting']['dateformat'] . "<\b\\r />" . $_G['setting']['timeformat']) : '<b>N/A</b>';
|
||||||
$cron['nextcolor'] = $cron['nextrun'] && $cron['nextrun'] + $_G['setting']['timeoffset'] * 3600 < TIMESTAMP ? 'style="color: #ff0000"' : '';
|
$cron['nextcolor'] = $cron['nextrun'] && $cron['nextrun'] + $_G['setting']['timeoffset'] * 3600 < TIMESTAMP ? 'style="color: #ff0000"' : '';
|
||||||
$cron['nextrun'] = $cron['nextrun'] ? dgmdate($cron['nextrun'], $_G['setting']['dateformat'] . "<\b\\r />" . $_G['setting']['timeformat']) : '<b>N/A</b>';
|
$cron['nextrun'] = $cron['nextrun'] ? dgmdate($cron['nextrun'], $_G['setting']['dateformat'] . "<\b\\r />" . $_G['setting']['timeformat']) : '<b>N/A</b>';
|
||||||
$cron['run'] = $cron['available'];
|
$cron['run'] = $cron['available'];
|
||||||
|
|
||||||
$crons[] = $cron;
|
$crons[] = $cron;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ($ids = dimplode($_GET['delete'])) {
|
if ($ids = dimplode($_GET['delete'])) {
|
||||||
DB::delete('cron', "cronid IN ($ids) AND type!='system'");
|
DB::delete('cron', "cronid IN ($ids) AND type!='system'");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($_GET['namenew'])) {
|
if (is_array($_GET['namenew'])) {
|
||||||
foreach ($_GET['namenew'] as $id => $name) {
|
foreach ($_GET['namenew'] as $id => $name) {
|
||||||
$newcron = array('name' => dhtmlspecialchars($_GET['namenew'][$id]), 'available' => $_GET['availablenew'][$id]);
|
$newcron = array('name' => dhtmlspecialchars($_GET['namenew'][$id]), 'available' => $_GET['availablenew'][$id]);
|
||||||
if (empty($_GET['availablenew'][$id])) {
|
if (empty($_GET['availablenew'][$id])) {
|
||||||
$newcron['nextrun'] = '0';
|
$newcron['nextrun'] = '0';
|
||||||
}
|
}
|
||||||
DB::update('cron', $newcron, "cronid='{$id}'");
|
DB::update('cron', $newcron, "cronid='{$id}'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newname = trim($_GET['newname'])) {
|
if ($newname = trim($_GET['newname'])) {
|
||||||
DB::insert('cron', array('name' => dhtmlspecialchars($newname), 'type' => 'user', 'available' => '0', 'weekday' => '-1', 'day' => '-1', 'hour' => '-1', 'minute' => '', 'nextrun' => $_G['timestamp'], ));
|
DB::insert('cron', array('name' => dhtmlspecialchars($newname), 'type' => 'user', 'available' => '0', 'weekday' => '-1', 'day' => '-1', 'hour' => '-1', 'minute' => '', 'nextrun' => $_G['timestamp'], ));
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = DB::query("SELECT cronid, filename FROM " . DB::table('cron'));
|
$query = DB::query("SELECT cronid, filename FROM " . DB::table('cron'));
|
||||||
while ($cron = DB::fetch($query)) {
|
while ($cron = DB::fetch($query)) {
|
||||||
$efile = explode(':', $cron['filename']);
|
$efile = explode(':', $cron['filename']);
|
||||||
if (count($efile) > 1) {
|
if (count($efile) > 1) {
|
||||||
$filename = array_pop($efile);
|
$filename = array_pop($efile);
|
||||||
$cronfile = DZZ_ROOT. ''.implode("/",$efile).'/cron/'.$filename;
|
$cronfile = DZZ_ROOT. ''.implode("/",$efile).'/cron/'.$filename;
|
||||||
} else {
|
} else {
|
||||||
$cronfile = DZZ_ROOT . './core/cron/' . $cron['filename'];
|
$cronfile = DZZ_ROOT . './core/cron/' . $cron['filename'];
|
||||||
}
|
}
|
||||||
if (!file_exists($cronfile)) {
|
if (!file_exists($cronfile)) {
|
||||||
DB::update('cron', array('available' => '0', 'nextrun' => '0', ), "cronid='$cron[cronid]'");
|
DB::update('cron', array('available' => '0', 'nextrun' => '0', ), "cronid='$cron[cronid]'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updatecache('setting');
|
updatecache('setting');
|
||||||
$msg = lang('crons_succeed');
|
$msg = lang('crons_succeed');
|
||||||
$redirecturl = BASESCRIPT . '?mod=system&op=cron';
|
$redirecturl = BASESCRIPT . '?mod=system&op=cron';
|
||||||
$msg_type = 'text-success';
|
$msg_type = 'text-success';
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$cronid = empty($_GET['run']) ? $_GET['edit'] : $_GET['run'];
|
$cronid = empty($_GET['run']) ? $_GET['edit'] : $_GET['run'];
|
||||||
$cron = DB::fetch_first("SELECT * FROM " . DB::table('cron') . " WHERE cronid='$cronid'");
|
$cron = DB::fetch_first("SELECT * FROM " . DB::table('cron') . " WHERE cronid='$cronid'");
|
||||||
if (!$cron) {
|
if (!$cron) {
|
||||||
$msg = lang('cron_not_found');
|
$msg = lang('cron_not_found');
|
||||||
$redirecturl = BASESCRIPT . '?mod=system&op=cron';
|
$redirecturl = BASESCRIPT . '?mod=system&op=cron';
|
||||||
$msg_type = 'text-error';
|
$msg_type = 'text-error';
|
||||||
include template('cron');
|
include template('cron');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$cron['filename'] = str_replace(array('..', '/', '\\'), array('', '', ''), $cron['filename']);
|
$cron['filename'] = str_replace(array('..', '/', '\\'), array('', '', ''), $cron['filename']);
|
||||||
$cronminute = str_replace("\t", ',', $cron['minute']);
|
$cronminute = str_replace("\t", ',', $cron['minute']);
|
||||||
$cron['minute'] = explode("\t", $cron['minute']);
|
$cron['minute'] = explode("\t", $cron['minute']);
|
||||||
|
|
||||||
if (!empty($_GET['edit'])) {
|
if (!empty($_GET['edit'])) {
|
||||||
|
|
||||||
if (!submitcheck('editsubmit')) {
|
if (!submitcheck('editsubmit')) {
|
||||||
|
|
||||||
$navtitle = lang('misc_cron_edit') . ' - ' . lang('admin_navtitle');
|
$navtitle = lang('misc_cron_edit') . ' - ' . lang('admin_navtitle');
|
||||||
|
|
||||||
$weekdayselect = $dayselect = $hourselect = '';
|
$weekdayselect = $dayselect = $hourselect = '';
|
||||||
|
|
||||||
for ($i = 0; $i <= 6; $i++) {
|
for ($i = 0; $i <= 6; $i++) {
|
||||||
$weekdayselect .= "<option value=\"$i\" " . ($cron['weekday'] == $i ? 'selected' : '') . ">" . lang('misc_cron_week_day_' . $i) . "</option>";
|
$weekdayselect .= "<option value=\"$i\" " . ($cron['weekday'] == $i ? 'selected' : '') . ">" . lang('misc_cron_week_day_' . $i) . "</option>";
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = 1; $i <= 31; $i++) {
|
for ($i = 1; $i <= 31; $i++) {
|
||||||
$dayselect .= "<option value=\"$i\" " . ($cron['day'] == $i ? 'selected' : '') . ">$i " . lang('day') . "</option>";
|
$dayselect .= "<option value=\"$i\" " . ($cron['day'] == $i ? 'selected' : '') . ">$i " . lang('day') . "</option>";
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = 0; $i <= 23; $i++) {
|
for ($i = 0; $i <= 23; $i++) {
|
||||||
$hourselect .= "<option value=\"$i\" " . ($cron['hour'] == $i ? 'selected' : '') . ">$i " . lang('timeliness') . "</option>";
|
$hourselect .= "<option value=\"$i\" " . ($cron['hour'] == $i ? 'selected' : '') . ">$i " . lang('timeliness') . "</option>";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$daynew = $_GET['weekdaynew'] != -1 ? -1 : $_GET['daynew'];
|
$daynew = $_GET['weekdaynew'] != -1 ? -1 : $_GET['daynew'];
|
||||||
if (strpos($_GET['minutenew'], ',') !== FALSE) {
|
if (strpos($_GET['minutenew'], ',') !== FALSE) {
|
||||||
$minutenew = explode(',', $_GET['minutenew']);
|
$minutenew = explode(',', $_GET['minutenew']);
|
||||||
foreach ($minutenew as $key => $val) {
|
foreach ($minutenew as $key => $val) {
|
||||||
$minutenew[$key] = $val = intval($val);
|
$minutenew[$key] = $val = intval($val);
|
||||||
if ($val < 0 || $var > 59) {
|
if ($val < 0 || $var > 59) {
|
||||||
unset($minutenew[$key]);
|
unset($minutenew[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$minutenew = array_slice(array_unique($minutenew), 0, 12);
|
$minutenew = array_slice(array_unique($minutenew), 0, 12);
|
||||||
$minutenew = implode("\t", $minutenew);
|
$minutenew = implode("\t", $minutenew);
|
||||||
} else {
|
} else {
|
||||||
$minutenew = intval($_GET['minutenew']);
|
$minutenew = intval($_GET['minutenew']);
|
||||||
$minutenew = $minutenew >= 0 && $minutenew < 60 ? $minutenew : '';
|
$minutenew = $minutenew >= 0 && $minutenew < 60 ? $minutenew : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$_GET['filenamenew'] = str_replace(array('..', '/', '\\'), '', $_GET['filenamenew']);
|
$_GET['filenamenew'] = str_replace(array('..', '/', '\\'), '', $_GET['filenamenew']);
|
||||||
$efile = explode(':', $_GET['filenamenew']);
|
$efile = explode(':', $_GET['filenamenew']);
|
||||||
if (count($efile) > 1) {
|
if (count($efile) > 1) {
|
||||||
$filename = array_pop($efile);
|
$filename = array_pop($efile);
|
||||||
$cronfile = DZZ_ROOT. ''.implode("/",$efile).'/cron/'.$filename;
|
$cronfile = DZZ_ROOT. ''.implode("/",$efile).'/cron/'.$filename;
|
||||||
} else {
|
} else {
|
||||||
$cronfile = DZZ_ROOT . './core/cron/' . $cron['filename'];
|
$cronfile = DZZ_ROOT . './core/cron/' . $cron['filename'];
|
||||||
}
|
}
|
||||||
if (preg_match("/[\\\\\/\*\?\"\<\>\|]+/", $_GET['filenamenew'])) {
|
if (preg_match("/[\\\\\/\*\?\"\<\>\|]+/", $_GET['filenamenew'])) {
|
||||||
$msg = lang('crons_filename_illegal');
|
$msg = lang('crons_filename_illegal');
|
||||||
} elseif (!is_readable($cronfile)) {
|
} elseif (!is_readable($cronfile)) {
|
||||||
$msg = lang('crons_filename_invalid', array('cronfile' => $cronfile));
|
$msg = lang('crons_filename_invalid', array('cronfile' => $cronfile));
|
||||||
} elseif ($_GET['weekdaynew'] == -1 && $daynew == -1 && $_GET['hournew'] == -1 && $minutenew === '') {
|
} elseif ($_GET['weekdaynew'] == -1 && $daynew == -1 && $_GET['hournew'] == -1 && $minutenew === '') {
|
||||||
$msg = lang('crons_time_invalid');
|
$msg = lang('crons_time_invalid');
|
||||||
}
|
}
|
||||||
if (!empty($msg)) {
|
if (!empty($msg)) {
|
||||||
$msg_type = 'text-error';
|
$msg_type = 'text-error';
|
||||||
$redirecturl = dreferer();
|
$redirecturl = dreferer();
|
||||||
include template('cron');
|
include template('cron');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::update('cron', array('weekday' => $_GET['weekdaynew'], 'day' => $daynew, 'hour' => $_GET['hournew'], 'minute' => $minutenew, 'filename' => trim($_GET['filenamenew']), ), "cronid='$cronid'");
|
DB::update('cron', array('weekday' => $_GET['weekdaynew'], 'day' => $daynew, 'hour' => $_GET['hournew'], 'minute' => $minutenew, 'filename' => trim($_GET['filenamenew']), ), "cronid='$cronid'");
|
||||||
|
|
||||||
dzz_cron::run($cronid);
|
dzz_cron::run($cronid);
|
||||||
|
|
||||||
$msg = lang('crons_succeed');
|
$msg = lang('crons_succeed');
|
||||||
$msg_type = 'text-success';
|
$msg_type = 'text-success';
|
||||||
$redirecturl = BASESCRIPT . '?mod=system&op=cron';
|
$redirecturl = BASESCRIPT . '?mod=system&op=cron';
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$cron['filename'] = str_replace(array('..', '/', '\\'), '', $cron['filename']);
|
$cron['filename'] = str_replace(array('..', '/', '\\'), '', $cron['filename']);
|
||||||
$efile = explode(':', $cron['filename']);
|
$efile = explode(':', $cron['filename']);
|
||||||
if (count($efile) > 1) {
|
if (count($efile) > 1) {
|
||||||
$filename = array_pop($efile);
|
$filename = array_pop($efile);
|
||||||
$cronfile = DZZ_ROOT. ''.implode("/",$efile).'/cron/'.$filename;
|
$cronfile = DZZ_ROOT. ''.implode("/",$efile).'/cron/'.$filename;
|
||||||
} else {
|
} else {
|
||||||
$cronfile = DZZ_ROOT . './core/cron/' . $cron['filename'];
|
$cronfile = DZZ_ROOT . './core/cron/' . $cron['filename'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($cronfile)) {
|
if (!file_exists($cronfile)) {
|
||||||
$msg = lang('crons_run_invalid', array('cronfile' => $cronfile));
|
$msg = lang('crons_run_invalid', array('cronfile' => $cronfile));
|
||||||
$msg_type = 'text-error';
|
$msg_type = 'text-error';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dzz_cron::run($cron['cronid']);
|
dzz_cron::run($cron['cronid']);
|
||||||
$msg = lang('crons_run_succeed');
|
$msg = lang('crons_run_succeed');
|
||||||
$redirecturl = BASESCRIPT . '?mod=system&op=cron';
|
$redirecturl = BASESCRIPT . '?mod=system&op=cron';
|
||||||
$msg_type = 'text-success';
|
$msg_type = 'text-success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include template('cron');
|
include template('cron');
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
|||||||
.max-width[data-v-6168216d]{width:360px}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
.wait-files[data-v-00939ee2]{line-height:25px;border:1px solid #dcdfe6;margin-bottom:10px;padding:5px;font-size:14px}
|
|
||||||
@@ -1 +1 @@
|
|||||||
.el-avatar[data-v-6f47bc15]{float:left;cursor:pointer}.el-divider--horizontal.el-divider[data-v-6f47bc15]{margin:8px 0}.aboutPichome{padding:0;width:478px}.aboutPichome .el-message-box__btns,.aboutPichome .el-message-box__header{display:none}.aboutPichome .aboutlogo{text-align:center;line-height:0;padding-top:40px}.aboutPichome .aboutmessage{padding:65px 40px;font-size:19px;padding-bottom:15px}.aboutPichome .aboutmessage .aboutlist{margin-bottom:20px;overflow:hidden}.aboutPichome a{text-decoration:none}.aboutPichome .aboutmessage .aboutlist .title{float:left;width:95px}.aboutPichome .aboutmessage .aboutlist .mes{float:left;width:calc(100% - 95px)}.aboutPichome .aboutmessage .aboutlist .update{font-size:12px}
|
.el-avatar[data-v-1aac96c1]{float:left;cursor:pointer}.el-divider--horizontal.el-divider[data-v-1aac96c1]{margin:8px 0}.aboutPichome{padding:0;width:478px}.aboutPichome .el-message-box__btns,.aboutPichome .el-message-box__header{display:none}.aboutPichome .aboutlogo{text-align:center;line-height:0;padding-top:40px}.aboutPichome .aboutmessage{padding:65px 40px;font-size:19px;padding-bottom:15px}.aboutPichome .aboutmessage .aboutlist{margin-bottom:20px;overflow:hidden}.aboutPichome a{text-decoration:none}.aboutPichome .aboutmessage .aboutlist .title{float:left;width:95px}.aboutPichome .aboutmessage .aboutlist .mes{float:left;width:calc(100% - 95px)}.aboutPichome .aboutmessage .aboutlist .update{font-size:12px}
|
||||||
@@ -1 +1 @@
|
|||||||
.el-container[data-v-6b6f1ca9],.el-main[data-v-6b6f1ca9]{height:100%}.el-main[data-v-6b6f1ca9]{padding:0}.top-title .el-steps[data-v-31baf320]{background:transparent;padding:0 25px}.top-title .el-steps[data-v-31baf320] .el-step__icon{vertical-align:middle}.el-progress[data-v-31baf320]{width:400px;display:inline-block}.content[data-v-31baf320]{padding:20px 25px}.help-inline li[data-v-31baf320]{margin-bottom:5px}.top-title .main-title[data-v-da54ce54]{font-size:14px;color:#909399;cursor:pointer;margin-right:20px;vertical-align:bottom}.top-title .main-title.is-active[data-v-da54ce54]{color:#369}.content[data-v-da54ce54]{padding:20px 25px}.systemExportNotify{width:auto}.help-inline li[data-v-174d5b16]{margin-bottom:5px;padding:0}.max-width[data-v-174d5b16]{width:260px}.custom-single[data-v-174d5b16]{height:40px;margin-bottom:5px}.custom-single .el-checkbox[data-v-174d5b16]{overflow:hidden}.custom-single .el-checkbox[data-v-174d5b16] .el-checkbox__input{vertical-align:text-top}.custom-single .el-checkbox[data-v-174d5b16] .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-checkbox[data-v-174d5b16],.el-radio[data-v-174d5b16]{margin-bottom:5px;margin-left:0!important}.el-radio[data-v-174d5b16]{min-width:260px}.max-width[data-v-71031654]{width:50%}.content[data-v-24008314]{padding:20px 25px}.help-inline li[data-v-24008314]{margin-bottom:5px;padding:0}.help-inline[data-v-5e61246c]{display:block}.help-inline li[data-v-5e61246c]{margin-bottom:5px;padding:0}.max-width[data-v-5e61246c]{width:360px}
|
.el-container[data-v-51d41a2c],.el-main[data-v-51d41a2c]{height:100%}.el-main[data-v-51d41a2c]{padding:0}.top-title .el-steps[data-v-31baf320]{background:transparent;padding:0 25px}.top-title .el-steps[data-v-31baf320] .el-step__icon{vertical-align:middle}.el-progress[data-v-31baf320]{width:400px;display:inline-block}.content[data-v-31baf320]{padding:20px 25px}.help-inline li[data-v-31baf320]{margin-bottom:5px}.top-title .main-title[data-v-da54ce54]{font-size:14px;color:#909399;cursor:pointer;margin-right:20px;vertical-align:bottom}.top-title .main-title.is-active[data-v-da54ce54]{color:#369}.content[data-v-da54ce54]{padding:20px 25px}.systemExportNotify{width:auto}.help-inline li[data-v-174d5b16]{margin-bottom:5px;padding:0}.max-width[data-v-174d5b16]{width:260px}.custom-single[data-v-174d5b16]{height:40px;margin-bottom:5px}.custom-single .el-checkbox[data-v-174d5b16]{overflow:hidden}.custom-single .el-checkbox[data-v-174d5b16] .el-checkbox__input{vertical-align:text-top}.custom-single .el-checkbox[data-v-174d5b16] .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-checkbox[data-v-174d5b16],.el-radio[data-v-174d5b16]{margin-bottom:5px;margin-left:0!important}.el-radio[data-v-174d5b16]{min-width:260px}.max-width[data-v-71031654]{width:50%}.content[data-v-24008314]{padding:20px 25px}.help-inline li[data-v-24008314]{margin-bottom:5px;padding:0}.help-inline[data-v-5e61246c]{display:block}.help-inline li[data-v-5e61246c]{margin-bottom:5px;padding:0}.max-width[data-v-5e61246c]{width:360px}
|
||||||
2
admin/system/dist/index.html
vendored
2
admin/system/dist/index.html
vendored
@@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html lang=zh><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><title></title><link href=/admin/system/dist/css/chunk-2b4f90f7.519dec70.css rel=prefetch><link href=/admin/system/dist/css/chunk-494f643e.7502109f.css rel=prefetch><link href=/admin/system/dist/css/chunk-5ae5cc35.d763cbce.css rel=prefetch><link href=/admin/system/dist/css/chunk-5cdcd199.6f46c04d.css rel=prefetch><link href=/admin/system/dist/css/chunk-74c32c70.4b7d665e.css rel=prefetch><link href=/admin/system/dist/css/chunk-76f23146.6fc79cd8.css rel=prefetch><link href=/admin/system/dist/css/chunk-7828662a.c81657ef.css rel=prefetch><link href=/admin/system/dist/css/chunk-9f9c2568.5356ad7d.css rel=prefetch><link href=/admin/system/dist/css/chunk-af3b1b98.b822363f.css rel=prefetch><link href=/admin/system/dist/css/chunk-e730cc06.987283b7.css rel=prefetch><link href=/admin/system/dist/css/system_temp.a56510eb.css rel=prefetch><link href=/admin/system/dist/js/chunk-2b4f90f7.ec4ac270.js rel=prefetch><link href=/admin/system/dist/js/chunk-2d0a3327.ad2684c9.js rel=prefetch><link href=/admin/system/dist/js/chunk-2d0bdbc6.4ec7bc5e.js rel=prefetch><link href=/admin/system/dist/js/chunk-2d0dd46d.0816c17e.js rel=prefetch><link href=/admin/system/dist/js/chunk-2d0efd3c.44a093d1.js rel=prefetch><link href=/admin/system/dist/js/chunk-2d20fcd9.50f81306.js rel=prefetch><link href=/admin/system/dist/js/chunk-2d21ddf7.9f7b329e.js rel=prefetch><link href=/admin/system/dist/js/chunk-494f643e.77a11d42.js rel=prefetch><link href=/admin/system/dist/js/chunk-5ae5cc35.25761a21.js rel=prefetch><link href=/admin/system/dist/js/chunk-5cdcd199.070f9c94.js rel=prefetch><link href=/admin/system/dist/js/chunk-74c32c70.1f5e9382.js rel=prefetch><link href=/admin/system/dist/js/chunk-76f23146.0d2957ed.js rel=prefetch><link href=/admin/system/dist/js/chunk-7828662a.e587f025.js rel=prefetch><link href=/admin/system/dist/js/chunk-9f9c2568.538835dd.js rel=prefetch><link href=/admin/system/dist/js/chunk-af3b1b98.850ec152.js rel=prefetch><link href=/admin/system/dist/js/chunk-e730cc06.3ce9a994.js rel=prefetch><link href=/admin/system/dist/js/system_temp.c7e32270.js rel=prefetch><link href=/admin/system/dist/css/chunk-vendors.4d5d56a8.css rel=preload as=style><link href=/admin/system/dist/css/index.7d0ec6bf.css rel=preload as=style><link href=/admin/system/dist/js/chunk-vendors.3b95dfe3.js rel=preload as=script><link href=/admin/system/dist/js/index.b5ff203c.js rel=preload as=script><link href=/admin/system/dist/css/chunk-vendors.4d5d56a8.css rel=stylesheet><link href=/admin/system/dist/css/index.7d0ec6bf.css rel=stylesheet></head><body><div id=app></div><script src=/admin/system/dist/js/chunk-vendors.3b95dfe3.js></script><script src=/admin/system/dist/js/index.b5ff203c.js></script></body></html>
|
<!DOCTYPE html><html lang=zh><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><title></title><link href=admin/system/dist/css/chunk-2b4f90f7.519dec70.css rel=prefetch><link href=admin/system/dist/css/chunk-494f643e.7502109f.css rel=prefetch><link href=admin/system/dist/css/chunk-5ae5cc35.d763cbce.css rel=prefetch><link href=admin/system/dist/css/chunk-74c32c70.4b7d665e.css rel=prefetch><link href=admin/system/dist/css/chunk-76f23146.6fc79cd8.css rel=prefetch><link href=admin/system/dist/css/chunk-7828662a.c81657ef.css rel=prefetch><link href=admin/system/dist/css/chunk-7aef2525.9e97ae28.css rel=prefetch><link href=admin/system/dist/css/chunk-9f9c2568.5356ad7d.css rel=prefetch><link href=admin/system/dist/css/chunk-af3b1b98.b822363f.css rel=prefetch><link href=admin/system/dist/css/chunk-e730cc06.987283b7.css rel=prefetch><link href=admin/system/dist/css/system_temp.abc9b69c.css rel=prefetch><link href=admin/system/dist/js/chunk-2b4f90f7.45b9151d.js rel=prefetch><link href=admin/system/dist/js/chunk-2d0a3327.ad2684c9.js rel=prefetch><link href=admin/system/dist/js/chunk-2d0bdbc6.4ec7bc5e.js rel=prefetch><link href=admin/system/dist/js/chunk-2d0dd46d.e13ddeba.js rel=prefetch><link href=admin/system/dist/js/chunk-2d0efd3c.44a093d1.js rel=prefetch><link href=admin/system/dist/js/chunk-2d20fcd9.50f81306.js rel=prefetch><link href=admin/system/dist/js/chunk-2d21ddf7.9f7b329e.js rel=prefetch><link href=admin/system/dist/js/chunk-494f643e.77a11d42.js rel=prefetch><link href=admin/system/dist/js/chunk-5ae5cc35.25761a21.js rel=prefetch><link href=admin/system/dist/js/chunk-74c32c70.1f5e9382.js rel=prefetch><link href=admin/system/dist/js/chunk-76f23146.0d2957ed.js rel=prefetch><link href=admin/system/dist/js/chunk-7828662a.e587f025.js rel=prefetch><link href=admin/system/dist/js/chunk-7aef2525.35b8efb8.js rel=prefetch><link href=admin/system/dist/js/chunk-9f9c2568.538835dd.js rel=prefetch><link href=admin/system/dist/js/chunk-af3b1b98.850ec152.js rel=prefetch><link href=admin/system/dist/js/chunk-e730cc06.3ce9a994.js rel=prefetch><link href=admin/system/dist/js/system_temp.b94f1119.js rel=prefetch><link href=admin/system/dist/css/chunk-vendors.4d5d56a8.css rel=preload as=style><link href=admin/system/dist/css/index.7d0ec6bf.css rel=preload as=style><link href=admin/system/dist/js/chunk-vendors.3b95dfe3.js rel=preload as=script><link href=admin/system/dist/js/index.b9edc49b.js rel=preload as=script><link href=admin/system/dist/css/chunk-vendors.4d5d56a8.css rel=stylesheet><link href=admin/system/dist/css/index.7d0ec6bf.css rel=stylesheet></head><body><div id=app></div><script src=admin/system/dist/js/chunk-vendors.3b95dfe3.js></script><script src=admin/system/dist/js/index.b9edc49b.js></script></body></html>
|
||||||
@@ -1 +1 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2b4f90f7"],{3685:function(t,e,a){},ec9e:function(t,e,a){"use strict";var n=a("3685"),i=a.n(n);i.a},fcc8f:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"resNav"},[a("div",{staticClass:"resNav-item resNav-left"},[a("a",{staticClass:"h-left",attrs:{href:"javascript:;"},on:{click:function(e){return t.goBack()}}},[a("el-image",{attrs:{src:"data/attachment/sitelogo/sitelogo.png",fit:"contain"}}),a("span",{staticClass:"text"},[t._v(t._s(t.navTitle))])],1)]),a("div",{staticClass:"resNav-item resNav-center"}),a("div",{staticClass:"resNav-item resNav-right"},[a("Mavatar")],1)])},i=[],c=(a("d3b7"),a("5530")),s=a("2f62"),r={props:["hideContent","apptype","hideBack"],data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(s["c"])(["headerName","navTitle","IfuserAgent"])),Object(s["b"])(["GetNavMenu"])),methods:{handleClick:function(t){var e=this.GetNavMenu;for(var a in e)if(e[a].index==t){"admin"==e[a].type?window.location.href="admin.php?mod="+t:window.location.href="index.php?mod="+t;break}},goBack:function(){window.location.href="/"}},components:{Mavatar:function(){return a.e("chunk-5cdcd199").then(a.bind(null,"6254"))}}},o=r,d=(a("ec9e"),a("2877")),l=Object(d["a"])(o,n,i,!1,null,"b9d2b62e",null);e["default"]=l.exports}}]);
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2b4f90f7"],{3685:function(t,e,a){},ec9e:function(t,e,a){"use strict";var n=a("3685"),i=a.n(n);i.a},fcc8f:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"resNav"},[a("div",{staticClass:"resNav-item resNav-left"},[a("a",{staticClass:"h-left",attrs:{href:"javascript:;"},on:{click:function(e){return t.goBack()}}},[a("el-image",{attrs:{src:"data/attachment/sitelogo/sitelogo.png",fit:"contain"}}),a("span",{staticClass:"text"},[t._v(t._s(t.navTitle))])],1)]),a("div",{staticClass:"resNav-item resNav-center"}),a("div",{staticClass:"resNav-item resNav-right"},[a("Mavatar")],1)])},i=[],c=(a("d3b7"),a("5530")),s=a("2f62"),r={props:["hideContent","apptype","hideBack"],data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(s["c"])(["headerName","navTitle","IfuserAgent"])),Object(s["b"])(["GetNavMenu"])),methods:{handleClick:function(t){var e=this.GetNavMenu;for(var a in e)if(e[a].index==t){"admin"==e[a].type?window.location.href="admin.php?mod="+t:window.location.href="index.php?mod="+t;break}},goBack:function(){window.location.href="/"}},components:{Mavatar:function(){return a.e("chunk-7aef2525").then(a.bind(null,"6254"))}}},o=r,l=(a("ec9e"),a("2877")),d=Object(l["a"])(o,n,i,!1,null,"b9d2b62e",null);e["default"]=d.exports}}]);
|
||||||
@@ -1 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0bdbc6"],{"2ced":function(t,n,e){"use strict";e.r(n);var c=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("el-card",{staticClass:"box-card",staticStyle:{background:"rgb(240, 249, 235)","text-align":"center"},attrs:{shadow:"hover"}},[e("p",[t._v(t._s(t.$t("upgrade_none")))])])},a=[],o={data:function(){return{}},created:function(){},methods:{},components:{},mounted:function(){}},r=o,s=e("2877"),u=Object(s["a"])(r,c,a,!1,null,null,null);n["default"]=u.exports}}]);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0dd46d"],{8164:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[a("el-card",{staticClass:"box-card",staticStyle:{background:"rgb(240, 249, 235)","text-align":"center"},attrs:{shadow:"hover"}},[a("p",{staticStyle:{"margin-bottom":"0"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful1")))])],1),a("p",{staticStyle:{margin:"0"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful2",{msg:e.$route.params.version})))])],1),a("p",{staticStyle:{"margin-bottom":"0"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful3",{dir:e.dir})))])],1),a("p",{staticStyle:{margin:"0"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful4",{backdir:e.backdir})))])],1)])],1)},n=[],r=(a("96cf"),a("1da1")),i={data:function(){return{loading:!1,dir:"",backdir:""}},created:function(){this.getData()},methods:{getData:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var a,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.next=3,e.axios.post("admin.php?mod=system&op=intsystemupgrade&operation=patch&step=5",{version:e.$route.params.version});case 3:a=t.sent,s=a.data,e.dir=s.dir,e.backdir=s.backdir,e.loading=!1;case 8:case"end":return t.stop()}}),t)})))()}},components:{},mounted:function(){}},c=i,d=a("2877"),u=Object(d["a"])(c,s,n,!1,null,"f4790950",null);t["default"]=u.exports}}]);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0dd46d"],{8164:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[a("el-card",{staticClass:"box-card",staticStyle:{background:"rgb(240, 249, 235)","text-align":"center"},attrs:{shadow:"hover"}},[a("p",{staticStyle:{"margin-bottom":"0"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful1")))])],1),a("p",{staticStyle:{margin:"0"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful2",{msg:e.$route.params.version})))])],1),a("p",{staticStyle:{"margin-bottom":"0"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful3",{dir:e.dir})))])],1),a("p",{staticStyle:{margin:"0"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful4",{backdir:e.backdir})))])],1)])],1)},n=[],r=(a("96cf"),a("1da1")),i={data:function(){return{loading:!1,dir:"",backdir:""}},created:function(){this.getData()},methods:{getData:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var a,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.next=3,e.axios.post("admin.php?mod=system&op=intsystemupgrade&operation=patch&step=5",{version:e.$route.params.version});case 3:a=t.sent,s=a.data,e.dir=s.dir,e.backdir=s.backdir,e.loading=!1;case 8:case"end":return t.stop()}}),t)})))()}},components:{},mounted:function(){}},c=i,d=a("2877"),u=Object(d["a"])(c,s,n,!1,null,"306dae10",null);t["default"]=u.exports}}]);
|
|
||||||
1
admin/system/dist/js/chunk-2d0dd46d.e13ddeba.js
vendored
Normal file
1
admin/system/dist/js/chunk-2d0dd46d.e13ddeba.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0dd46d"],{8164:function(e,t,s){"use strict";s.r(t);var n=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[s("el-card",{staticClass:"box-card",staticStyle:{background:"rgb(240, 249, 235)","text-align":"center"},attrs:{shadow:"hover"}},[s("p",{staticStyle:{"margin-bottom":"0"}},[s("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful1")))])],1),s("p",{staticStyle:{margin:"0"}},[s("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.version))])],1),s("p",{staticStyle:{"margin-bottom":"0"}},[s("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful3",{dir:e.dir})))])],1),s("p",{staticStyle:{margin:"0"}},[s("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("upgrade_successful4",{backdir:e.backdir})))])],1)])],1)},a=[],r=(s("96cf"),s("1da1")),i={data:function(){return{loading:!1,version:"",dir:"",backdir:""}},created:function(){this.getData()},methods:{getData:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var s,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.next=3,e.axios.post("admin.php?mod=system&op=intsystemupgrade&operation=patch&step=5&version="+e.$route.params.version);case 3:s=t.sent,n=s.data,e.version=e.$t("upgrade_successful2",{msg:n.version}),e.dir=n.dir,e.backdir=n.backdir,e.loading=!1;case 9:case"end":return t.stop()}}),t)})))()}},components:{},mounted:function(){}},c=i,d=s("2877"),o=Object(d["a"])(c,n,a,!1,null,"321830d5",null);t["default"]=o.exports}}]);
|
||||||
@@ -1 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0efd3c"],{"9a86":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[e.floading?a("div",[e.tableData.length?[a("el-card",{staticClass:"box-card",staticStyle:{background:"rgb(240, 249, 235)","margin-bottom":"25px"},attrs:{shadow:"hover"}},[a("ul",{staticClass:"help-inline",domProps:{innerHTML:e._s(e.$t("founder_upgrade_diff_show",{version:e.returnData.version,oldversion:e.oldversion}))}})]),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:""}},[a("el-table-column",{attrs:{prop:"name",label:"文件名"}}),a("el-table-column",{attrs:{align:"center",prop:"status",label:"状态",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.status?[a("el-link",{attrs:{underline:!1,type:"danger"}},[e._v(e._s(e.$t("founder_upgrade_diff")))])]:2==t.row.status?[a("el-link",{attrs:{underline:!1,type:"info"}},[e._v(e._s(e.$t("founder_upgrade_normal")))])]:3==t.row.status?[a("el-link",{attrs:{underline:!1,type:"primary"}},[e._v(e._s(e.$t("founder_upgrade_new")))])]:e._e()]}}],null,!1,3979069617)})],1),a("div",{staticStyle:{"margin-top":"10px"}},[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.handleupdate}},[e._v(e._s(e.button))])],1)]:[a("el-card",{staticClass:"box-card",staticStyle:{background:"rgb(240, 249, 235)"},attrs:{shadow:"hover"}},[a("el-link",{attrs:{type:"success",underline:!1}},[e._v(e._s(e.$t("filecheck_nofound_md5file")))])],1)]],2):e._e()])},n=[],o=(a("96cf"),a("1da1")),s={props:["returnData"],data:function(){return{loading:!1,floading:!1,tableData:[],button:"",oldversion:""}},created:function(){this.getData()},methods:{getData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r,n,o,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a={version:e.returnData.version?e.returnData.version:"",locale:e.returnData.locale?e.returnData.locale:"",charset:e.returnData.charset?e.returnData.charset:""},t.next=4,e.axios.post("admin.php?mod=system&op=intsystemupgrade&operation=patch&step=3",a);case 4:if(r=t.sent,n=r.data,!n.upgradeNone){t.next=12;break}return o={upgradeNone:!0},e.$emit("handleStep",o),t.abrupt("return",!1);case 12:if(!n.upgradeError){t.next=18;break}return o={upgradeError:!0},e.$emit("handleStep",o),t.abrupt("return",!1);case 18:if(!n.bbclosed){t.next=22;break}return s={template:"bbclosed"},e.$emit("handleStep",s),t.abrupt("return",!1);case 22:e.tableData=n.tableData,e.button=n.button,e.oldversion=n.oldversion,e.loading=!1,e.floading=!0;case 27:case"end":return t.stop()}}),t)})))()},handleupdate:function(){var e={template:4};return this.$emit("handleStep",e),!1}},components:{},mounted:function(){}},l=s,i=a("2877"),u=Object(i["a"])(l,r,n,!1,null,null,null);t["default"]=u.exports}}]);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21ddf7"],{d2c6:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[3==t.downloadstatus?[a("el-card",{staticClass:"box-card",staticStyle:{background:"rgb(240, 249, 235)","text-align":"center"},attrs:{shadow:"hover"}},[a("p",[t._v(t._s(t.$t("upgrade_redownload",{file:t.data.file})))]),a("el-button",{attrs:{type:"primary",size:"medium"},on:{click:t.handleretry}},[t._v(t._s(t.$t("retry")))])],1)]:[a("el-card",{staticClass:"box-card",staticStyle:{width:"600px",margin:"0 auto","margin-top":"50px"}},[a("div",{staticClass:"clearfix",staticStyle:{"text-align":"center"},attrs:{slot:"header"},slot:"header"},[a("span",[t._v(t._s(t.$t("upgrade_downloading_file")))])]),a("p",{staticStyle:{width:"100%",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis","font-size":"14px"}},[4==t.downloadstatus?[t._v(t._s(t.$t("upgrade_download_complete_to_compare")))]:[t._v(t._s(t.data.file))]],2),a("el-progress",{staticStyle:{"margin-bottom":"20px"},attrs:{"text-inside":!0,"stroke-width":26,percentage:t.data.percent}})],1)]],2)},n=[],s=(a("96cf"),a("1da1")),o={props:["returnData"],data:function(){return{stepstatus:!0,downloadstatus:0,data:{file:"",fileseq:1,percent:0}}},created:function(){this.getData()},methods:{getData:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var a,r,n,s,o,d;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.stepstatus){e.next=2;break}return e.abrupt("return",!1);case 2:return a={version:t.returnData.version?t.returnData.version:"",locale:t.returnData.locale?t.returnData.locale:"",charset:t.returnData.charset?t.returnData.charset:"",fileseq:t.data.fileseq},e.next=5,t.axios.post("admin.php?mod=system&op=intsystemupgrade&operation=patch&step=2",a);case 5:if(r=e.sent,n=r.data,!n.upgradeNone){e.next=13;break}return s={upgradeNone:!0},t.$emit("handleStep",s),e.abrupt("return",!1);case 13:if(!n.upgradeError){e.next=19;break}return s={upgradeError:!0},t.$emit("handleStep",s),e.abrupt("return",!1);case 19:if(!n.bbclosed){e.next=23;break}return o={template:"bbclosed"},t.$emit("handleStep",o),e.abrupt("return",!1);case 23:return t.downloadstatus=n.downloadstatus,3==n.downloadstatus?t.data.file=n.data.file:4==n.downloadstatus?(t.data.percent=100,d={template:3},setTimeout((function(){t.$emit("handleStep",d)}),1e3)):(n.data.percent=parseInt(n.data.percent),t.data=n.data,t.getData()),e.abrupt("return",!1);case 26:case"end":return e.stop()}}),e)})))()},handleretry:function(){window.location.reload()}},components:{},mounted:function(){},destroyed:function(){this.stepstatus=!1}},d=o,i=a("2877"),u=Object(i["a"])(d,r,n,!1,null,null,null);e["default"]=u.exports}}]);
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5cdcd199"],{6254:function(t,a,e){"use strict";e.r(a);var o=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticStyle:{"margin-left":"10px",display:"inherit"}},[e("el-dropdown",{staticStyle:{width:"35px",height:"35px"},attrs:{trigger:"click","hide-on-click":!1},on:{command:t.handleAvatar}},[t.GetUserData.icon?[e("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:t.GetUserData.username,placement:"left"}},[e("el-avatar",{attrs:{size:35,src:t.GetUserData.icon}})],1)]:[e("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:t.GetUserData.username,placement:"left"}},[e("el-avatar",{style:{background:t.GetUserData.headerColor},attrs:{size:35}},[t._v(t._s(t.GetUserData.firstword))])],1)],e("el-dropdown-menu",{staticClass:"avatar-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},[e("el-dropdown-item",{attrs:{command:"personal"}},[t._v("个人设置")]),e("el-dropdown-item",{attrs:{command:"help"}},[t._v("帮助文档")]),e("el-dropdown-item",{attrs:{command:"problem"}},[t._v("问题反馈")]),e("el-divider"),e("el-dropdown-item",{attrs:{command:"setting"}},[t._v("站点设置")]),e("el-dropdown-item",{attrs:{command:"library"}},[t._v("库设置")]),e("el-dropdown-item",{attrs:{command:"system"}},[e("span",{staticStyle:{position:"relative"}},[t._v(" 系统工具 "),t.GetUserData.upgrade?e("div",{staticClass:"tip",staticStyle:{width:"7px",height:"7px","border-radius":"50%",background:"red",position:"absolute",left:"-13px",top:"0",bottom:"0",margin:"auto"}}):t._e()])]),e("el-divider"),e("el-dropdown-item",{attrs:{command:"about"}},[t._v("关于PicHome")]),e("el-dropdown-item",{attrs:{command:"OutLogin"}},[t._v("退出站点")])],1)],2)],1)},s=[],n=(e("96cf"),e("1da1")),i=e("5530"),r=e("2f62"),c={data:function(){return{}},computed:Object(i["a"])({},Object(r["b"])(["GetUserData","GetFormHash","GetLanguage"])),methods:{handleAvatar:function(t){switch(t){case"personal":window.location.href="index.php?mod=pichome&op=user&do=personal";break;case"help":window.open("https://www.yuque.com/pichome");break;case"problem":window.open("https://support.qq.com/products/340252");break;case"setting":window.location.href="index.php?mod=pichome&op=admin&do=basic";break;case"library":window.location.href="index.php?mod=pichome&op=library";break;case"about":this.$alert('<div class="aboutlogo">\n \t\t\t<img src="dzz/pichome/image/phlogo.png" alt="">\n \t\t</div>\n \t\t<div class="aboutmessage">\n \t\t\t<div class="aboutlist">\n \t\t\t\t<span class="title">软件名称:</span><span class="mes">欧奥PicHome</span>\n \t\t\t</div>\n \t\t\t<div class="aboutlist">\n \t\t\t\t<span class="title">版本信息:</span><span class="mes">'+this.GetUserData.version+'</span>\n \t\t\t</div>\n \t\t\t<div class="aboutlist">\n \t\t\t\t<span class="title">版权信息:</span><span class="mes">Powered By oaooa PicHome © 2020-2021 欧奥图文</span>\n \t\t\t</div>\n \t\t\t<div class="aboutlist">\n \t\t\t\t<span class="title">网站地址:</span><span class="mes"><a class="address" href="https://oaooa.com/" target="_blank">oaooa.com</a></span>\n \t\t\t</div>\n \t\t</div>',"",{customClass:"aboutPichome",showClose:!1,showConfirmButton:!1,dangerouslyUseHTMLString:!0,closeOnClickModal:!0});break;case"OutLogin":this.outLogin();break;case"system":window.open("admin.php?mod=system");break}return!1},outLogin:function(){var t=this;return Object(n["a"])(regeneratorRuntime.mark((function a(){var e;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.axios.post(t.AxiosApi+"user.php?mod=login&op=logging&action=logout&formhash="+t.GetFormHash+"&t="+(new Date).getTime());case 2:e=a.sent,e.data,window.location.reload();case 5:case"end":return a.stop()}}),a)})))()}}},d=c,l=(e("d2ba"),e("9c24"),e("2877")),p=Object(l["a"])(d,o,s,!1,null,"6f47bc15",null);a["default"]=p.exports},"864f":function(t,a,e){},"9c24":function(t,a,e){"use strict";var o=e("864f"),s=e.n(o);s.a},ae63:function(t,a,e){},d2ba:function(t,a,e){"use strict";var o=e("ae63"),s=e.n(o);s.a}}]);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77c8d08e"],{"1f5d":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[a("el-card",{staticClass:"box-card",staticStyle:{background:"rgb(240, 249, 235)","margin-bottom":"25px"},attrs:{shadow:"hover"}},[a("ul",{staticClass:"help-inline",domProps:{innerHTML:e._s(e.$t("founder_upgrade_store_directory",{msg:e.returnData.version}))}})]),e._l(e.files,(function(t){return a("div",{staticClass:"wait-files"},[a("i",{staticClass:"el-icon-document"}),e._v(" "+e._s(t)+" ")])})),a("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.handleupdate}},[e._v(e._s(e.$t("founder_upgrade_download")))])],2)},r=[],o=(a("96cf"),a("1da1")),i={props:["returnData"],data:function(){return{files:[],loading:!1}},created:function(){this.getData()},methods:{getData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,n,r,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,a={version:e.returnData.version?e.returnData.version:"",locale:e.returnData.locale?e.returnData.locale:"",charset:e.returnData.charset?e.returnData.charset:""},t.next=4,e.axios.post("admin.php?mod=system&op=intsystemupgrade&operation=patch&step=1",a);case 4:return n=t.sent,r=n.data,r.upgradeNone?(o={upgradeNone:!0},e.$emit("handleStep",o)):r.upgradeError?(o={upgradeError:!0},e.$emit("handleStep",o)):r.bbclosed?(i={bbclosed:!0},e.$emit("handleStep",i)):(e.files=r.data,e.loading=!1),t.abrupt("return",!1);case 8:case"end":return t.stop()}}),t)})))()},handleupdate:function(){var e={template:2};this.$emit("handleStep",e)}},components:{},mounted:function(){}},s=i,u=(a("7949"),a("2877")),d=Object(u["a"])(s,n,r,!1,null,"00939ee2",null);t["default"]=d.exports},7949:function(e,t,a){"use strict";var n=a("93b8"),r=a.n(n);r.a},"93b8":function(e,t,a){}}]);
|
|
||||||
1
admin/system/dist/js/chunk-7aef2525.35b8efb8.js
vendored
Normal file
1
admin/system/dist/js/chunk-7aef2525.35b8efb8.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7aef2525"],{"3e42":function(t,e,a){},6254:function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{"margin-left":"10px",display:"inherit"}},[a("el-dropdown",{staticStyle:{width:"35px",height:"35px"},attrs:{trigger:"click","hide-on-click":!1},on:{command:t.handleAvatar}},[t.GetUserData.icon?[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:t.GetUserData.username,placement:"left"}},[a("el-avatar",{attrs:{size:35,src:t.GetUserData.icon}})],1)]:[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:t.GetUserData.username,placement:"left"}},[a("el-avatar",{style:{background:t.GetUserData.headerColor},attrs:{size:35}},[t._v(t._s(t.GetUserData.firstword))])],1)],a("el-dropdown-menu",{staticClass:"avatar-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"personal"}},[t._v("个人设置")]),a("el-dropdown-item",{attrs:{command:"help"}},[t._v("帮助文档")]),a("el-dropdown-item",{attrs:{command:"problem"}},[t._v("问题反馈")]),a("el-divider"),a("el-dropdown-item",{attrs:{command:"setting"}},[t._v("站点设置")]),a("el-dropdown-item",{attrs:{command:"library"}},[t._v("库设置")]),a("el-dropdown-item",{attrs:{command:"system"}},[a("span",{staticStyle:{position:"relative"}},[t._v(" 系统工具 "),t.GetUserData.upgrade?a("div",{staticClass:"tip",staticStyle:{width:"7px",height:"7px","border-radius":"50%",background:"red",position:"absolute",left:"-13px",top:"0",bottom:"0",margin:"auto"}}):t._e()])]),a("el-divider"),a("el-dropdown-item",{attrs:{command:"about"}},[t._v("关于PicHome")]),a("el-dropdown-item",{attrs:{command:"OutLogin"}},[t._v("退出站点")])],1)],2)],1)},s=[],n=(a("96cf"),a("1da1")),i=a("5530"),r=a("2f62"),c={data:function(){return{}},computed:Object(i["a"])({},Object(r["b"])(["GetUserData","GetFormHash","GetLanguage"])),methods:{handleAvatar:function(t){switch(t){case"collection":window.location.href="index.php?mod=collection";break;case"personal":window.location.href="index.php?mod=pichome&op=user&do=personal";break;case"help":window.open("https://www.yuque.com/pichome");break;case"problem":window.open("https://support.qq.com/products/340252");break;case"setting":window.location.href="index.php?mod=pichome&op=admin&do=authorize";break;case"library":window.location.href="index.php?mod=pichome&op=library";break;case"about":this.$alert('<div class="aboutlogo">\n \t\t\t<img src="dzz/pichome/image/phlogo.png" alt="">\n \t\t</div>\n \t\t<div class="aboutmessage">\n \t\t\t<div class="aboutlist">\n \t\t\t\t<span class="title">软件名称:</span><span class="mes">欧奥PicHome</span>\n \t\t\t</div>\n \t\t\t<div class="aboutlist">\n \t\t\t\t<span class="title">版本信息:</span><span class="mes">'+this.GetUserData.version+'</span>\n \t\t\t</div>\n \t\t\t<div class="aboutlist">\n \t\t\t\t<span class="title">版权信息:</span><span class="mes">Powered By oaooa PicHome © 2020-2022 欧奥图文</span>\n \t\t\t</div>\n \t\t\t<div class="aboutlist">\n \t\t\t\t<span class="title">网站地址:</span><span class="mes"><a class="address" href="https://oaooa.com/" target="_blank">oaooa.com</a></span>\n \t\t\t</div>\n \t\t</div>',"",{customClass:"aboutPichome",showClose:!1,showConfirmButton:!1,dangerouslyUseHTMLString:!0,closeOnClickModal:!0});break;case"OutLogin":this.outLogin();break;case"system":window.open("admin.php?mod=system");break;case"orguser":window.open("admin.php?mod=orguser");break}return!1},outLogin:function(){var t=this;return Object(n["a"])(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.axios.post(t.AxiosApi+"user.php?mod=login&op=logging&action=logout&formhash="+t.GetFormHash+"&t="+(new Date).getTime());case 2:a=e.sent,a.data,window.location.reload();case 5:case"end":return e.stop()}}),e)})))()}}},d=c,l=(a("74bc"),a("9c24"),a("2877")),p=Object(l["a"])(d,o,s,!1,null,"1aac96c1",null);e["default"]=p.exports},"74bc":function(t,e,a){"use strict";var o=a("3e42"),s=a.n(o);s.a},"864f":function(t,e,a){},"9c24":function(t,e,a){"use strict";var o=a("864f"),s=a.n(o);s.a}}]);
|
||||||
@@ -1 +0,0 @@
|
|||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9f9c2568"],{"01e3":function(e,t,n){"use strict";n.r(t);var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page-content"},[n("div",{staticClass:"top-title color-border",staticStyle:{display:"flex"}},[n("span",[e._v(e._s(e.$t("upgrade"))),e.elstep>0?n("span",{staticClass:"line"}):e._e()]),e.elstep>0?n("el-steps",{staticStyle:{flex:"1"},attrs:{active:e.elstep,"finish-status":"success",simple:""}},[n("el-step",{attrs:{title:e.$t("founder_upgrade_updatelist")}}),n("el-step",{attrs:{title:e.$t("founder_upgrade_download")}}),n("el-step",{attrs:{title:e.$t("founder_upgrade_compare")}}),n("el-step",{attrs:{title:e.$t("founder_upgrade_upgrading")}}),n("el-step",{attrs:{title:e.$t("founder_upgrade_complete")}})],1):e._e()],1),n("el-scrollbar",{staticClass:"page-component__scroll"},[n("div",{staticClass:"content",staticStyle:{padding:"25px"}},[n(e.template,{tag:"component",attrs:{returnData:e.returnData},on:{handleStep:e.handleStep}})],1)])],1)},a=[],r=(n("d3b7"),{props:["returnData"],data:function(){return{elstep:"",template:""}},watch:{elstep:{handler:function(e){this.handleTemplate()}},$route:{handler:function(e){e.params&&e.params.version&&(this.elstep=5)},deep:!0}},created:function(){this.returnData.iframes?this.elstep=4:(this.elstep=this.returnData.step?this.returnData.step:1,this.handleTemplate())},methods:{handleStep:function(e){e.upgradeNone?(this.template="upgradeNone",this.elstep=0):e.upgradeError?(this.template="upgradeError",this.elstep=0):e.bbclosed?(this.template="bbclosed",this.elstep=0):this.elstep=e.template},handleTemplate:function(){switch(this.elstep){case 1:this.template="step1";break;case 2:this.template="step2";break;case 3:this.template="step3";break;case 4:this.template="step4";break;case 5:this.template="step5";break}}},components:{upgradeError:function(){return n.e("chunk-2d20fcd9").then(n.bind(null,"b4d5"))},upgradeNone:function(){return n.e("chunk-2d0bdbc6").then(n.bind(null,"2ced"))},bbclosed:function(){return n.e("chunk-2d0a3327").then(n.bind(null,"00c4"))},step1:function(){return n.e("chunk-77c8d08e").then(n.bind(null,"1f5d"))},step2:function(){return n.e("chunk-2d21ddf7").then(n.bind(null,"d2c6"))},step3:function(){return n.e("chunk-2d0efd3c").then(n.bind(null,"9a86"))},step4:function(){return n.e("chunk-36bedb7f").then(n.bind(null,"4e68"))},step5:function(){return n.e("chunk-2d0dd46d").then(n.bind(null,"8164"))}},destroyed:function(){}}),l=r,p=(n("8dc4"),n("2877")),i=Object(p["a"])(l,s,a,!1,null,"0dbad62e",null);t["default"]=i.exports},"1a21":function(e,t,n){},"8dc4":function(e,t,n){"use strict";var s=n("1a21"),a=n.n(s);a.a}}]);
|
|
||||||
1
admin/system/dist/js/index.b5ff203c.js
vendored
1
admin/system/dist/js/index.b5ff203c.js
vendored
File diff suppressed because one or more lines are too long
1
admin/system/dist/js/index.b9edc49b.js
vendored
Normal file
1
admin/system/dist/js/index.b9edc49b.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
admin/system/dist/js/index.d77cc092.js
vendored
1
admin/system/dist/js/index.d77cc092.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
require_once(__DIR__.'/dist/index.html');
|
require_once(__DIR__.'/dist/index.html');
|
||||||
exit();
|
exit();
|
||||||
$operation = $_GET['operation'] ? $_GET['operation'] : 'updatecache';
|
$operation = $_GET['operation'] ? $_GET['operation'] : 'updatecache';
|
||||||
$url=getglobal('siteurl'). BASESCRIPT . '?mod=system&op=' . $operation;
|
$url=getglobal('siteurl'). BASESCRIPT . '?mod=system&op=' . $operation;
|
||||||
$url = outputurl($url);
|
$url = outputurl($url);
|
||||||
@header("location: $url");
|
@header("location: $url");
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,343 +1,350 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
$navtitle = lang('upgrade') . ' - ' . lang('admin_navtitle');
|
$navtitle = lang('upgrade') . ' - ' . lang('admin_navtitle');
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
include_once DZZ_ROOT . './core/core_version.php';
|
include_once DZZ_ROOT . './core/core_version.php';
|
||||||
include_once libfile('function/admin');
|
include_once libfile('function/admin');
|
||||||
include_once libfile('function/cache');
|
include_once libfile('function/cache');
|
||||||
$dzz_upgrade = new dzz_upgrade();
|
$dzz_upgrade = new dzz_upgrade();
|
||||||
$step = intval($_GET['step']);
|
$step = intval($_GET['step']);
|
||||||
$op = $_GET['op'];
|
$op = $_GET['op'];
|
||||||
$step = $step ? $step : 1;
|
$step = $step ? $step : 1;
|
||||||
$operation = $_GET['operation'] ? trim($_GET['operation']) : 'check';
|
$operation = $_GET['operation'] ? trim($_GET['operation']) : 'check';
|
||||||
|
|
||||||
$steplang = array('', lang('founder_upgrade_updatelist'), lang('founder_upgrade_download'), lang('founder_upgrade_compare'), lang('founder_upgrade_upgrading'), lang('founder_upgrade_complete'), 'dbupdate' => lang('founder_upgrade_dbupdate'));
|
$steplang = array('', lang('founder_upgrade_updatelist'), lang('founder_upgrade_download'), lang('founder_upgrade_compare'), lang('founder_upgrade_upgrading'), lang('founder_upgrade_complete'), 'dbupdate' => lang('founder_upgrade_dbupdate'));
|
||||||
|
|
||||||
if ($operation == 'patch' || $operation == 'cross') {
|
if ($operation == 'patch' || $operation == 'cross') {
|
||||||
if (!$_G['setting']['bbclosed']) {
|
if (!$_G['setting']['bbclosed']) {
|
||||||
exit(json_encode(array('bbclosed'=>true)));
|
C::t('setting')->update('bbclosed', 1);
|
||||||
}
|
updatecache('setting');
|
||||||
|
}
|
||||||
$msg = '';
|
|
||||||
$version = trim($_GET['version']);
|
$msg = '';
|
||||||
$release = trim($_GET['release']);
|
$version = trim($_GET['version']);
|
||||||
$locale = trim($_GET['locale']);
|
$release = trim($_GET['release']);
|
||||||
$charset = trim($_GET['charset']);
|
$locale = trim($_GET['locale']);
|
||||||
$upgradeinfo = $upgrade_step = array();
|
$charset = trim($_GET['charset']);
|
||||||
|
$upgradeinfo = $upgrade_step = array();
|
||||||
// if ($_GET['ungetfrom']) {
|
|
||||||
// if (md5($_GET['ungetfrom'] . $_G['config']['security']['authkey']) == $_GET['ungetfrommd5']) {
|
// if ($_GET['ungetfrom']) {
|
||||||
// $dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system#/systemupgrade/'.$version;
|
// if (md5($_GET['ungetfrom'] . $_G['config']['security']['authkey']) == $_GET['ungetfrommd5']) {
|
||||||
// $url = outputurl( $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey'])) );
|
// $dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system#/systemupgrade/'.$version;
|
||||||
// exit(json_encode(array('iframe'=>true,'url'=>$url)));
|
// $url = outputurl( $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey'])) );
|
||||||
// dheader('Location: ' . $url);
|
// exit(json_encode(array('iframe'=>true,'url'=>$url)));
|
||||||
// } else {
|
// dheader('Location: ' . $url);
|
||||||
// exit(json_encode(array('error'=>true,'msg'=>lang('upgrade_param_error'))));
|
// } else {
|
||||||
// }
|
// exit(json_encode(array('error'=>true,'msg'=>lang('upgrade_param_error'))));
|
||||||
// }
|
// }
|
||||||
|
// }
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
|
||||||
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
$upgrade_step['step'] = $step;
|
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
||||||
$upgrade_step['operation'] = $operation;
|
$upgrade_step['step'] = $step;
|
||||||
$upgrade_step['version'] = $version;
|
$upgrade_step['operation'] = $operation;
|
||||||
$upgrade_step['release'] = $release;
|
$upgrade_step['version'] = $version;
|
||||||
$upgrade_step['charset'] = $charset;
|
$upgrade_step['release'] = $release;
|
||||||
$upgrade_step['locale'] = $locale;
|
$upgrade_step['charset'] = $charset;
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
$upgrade_step['locale'] = $locale;
|
||||||
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
$upgrade_run = C::t('cache') -> fetch('upgrade_run');
|
|
||||||
if (!$upgrade_run) {
|
$upgrade_run = C::t('cache') -> fetch('upgrade_run');
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_run', 'cachevalue' => serialize($_G['setting']['upgrade']), 'dateline' => $_G['timestamp'], ), false, true);
|
if (!$upgrade_run) {
|
||||||
$upgrade_run = $_G['setting']['upgrade'];
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_run', 'cachevalue' => serialize($_G['setting']['upgrade']), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
} else {
|
$upgrade_run = $_G['setting']['upgrade'];
|
||||||
$upgrade_run = dunserialize($upgrade_run['cachevalue']);
|
} else {
|
||||||
}
|
$upgrade_run = dunserialize($upgrade_run['cachevalue']);
|
||||||
|
}
|
||||||
if ($step != 5) {
|
|
||||||
|
if ($step != 5) {
|
||||||
foreach ($upgrade_run as $type => $list) {
|
|
||||||
if ($type == $operation && $version == $list['latestversion']) {
|
foreach ($upgrade_run as $type => $list) {
|
||||||
$dzz_upgrade -> locale = $locale;
|
if ($type == $operation && $version == $list['latestversion']) {
|
||||||
$dzz_upgrade -> charset = $charset;
|
$dzz_upgrade -> locale = $locale;
|
||||||
$upgradeinfo = $list;
|
$dzz_upgrade -> charset = $charset;
|
||||||
break;
|
$upgradeinfo = $list;
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
if (!$upgradeinfo) {
|
}
|
||||||
upgradeinformation(-1);
|
if (!$upgradeinfo) {
|
||||||
exit(json_encode(array('upgradeNone'=>true)));
|
upgradeinformation(-1);
|
||||||
}
|
exit(json_encode(array('upgradeNone'=>true)));
|
||||||
|
}
|
||||||
$updatefilelist = $dzz_upgrade -> fetch_updatefile_list($upgradeinfo);
|
|
||||||
$updatemd5filelist = $updatefilelist['md5'];
|
$updatefilelist = $dzz_upgrade -> fetch_updatefile_list($upgradeinfo);
|
||||||
$updatefilelist = $updatefilelist['file'];
|
$updatemd5filelist = $updatefilelist['md5'];
|
||||||
$theurl = $_G['siteurl'].ADMINSCRIPT . '?mod=system&op=intsystemupgrade&operation=' . $operation . '&version=' . $version . '&locale=' . $locale . '&charset=' . $charset;
|
$updatefilelist = $updatefilelist['file'];
|
||||||
if (empty($updatefilelist)) {
|
$theurl = $_G['siteurl'].ADMINSCRIPT . '?mod=system&op=intsystemupgrade&operation=' . $operation . '&version=' . $version . '&locale=' . $locale . '&charset=' . $charset;
|
||||||
upgradeinformation(-2);
|
if (empty($updatefilelist)) {
|
||||||
exit(json_encode(array('upgradeError'=>true)));
|
upgradeinformation(-2);
|
||||||
}
|
exit(json_encode(array('upgradeError'=>true)));
|
||||||
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
if ($step == 1) {
|
|
||||||
exit(json_encode(array('step'=>1,'data'=>$updatefilelist)));
|
if ($step == 1) {
|
||||||
} elseif ($step == 2) {
|
exit(json_encode(array('step'=>1,'data'=>$updatefilelist)));
|
||||||
$fileseq = intval($_GET['fileseq']);
|
} elseif ($step == 2) {
|
||||||
$fileseq = $fileseq ? $fileseq : 1;
|
$fileseq = intval($_GET['fileseq']);
|
||||||
if ($fileseq > count($updatefilelist)) {
|
$fileseq = $fileseq ? $fileseq : 1;
|
||||||
$linkurl = $theurl . '&step=3';
|
if ($fileseq > count($updatefilelist)) {
|
||||||
upgradeinformation(0);
|
$linkurl = $theurl . '&step=3';
|
||||||
exit(json_encode(array('step'=>2,'downloadstatus'=>4)));
|
upgradeinformation(0);
|
||||||
} else {
|
exit(json_encode(array('step'=>2,'downloadstatus'=>4)));
|
||||||
$downloadstatus = $dzz_upgrade -> download_file($upgradeinfo, $updatefilelist[$fileseq - 1], 'upload', $updatemd5filelist[$fileseq - 1]);
|
} else {
|
||||||
if ($downloadstatus == 1) {
|
$downloadstatus = $dzz_upgrade -> download_file($upgradeinfo, $updatefilelist[$fileseq - 1], 'upload', $updatemd5filelist[$fileseq - 1]);
|
||||||
$data = array('file' => $updatefilelist[$fileseq - 1],'fileseq'=>$fileseq,'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)));
|
if ($downloadstatus == 1) {
|
||||||
upgradeinformation(1);
|
$data = array('file' => $updatefilelist[$fileseq - 1],'fileseq'=>$fileseq,'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)));
|
||||||
exit(json_encode(array('step'=>2,'data'=>$data,'downloadstatus'=>1)));
|
upgradeinformation(1);
|
||||||
} elseif ($downloadstatus == 2) {
|
exit(json_encode(array('step'=>2,'data'=>$data,'downloadstatus'=>1)));
|
||||||
$data = array('file' => $updatefilelist[$fileseq - 1],'fileseq'=>($fileseq + 1),'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)));
|
} elseif ($downloadstatus == 2) {
|
||||||
upgradeinformation(1);
|
$data = array('file' => $updatefilelist[$fileseq - 1],'fileseq'=>($fileseq + 1),'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)));
|
||||||
exit(json_encode(array('step'=>2,'data'=>$data,'downloadstatus'=>2)));
|
upgradeinformation(1);
|
||||||
} else {
|
exit(json_encode(array('step'=>2,'data'=>$data,'downloadstatus'=>2)));
|
||||||
$data = array('file' => $updatefilelist[$fileseq - 1]);
|
} else {
|
||||||
upgradeinformation(-3);
|
$data = array('file' => $updatefilelist[$fileseq - 1]);
|
||||||
exit(json_encode(array('step'=>2,'data'=>$data,'downloadstatus'=>3)));
|
upgradeinformation(-3);
|
||||||
}
|
exit(json_encode(array('step'=>2,'data'=>$data,'downloadstatus'=>3)));
|
||||||
}
|
}
|
||||||
} elseif ($step == 3) {
|
}
|
||||||
|
} elseif ($step == 3) {
|
||||||
list($modifylist, $showlist, $ignorelist,$newlist) = $dzz_upgrade -> compare_basefile($upgradeinfo, $updatefilelist,$updatemd5filelist);
|
|
||||||
|
list($modifylist, $showlist, $ignorelist,$newlist) = $dzz_upgrade -> compare_basefile($upgradeinfo, $updatefilelist,$updatemd5filelist);
|
||||||
$tableData = array();
|
|
||||||
$button = '';
|
$tableData = array();
|
||||||
|
$button = '';
|
||||||
if (empty($modifylist) && empty($showlist) && empty($ignorelist) && empty($newlist)) {
|
|
||||||
|
if (empty($modifylist) && empty($showlist) && empty($ignorelist) && empty($newlist)) {
|
||||||
}else{
|
|
||||||
if(empty($modifylist)){
|
}else{
|
||||||
$button = lang('founder_upgrade_regular');
|
if(empty($modifylist)){
|
||||||
}else{
|
$button = lang('founder_upgrade_regular');
|
||||||
$button = lang('founder_upgrade_force');
|
}else{
|
||||||
}
|
$button = lang('founder_upgrade_force');
|
||||||
foreach($updatefilelist as $val){
|
}
|
||||||
if(isset($modifylist[$val])){
|
foreach($updatefilelist as $val){
|
||||||
$res = array('name'=>$val,'status'=>1);
|
if(isset($modifylist[$val])){
|
||||||
}elseif(isset($showlist[$val])){
|
$res = array('name'=>$val,'status'=>1);
|
||||||
$res = array('name'=>$val,'status'=>2);
|
}elseif(isset($showlist[$val])){
|
||||||
}elseif(isset($newlist[$val])){
|
$res = array('name'=>$val,'status'=>2);
|
||||||
$res = array('name'=>$val,'status'=>3);
|
}elseif(isset($newlist[$val])){
|
||||||
}else{
|
$res = array('name'=>$val,'status'=>3);
|
||||||
$res = array('name'=>$val,'status'=>1);
|
}else{
|
||||||
}
|
$res = array('name'=>$val,'status'=>1);
|
||||||
$tableData[] = $res;
|
}
|
||||||
}
|
$tableData[] = $res;
|
||||||
}
|
}
|
||||||
upgradeinformation(-4);
|
}
|
||||||
exit(json_encode(array('step'=>3,'tableData'=>$tableData,'button'=>$button,'oldversion'=>CORE_VERSION)));
|
upgradeinformation(-4);
|
||||||
} elseif ($step == 4) {
|
exit(json_encode(array('step'=>3,'tableData'=>$tableData,'button'=>$button,'oldversion'=>CORE_VERSION)));
|
||||||
|
} elseif ($step == 4) {
|
||||||
$confirm = $_GET['confirm'];
|
|
||||||
if (!$confirm) {
|
$confirm = $_GET['confirm'];
|
||||||
if ($_GET['siteftpsetting']) {
|
if (!$confirm) {
|
||||||
$action = $theurl . '&step=4&confirm=ftp&formhash='.FORMHASH . ($_GET['startupgrade'] ? '&startupgrade=1' : '');
|
if ($_GET['siteftpsetting']) {
|
||||||
exit(json_encode(array('siteftpsetting'=>true,'url'=>$action)));
|
$action = $theurl . '&step=4&confirm=ftp&formhash='.FORMHASH . ($_GET['startupgrade'] ? '&startupgrade=1' : '');
|
||||||
}
|
exit(json_encode(array('siteftpsetting'=>true,'url'=>$action)));
|
||||||
if ($upgradeinfo['isupdatedb']) {
|
}
|
||||||
$checkupdatefilelist = array('install/update.php', 'install/data/install.sql', 'install/data/install_data.sql');
|
if ($upgradeinfo['isupdatedb']) {
|
||||||
$checkupdatefilelist = array_merge($checkupdatefilelist, $updatefilelist);
|
$checkupdatefilelist = array('install/update.php', 'install/data/install.sql', 'install/data/install_data.sql');
|
||||||
} else {
|
$checkupdatefilelist = array_merge($checkupdatefilelist, $updatefilelist);
|
||||||
$checkupdatefilelist = $updatefilelist;
|
} else {
|
||||||
}
|
$checkupdatefilelist = $updatefilelist;
|
||||||
if ($dzz_upgrade -> check_folder_perm($checkupdatefilelist)) {
|
}
|
||||||
$confirm = 'file';
|
if ($dzz_upgrade -> check_folder_perm($checkupdatefilelist)) {
|
||||||
} else {
|
$confirm = 'file';
|
||||||
exit(json_encode(array('againsiteftpsetting'=>true)));
|
} else {
|
||||||
}
|
exit(json_encode(array('againsiteftpsetting'=>true)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$paraftp = '';
|
|
||||||
if ($_GET['siteftp']) {
|
$paraftp = '';
|
||||||
foreach ($_GET['siteftp'] as $k => $v) {
|
if ($_GET['siteftp']) {
|
||||||
$paraftp .= '&siteftp[' . $k . ']=' . $v;
|
foreach ($_GET['siteftp'] as $k => $v) {
|
||||||
}
|
$paraftp .= '&siteftp[' . $k . ']=' . $v;
|
||||||
}
|
}
|
||||||
if (!$_GET['startupgrade']) {
|
}
|
||||||
if (!$_GET['backfile']) {
|
if (!$_GET['startupgrade']) {
|
||||||
$linkurl = $theurl . '&step=4&backfile=1&confirm=' . $confirm . $paraftp;
|
if (!$_GET['backfile']) {
|
||||||
upgradeinformation(2);
|
$linkurl = $theurl . '&step=4&backfile=1&confirm=' . $confirm . $paraftp;
|
||||||
exit(json_encode(array('backfile'=>true,'url'=>$linkurl)));
|
upgradeinformation(2);
|
||||||
}
|
exit(json_encode(array('backfile'=>true,'url'=>$linkurl)));
|
||||||
foreach ($updatefilelist as $updatefile) {
|
}
|
||||||
$destfile = DZZ_ROOT . $updatefile;
|
foreach ($updatefilelist as $updatefile) {
|
||||||
$backfile = DZZ_ROOT . './data/back/pichome' . CORE_VERSION . '/' . $updatefile;
|
$destfile = DZZ_ROOT . $updatefile;
|
||||||
if (is_file($destfile)) {
|
$backfile = DZZ_ROOT . './data/back/pichome' . CORE_VERSION . '/' . $updatefile;
|
||||||
if (!$dzz_upgrade -> copy_file($destfile, $backfile, 'file')) {
|
if (is_file($destfile)) {
|
||||||
upgradeinformation(-5);
|
if (!$dzz_upgrade -> copy_file($destfile, $backfile, 'file')) {
|
||||||
exit(json_encode(array('destfile'=>true)));
|
upgradeinformation(-5);
|
||||||
}
|
exit(json_encode(array('destfile'=>true)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
upgradeinformation(3);
|
}
|
||||||
exit(json_encode(array('complete'=>true,'url'=>$theurl.'&step=4&startupgrade=1&confirm='.$confirm.$paraftp)));
|
upgradeinformation(3);
|
||||||
}
|
exit(json_encode(array('complete'=>true,'url'=>$theurl.'&step=4&startupgrade=1&confirm='.$confirm.$paraftp)));
|
||||||
|
}
|
||||||
$linkurl = $theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp;
|
|
||||||
$ftplinkurl = $theurl . '&step=4&startupgrade=1&siteftpsetting=1';
|
$linkurl = $theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp;
|
||||||
foreach ($updatefilelist as $updatefile) {
|
$ftplinkurl = $theurl . '&step=4&startupgrade=1&siteftpsetting=1';
|
||||||
$srcfile = DZZ_ROOT . './data/update/pichome' . $version . '/' . $updatefile;
|
foreach ($updatefilelist as $updatefile) {
|
||||||
if ($confirm == 'ftp') {
|
$srcfile = DZZ_ROOT . './data/update/pichome' . $version . '/' . $updatefile;
|
||||||
$destfile = $updatefile;
|
if ($confirm == 'ftp') {
|
||||||
} else {
|
$destfile = $updatefile;
|
||||||
$destfile = DZZ_ROOT . $updatefile;
|
} else {
|
||||||
}
|
$destfile = DZZ_ROOT . $updatefile;
|
||||||
if (!$dzz_upgrade -> copy_file($srcfile, $destfile, $confirm)) {
|
}
|
||||||
if ($confirm == 'ftp') {
|
if (!$dzz_upgrade -> copy_file($srcfile, $destfile, $confirm)) {
|
||||||
upgradeinformation(-6);
|
if ($confirm == 'ftp') {
|
||||||
exit(json_encode(array('ftpError'=>true,'file'=>$updatefile,'againUpdate'=>$linkurl,'ftpUrl'=>$ftplinkurl)));
|
upgradeinformation(-6);
|
||||||
} else {
|
exit(json_encode(array('ftpError'=>true,'file'=>$updatefile,'againUpdate'=>$linkurl,'ftpUrl'=>$ftplinkurl)));
|
||||||
upgradeinformation(-7);
|
} else {
|
||||||
exit(json_encode(array('copyError'=>true,'file'=>$updatefile,'againUpdate'=>$linkurl,'ftpUrl'=>$ftplinkurl)));
|
upgradeinformation(-7);
|
||||||
}
|
exit(json_encode(array('copyError'=>true,'file'=>$updatefile,'againUpdate'=>$linkurl,'ftpUrl'=>$ftplinkurl)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($upgradeinfo['isupdatedb']) {
|
}
|
||||||
|
if ($upgradeinfo['isupdatedb']) {
|
||||||
$upgrade_step['step'] = 'dbupdate';
|
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
$upgrade_step['step'] = 'dbupdate';
|
||||||
// $dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system#/systemupgrade/'.$version;
|
// $dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
||||||
$linkurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system#/systemupgrade/'.$version;
|
||||||
upgradeinformation(4);
|
$linkurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
||||||
exit(json_encode(array('updateMysql'=>true,'url'=>$linkurl)));
|
upgradeinformation(4);
|
||||||
|
exit(json_encode(array('updateMysql'=>true,'url'=>$linkurl)));
|
||||||
}
|
|
||||||
exit(json_encode(array('nextStep'=>true)));
|
}
|
||||||
|
exit(json_encode(array('nextStep'=>true)));
|
||||||
} elseif ($step == 5) {
|
|
||||||
$file = DZZ_ROOT . './data/update/pichome' . $version . '/updatelist.tmp';
|
} elseif ($step == 5) {
|
||||||
@unlink($file);
|
$file = DZZ_ROOT . './data/update/pichome' . $version . '/updatelist.tmp';
|
||||||
@unlink(DZZ_ROOT . './install/update.php');
|
@unlink($file);
|
||||||
C::t('cache') -> delete('upgrade_step');
|
@unlink(DZZ_ROOT . './install/update.php');
|
||||||
C::t('cache') -> delete('upgrade_run');
|
//打开站点
|
||||||
C::t('setting') -> update('upgrade', '');
|
C::t('setting')->update('bbclosed', 0);
|
||||||
updatecache('setting');
|
C::t('cache') -> delete('upgrade_step');
|
||||||
$old_update_dir = './data/update/';
|
C::t('cache') -> delete('upgrade_run');
|
||||||
$new_update_dir = './data/update' . md5('update' . $_G['config']['security']['authkey']) . '/';
|
C::t('setting') -> update('upgrade', '');
|
||||||
$old_back_dir = './data/back/';
|
updatecache('setting');
|
||||||
$new_back_dir = './data/back' . md5('back' . $_G['config']['security']['authkey']) . '/';
|
$old_update_dir = './data/update/';
|
||||||
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_update_dir, DZZ_ROOT . $new_update_dir);
|
$new_update_dir = './data/update' . md5('update' . $_G['config']['security']['authkey']) . '/';
|
||||||
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_back_dir, DZZ_ROOT . $new_back_dir);
|
$old_back_dir = './data/back/';
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
$new_back_dir = './data/back' . md5('back' . $_G['config']['security']['authkey']) . '/';
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_back_dir);
|
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_update_dir, DZZ_ROOT . $new_update_dir);
|
||||||
upgradeinformation(0);
|
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_back_dir, DZZ_ROOT . $new_back_dir);
|
||||||
exit(json_encode(array('dir'=>$new_update_dir,'backdir'=>$new_back_dir)));
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
||||||
// $msg = lang('upgrade_successful', array('version' => $version, 'save_update_dir' => $new_update_dir, 'save_back_dir' => $new_back_dir, 'upgradeurl' => upgradeinformation(0)));
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_back_dir);
|
||||||
|
upgradeinformation(0);
|
||||||
}
|
$versionname = CORE_VERSION_LEVEL;
|
||||||
|
$versionnumarr = explode('.',CORE_VERSION);
|
||||||
}elseif ($operation == 'check') {
|
unset($versionnumarr[0]);
|
||||||
$msg = '';
|
$vsersion = $versionname.implode('.',$versionnumarr);
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
exit(json_encode(array('version' => $vsersion,'dir'=>$new_update_dir,'backdir'=>$new_back_dir)));
|
||||||
if (!empty($upgrade_step['cachevalue'])) {
|
// $msg = lang('upgrade_successful', array('version' => $version, 'save_update_dir' => $new_update_dir, 'save_back_dir' => $new_back_dir, 'upgradeurl' => upgradeinformation(0)));
|
||||||
$upgrade_step['cachevalue'] = dunserialize($upgrade_step['cachevalue']);
|
|
||||||
if (!empty($upgrade_step['cachevalue']['step'])) {
|
}
|
||||||
|
|
||||||
$theurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $upgrade_step['cachevalue']['operation'] . '&version=' . $upgrade_step['cachevalue']['version'] . '&locale=' . $upgrade_step['cachevalue']['locale'] . '&charset=' . $upgrade_step['cachevalue']['charset'];
|
}elseif ($operation == 'check') {
|
||||||
|
$msg = '';
|
||||||
$recheckurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=recheck';
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
if ($upgrade_step['cachevalue']['step'] == 'dbupdate') {
|
if (!empty($upgrade_step['cachevalue'])) {
|
||||||
// $dbreturnurl = $_G['siteurl'] . $theurl . '&step=5';
|
$upgrade_step['cachevalue'] = dunserialize($upgrade_step['cachevalue']);
|
||||||
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system#/systemupgrade/'.$upgrade_step['cachevalue']['version'];
|
if (!empty($upgrade_step['cachevalue']['step'])) {
|
||||||
$stepurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
|
||||||
exit(json_encode(array('iframe'=>true,'steplang'=>$steplang['dbupdate'],'url'=>$stepurl)));
|
$theurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $upgrade_step['cachevalue']['operation'] . '&version=' . $upgrade_step['cachevalue']['version'] . '&locale=' . $upgrade_step['cachevalue']['locale'] . '&charset=' . $upgrade_step['cachevalue']['charset'];
|
||||||
} else {
|
|
||||||
exit(json_encode(array('html'=>true,'steplang'=>$steplang[$upgrade_step['cachevalue']['step']],'data'=>$upgrade_step['cachevalue'])));
|
$recheckurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=recheck';
|
||||||
}
|
if ($upgrade_step['cachevalue']['step'] == 'dbupdate') {
|
||||||
}else{
|
// $dbreturnurl = $_G['siteurl'] . $theurl . '&step=5';
|
||||||
$dzz_upgrade -> check_upgrade();
|
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system#/systemupgrade/'.$upgrade_step['cachevalue']['version'];
|
||||||
exit(json_encode(array('html'=>false)));
|
$stepurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
||||||
}
|
exit(json_encode(array('iframe'=>true,'steplang'=>$steplang['dbupdate'],'url'=>$stepurl)));
|
||||||
}else{
|
} else {
|
||||||
$dzz_upgrade -> check_upgrade();
|
exit(json_encode(array('html'=>true,'steplang'=>$steplang[$upgrade_step['cachevalue']['step']],'data'=>$upgrade_step['cachevalue'])));
|
||||||
exit(json_encode(array('html'=>false)));
|
}
|
||||||
}
|
}else{
|
||||||
exit();
|
$dzz_upgrade -> check_upgrade();
|
||||||
}elseif ($operation == 'showupgrade') {
|
exit(json_encode(array('html'=>false)));
|
||||||
|
}
|
||||||
if ($_G['setting']['upgrade']) {
|
}else{
|
||||||
|
$dzz_upgrade -> check_upgrade();
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize(array('curversion' => $dzz_upgrade -> versionpath())), 'dateline' => $_G['timestamp'], ), false, true);
|
exit(json_encode(array('html'=>false)));
|
||||||
|
}
|
||||||
$upgraderow = $patchrow = array();
|
exit();
|
||||||
$charset = str_replace('-', '', strtoupper($_G['config']['output']['charset']));
|
}elseif ($operation == 'showupgrade') {
|
||||||
$dbversion = helper_dbtool::dbversion();
|
|
||||||
$locale = '';
|
if ($_G['setting']['upgrade']) {
|
||||||
|
|
||||||
if ($charset == 'BIG5') {
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize(array('curversion' => $dzz_upgrade -> versionpath())), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
$locale = 'TC';
|
|
||||||
} elseif ($charset == 'GBK') {
|
$upgraderow = $patchrow = array();
|
||||||
$locale = 'SC';
|
$charset = str_replace('-', '', strtoupper($_G['config']['output']['charset']));
|
||||||
} elseif ($charset == 'UTF8') {
|
$dbversion = helper_dbtool::dbversion();
|
||||||
if ($_G['config']['output']['language'] == 'zh-cn' || $_G['config']['output']['language'] == 'zh_cn') {
|
$locale = '';
|
||||||
$locale = 'SC';
|
|
||||||
} elseif ($_G['config']['output']['language'] == 'zh-tw' || $_G['config']['output']['language'] == 'zh_tw') {
|
if ($charset == 'BIG5') {
|
||||||
$locale = 'TC';
|
$locale = 'TC';
|
||||||
}else{
|
} elseif ($charset == 'GBK') {
|
||||||
$locale = 'SC';
|
$locale = 'SC';
|
||||||
}
|
} elseif ($charset == 'UTF8') {
|
||||||
}
|
if ($_G['config']['output']['language'] == 'zh-cn' || $_G['config']['output']['language'] == 'zh_cn') {
|
||||||
|
$locale = 'SC';
|
||||||
if (!is_array($_G['setting']['upgrade']))
|
} elseif ($_G['config']['output']['language'] == 'zh-tw' || $_G['config']['output']['language'] == 'zh_tw') {
|
||||||
$_G['setting']['upgrade'] = unserialize($_G['setting']['upgrade']);
|
$locale = 'TC';
|
||||||
$list = array();
|
}else{
|
||||||
foreach ($_G['setting']['upgrade'] as $type => $upgrade) {
|
$locale = 'SC';
|
||||||
$flist = array();
|
}
|
||||||
$unupgrade = 0;
|
}
|
||||||
if (version_compare($upgrade['phpversion'], PHP_VERSION) > 0 || version_compare($upgrade['mysqlversion'], $dbversion) > 0) {
|
|
||||||
$unupgrade = 1;
|
if (!is_array($_G['setting']['upgrade']))
|
||||||
}
|
$_G['setting']['upgrade'] = unserialize($_G['setting']['upgrade']);
|
||||||
if ($unupgrade) {
|
$list = array();
|
||||||
$flist['title'] = 'oaooa PicHome ' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
foreach ($_G['setting']['upgrade'] as $type => $upgrade) {
|
||||||
$flist['msg'] = lang('founder_upgrade_require_config') . ' php v' . PHP_VERSION . 'MYSQL v' . $dbversion;
|
$flist = array();
|
||||||
$flist['update'] = false;
|
$unupgrade = 0;
|
||||||
} else {
|
if (version_compare($upgrade['phpversion'], PHP_VERSION) > 0 || version_compare($upgrade['mysqlversion'], $dbversion) > 0) {
|
||||||
$flist['title'] = 'oaooa PicHome ' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
$unupgrade = 1;
|
||||||
$flist['update'] = true;
|
}
|
||||||
$flist['version'] = $upgrade['latestversion'];
|
if ($unupgrade) {
|
||||||
$flist['locale'] = $locale;
|
$flist['title'] = 'oaooa PicHome ' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
||||||
$flist['charset'] = $charset;
|
$flist['msg'] = lang('founder_upgrade_require_config') . ' php v' . PHP_VERSION . 'MYSQL v' . $dbversion;
|
||||||
}
|
$flist['update'] = false;
|
||||||
$list[] = $flist;
|
} else {
|
||||||
}
|
$flist['title'] = 'oaooa PicHome ' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
||||||
exit(json_encode(array('content'=>true,'data'=>$list)));
|
$flist['update'] = true;
|
||||||
} else {
|
$flist['version'] = $upgrade['latestversion'];
|
||||||
exit(json_encode(array('content'=>false)));
|
$flist['locale'] = $locale;
|
||||||
}
|
$flist['charset'] = $charset;
|
||||||
}elseif ($operation == 'recheck') {
|
}
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
$list[] = $flist;
|
||||||
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
}
|
||||||
$file = DZZ_ROOT . './data/update/pichome' . $upgrade_step['version'] . '/updatelist.tmp';
|
exit(json_encode(array('content'=>true,'data'=>$list)));
|
||||||
@unlink($file);
|
} else {
|
||||||
@unlink(DZZ_ROOT . './install/update.php');
|
exit(json_encode(array('content'=>false)));
|
||||||
C::t('cache') -> delete('upgrade_step');
|
}
|
||||||
C::t('cache') -> delete('upgrade_run');
|
}elseif ($operation == 'recheck') {
|
||||||
C::t('setting') -> update('upgrade', '');
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
updatecache('setting');
|
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
||||||
$old_update_dir = './data/update/';
|
$file = DZZ_ROOT . './data/update/pichome' . $upgrade_step['version'] . '/updatelist.tmp';
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
@unlink($file);
|
||||||
$dzz_upgrade -> check_upgrade();
|
@unlink(DZZ_ROOT . './install/update.php');
|
||||||
// $url = outputurl($_G['siteurl'].MOD_URL.'&op=systemupgrade' );
|
C::t('cache') -> delete('upgrade_step');
|
||||||
// dheader('Location: ' . $url);
|
C::t('cache') -> delete('upgrade_run');
|
||||||
}
|
C::t('setting') -> update('upgrade', '');
|
||||||
// include template('upgrade');
|
updatecache('setting');
|
||||||
|
$old_update_dir = './data/update/';
|
||||||
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
||||||
|
$dzz_upgrade -> check_upgrade();
|
||||||
|
// $url = outputurl($_G['siteurl'].MOD_URL.'&op=systemupgrade' );
|
||||||
|
// dheader('Location: ' . $url);
|
||||||
|
}
|
||||||
|
// include template('upgrade');
|
||||||
?>
|
?>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
$lang = array (
|
$lang = array (
|
||||||
'appname'=>'System Tool',
|
'appname'=>'System Tool',
|
||||||
'systemupgrade'=>'online upgrade',
|
'systemupgrade'=>'online upgrade',
|
||||||
'tools_updatecache_memory'=>'Memory Cache'
|
'tools_updatecache_memory'=>'Memory Cache'
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
$lang = array (
|
$lang = array (
|
||||||
'appname'=>'系统工具',
|
'appname'=>'系统工具',
|
||||||
'systemupgrade'=>'在线升级',
|
'systemupgrade'=>'在线升级',
|
||||||
'tools_updatecache_memory'=>'内存缓存'
|
'tools_updatecache_memory'=>'内存缓存'
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
@@ -1,416 +1,416 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
$navtitle = lang('upgrade') . ' - ' . lang('admin_navtitle');
|
$navtitle = lang('upgrade') . ' - ' . lang('admin_navtitle');
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
include_once DZZ_ROOT . './core/core_version.php';
|
include_once DZZ_ROOT . './core/core_version.php';
|
||||||
include_once libfile('function/admin');
|
include_once libfile('function/admin');
|
||||||
include_once libfile('function/cache');
|
include_once libfile('function/cache');
|
||||||
$dzz_upgrade = new dzz_upgrade();
|
$dzz_upgrade = new dzz_upgrade();
|
||||||
$step = intval($_GET['step']);
|
$step = intval($_GET['step']);
|
||||||
$op = $_GET['op'];
|
$op = $_GET['op'];
|
||||||
$step = $step ? $step : 1;
|
$step = $step ? $step : 1;
|
||||||
$operation = $_GET['operation'] ? trim($_GET['operation']) : 'check';
|
$operation = $_GET['operation'] ? trim($_GET['operation']) : 'check';
|
||||||
|
|
||||||
$steplang = array('', lang('founder_upgrade_updatelist'), lang('founder_upgrade_download'), lang('founder_upgrade_compare'), lang('founder_upgrade_upgrading'), lang('founder_upgrade_complete'), 'dbupdate' => lang('founder_upgrade_dbupdate'));
|
$steplang = array('', lang('founder_upgrade_updatelist'), lang('founder_upgrade_download'), lang('founder_upgrade_compare'), lang('founder_upgrade_upgrading'), lang('founder_upgrade_complete'), 'dbupdate' => lang('founder_upgrade_dbupdate'));
|
||||||
|
|
||||||
if ($operation == 'patch' || $operation == 'cross') {
|
if ($operation == 'patch' || $operation == 'cross') {
|
||||||
|
|
||||||
if (!$_G['setting']['bbclosed']) {
|
if (!$_G['setting']['bbclosed']) {
|
||||||
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_close_site') . '</p>';
|
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_close_site') . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.reload();" value="' . lang('founder_upgrade_reset') . '" /></p>';
|
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.reload();" value="' . lang('founder_upgrade_reset') . '" /></p>';
|
||||||
|
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$version = trim($_GET['version']);
|
$version = trim($_GET['version']);
|
||||||
//$release = trim($_GET['release']);
|
//$release = trim($_GET['release']);
|
||||||
$locale = trim($_GET['locale']);
|
$locale = trim($_GET['locale']);
|
||||||
$charset = trim($_GET['charset']);
|
$charset = trim($_GET['charset']);
|
||||||
$upgradeinfo = $upgrade_step = array();
|
$upgradeinfo = $upgrade_step = array();
|
||||||
|
|
||||||
if ($_GET['ungetfrom']) {
|
if ($_GET['ungetfrom']) {
|
||||||
if (md5($_GET['ungetfrom'] . $_G['config']['security']['authkey']) == $_GET['ungetfrommd5']) {
|
if (md5($_GET['ungetfrom'] . $_G['config']['security']['authkey']) == $_GET['ungetfrommd5']) {
|
||||||
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
||||||
$url = outputurl( $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey'])) );
|
$url = outputurl( $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey'])) );
|
||||||
dheader('Location: ' . $url);
|
dheader('Location: ' . $url);
|
||||||
} else {
|
} else {
|
||||||
showmessage('upgrade_param_error');
|
showmessage('upgrade_param_error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
||||||
$upgrade_step['step'] = $step;
|
$upgrade_step['step'] = $step;
|
||||||
$upgrade_step['operation'] = $operation;
|
$upgrade_step['operation'] = $operation;
|
||||||
$upgrade_step['version'] = $version;
|
$upgrade_step['version'] = $version;
|
||||||
//$upgrade_step['release'] = $release;
|
//$upgrade_step['release'] = $release;
|
||||||
$upgrade_step['charset'] = $charset;
|
$upgrade_step['charset'] = $charset;
|
||||||
$upgrade_step['locale'] = $locale;
|
$upgrade_step['locale'] = $locale;
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
|
|
||||||
$upgrade_run = C::t('cache') -> fetch('upgrade_run');
|
$upgrade_run = C::t('cache') -> fetch('upgrade_run');
|
||||||
if (!$upgrade_run) {
|
if (!$upgrade_run) {
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_run', 'cachevalue' => serialize($_G['setting']['upgrade']), 'dateline' => $_G['timestamp'], ), false, true);
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_run', 'cachevalue' => serialize($_G['setting']['upgrade']), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
$upgrade_run = $_G['setting']['upgrade'];
|
$upgrade_run = $_G['setting']['upgrade'];
|
||||||
} else {
|
} else {
|
||||||
$upgrade_run = dunserialize($upgrade_run['cachevalue']);
|
$upgrade_run = dunserialize($upgrade_run['cachevalue']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($step != 5) {
|
if ($step != 5) {
|
||||||
|
|
||||||
foreach ($upgrade_run as $type => $list) {
|
foreach ($upgrade_run as $type => $list) {
|
||||||
if ($type == $operation && $version == $list['latestversion']) {
|
if ($type == $operation && $version == $list['latestversion']) {
|
||||||
$dzz_upgrade -> locale = $locale;
|
$dzz_upgrade -> locale = $locale;
|
||||||
$dzz_upgrade -> charset = $charset;
|
$dzz_upgrade -> charset = $charset;
|
||||||
$upgradeinfo = $list;
|
$upgradeinfo = $list;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$upgradeinfo) {
|
if (!$upgradeinfo) {
|
||||||
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_none', array('upgradeurl' => upgradeinformation(-1))) . '</p>';
|
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_none', array('upgradeurl' => upgradeinformation(-1))) . '</p>';
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$updatefilelist = $dzz_upgrade -> fetch_updatefile_list($upgradeinfo);
|
$updatefilelist = $dzz_upgrade -> fetch_updatefile_list($upgradeinfo);
|
||||||
$updatemd5filelist = $updatefilelist['md5'];
|
$updatemd5filelist = $updatefilelist['md5'];
|
||||||
$updatefilelist = $updatefilelist['file'];
|
$updatefilelist = $updatefilelist['file'];
|
||||||
$theurl = $_G['siteurl'].ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&locale=' . $locale . '&charset=' . $charset;
|
$theurl = $_G['siteurl'].ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&locale=' . $locale . '&charset=' . $charset;
|
||||||
|
|
||||||
if (empty($updatefilelist)) {
|
if (empty($updatefilelist)) {
|
||||||
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_download_upgradelist_error', array('upgradeurl' => upgradeinformation(-2))) . '</p>';
|
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_download_upgradelist_error', array('upgradeurl' => upgradeinformation(-2))) . '</p>';
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($thurl) . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($thurl) . '\';", 1000);</script>';
|
||||||
$msg .= ' <p style="margin:10px 0"><a href="' . $thurl . '">' . lang('message_redirect') . '</p>';
|
$msg .= ' <p style="margin:10px 0"><a href="' . $thurl . '">' . lang('message_redirect') . '</p>';
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($step == 1) {
|
if ($step == 1) {
|
||||||
$linkurl = $theurl . '&step=2';
|
$linkurl = $theurl . '&step=2';
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
} elseif ($step == 2) {
|
} elseif ($step == 2) {
|
||||||
$fileseq = intval($_GET['fileseq']);
|
$fileseq = intval($_GET['fileseq']);
|
||||||
$fileseq = $fileseq ? $fileseq : 1;
|
$fileseq = $fileseq ? $fileseq : 1;
|
||||||
if ($fileseq > count($updatefilelist)) {
|
if ($fileseq > count($updatefilelist)) {
|
||||||
|
|
||||||
$linkurl = $theurl . '&step=3';
|
$linkurl = $theurl . '&step=3';
|
||||||
$downloadstatus = 3;
|
$downloadstatus = 3;
|
||||||
$msg = lang('upgrade_download_complete_to_compare', array('upgradeurl' => upgradeinformation(0)));
|
$msg = lang('upgrade_download_complete_to_compare', array('upgradeurl' => upgradeinformation(0)));
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 1000);</script>';
|
||||||
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
||||||
} else {
|
} else {
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("parent.location.href=\'' . $linkurl . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("parent.location.href=\'' . $linkurl . '\';", 1000);</script>';
|
||||||
$msg .= ' <p><a href="javascript:;" onclick="parent.location.href=\'' . $linkurl . '\';return false;">' . lang('message_redirect') . '</a></p>';
|
$msg .= ' <p><a href="javascript:;" onclick="parent.location.href=\'' . $linkurl . '\';return false;">' . lang('message_redirect') . '</a></p>';
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
$linkurl = $theurl . '&step=2&fileseq=' . $fileseq . '&iframe=1';
|
$linkurl = $theurl . '&step=2&fileseq=' . $fileseq . '&iframe=1';
|
||||||
$msg = '<iframe id="downiframe" marginheight="0" marginwidth="0" allowtransparency="true" frameborder="0" src="' . $linkurl . '" style="width:100%;height:100%;"></iframe>';
|
$msg = '<iframe id="downiframe" marginheight="0" marginwidth="0" allowtransparency="true" frameborder="0" src="' . $linkurl . '" style="width:100%;height:100%;"></iframe>';
|
||||||
} else {
|
} else {
|
||||||
$downloadstatus = $dzz_upgrade -> download_file($upgradeinfo, $updatefilelist[$fileseq - 1], 'upload', $updatemd5filelist[$fileseq - 1]);
|
$downloadstatus = $dzz_upgrade -> download_file($upgradeinfo, $updatefilelist[$fileseq - 1], 'upload', $updatemd5filelist[$fileseq - 1]);
|
||||||
if ($downloadstatus == 1) {
|
if ($downloadstatus == 1) {
|
||||||
$linkurl = $theurl . '&step=2&fileseq=' . $fileseq . '&iframe=1';
|
$linkurl = $theurl . '&step=2&fileseq=' . $fileseq . '&iframe=1';
|
||||||
$msg = lang('upgrade_downloading_file', array('file' => $updatefilelist[$fileseq - 1], 'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)) . '%', 'upgradeurl' => upgradeinformation(1))) . '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 10);</script>';
|
$msg = lang('upgrade_downloading_file', array('file' => $updatefilelist[$fileseq - 1], 'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)) . '%', 'upgradeurl' => upgradeinformation(1))) . '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 10);</script>';
|
||||||
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
||||||
|
|
||||||
} elseif ($downloadstatus == 2) {
|
} elseif ($downloadstatus == 2) {
|
||||||
$linkurl = $theurl . '&step=2&fileseq=' . ($fileseq + 1) . '&iframe=1';
|
$linkurl = $theurl . '&step=2&fileseq=' . ($fileseq + 1) . '&iframe=1';
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_downloading_file', array('file' => $updatefilelist[$fileseq - 1], 'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)) . '%', 'upgradeurl' => upgradeinformation(1))) . '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 10);</script></p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_downloading_file', array('file' => $updatefilelist[$fileseq - 1], 'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)) . '%', 'upgradeurl' => upgradeinformation(1))) . '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 10);</script></p>';
|
||||||
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
||||||
} else {
|
} else {
|
||||||
$linkurl = $theurl . '&step=2&fileseq=' . ($fileseq) . '&iframe=1';
|
$linkurl = $theurl . '&step=2&fileseq=' . ($fileseq) . '&iframe=1';
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_redownload', array('file' => $updatefilelist[$fileseq - 1], 'upgradeurl' => upgradeinformation(-3))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_redownload', array('file' => $updatefilelist[$fileseq - 1], 'upgradeurl' => upgradeinformation(-3))) . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0;"><input type="button" class="btn btn-success" value="'.lang('founder_upgrade_reset').'" onclick="location.href=\'' . $linkurl . '\'" />';
|
$msg .= '<p style="margin:10px 0;"><input type="button" class="btn btn-success" value="'.lang('founder_upgrade_reset').'" onclick="location.href=\'' . $linkurl . '\'" />';
|
||||||
}
|
}
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($step == 3) {
|
} elseif ($step == 3) {
|
||||||
list($modifylist, $showlist, $ignorelist,$newlist) = $dzz_upgrade -> compare_basefile($upgradeinfo, $updatefilelist,$updatemd5filelist);
|
list($modifylist, $showlist, $ignorelist,$newlist) = $dzz_upgrade -> compare_basefile($upgradeinfo, $updatefilelist,$updatemd5filelist);
|
||||||
if (empty($modifylist) && empty($showlist) && empty($ignorelist) && empty($newlist)) {
|
if (empty($modifylist) && empty($showlist) && empty($ignorelist) && empty($newlist)) {
|
||||||
$msg = lang('filecheck_nofound_md5file', array('upgradeurl' => upgradeinformation(-4)));
|
$msg = lang('filecheck_nofound_md5file', array('upgradeurl' => upgradeinformation(-4)));
|
||||||
}
|
}
|
||||||
$linkurl = $theurl . '&step=4';
|
$linkurl = $theurl . '&step=4';
|
||||||
} elseif ($step == 4) {
|
} elseif ($step == 4) {
|
||||||
|
|
||||||
$confirm = $_GET['confirm'];
|
$confirm = $_GET['confirm'];
|
||||||
if (!$confirm) {
|
if (!$confirm) {
|
||||||
if ($_GET['siteftpsetting']) {
|
if ($_GET['siteftpsetting']) {
|
||||||
$action = $theurl . '&step=4&confirm=ftp' . ($_GET['startupgrade'] ? '&startupgrade=1' : '');
|
$action = $theurl . '&step=4&confirm=ftp' . ($_GET['startupgrade'] ? '&startupgrade=1' : '');
|
||||||
|
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($upgradeinfo['isupdatedb']) {
|
if ($upgradeinfo['isupdatedb']) {
|
||||||
$checkupdatefilelist = array('install/update.php', 'install/data/install.sql', 'install/data/install_data.sql');
|
$checkupdatefilelist = array('install/update.php', 'install/data/install.sql', 'install/data/install_data.sql');
|
||||||
$checkupdatefilelist = array_merge($checkupdatefilelist, $updatefilelist);
|
$checkupdatefilelist = array_merge($checkupdatefilelist, $updatefilelist);
|
||||||
} else {
|
} else {
|
||||||
$checkupdatefilelist = $updatefilelist;
|
$checkupdatefilelist = $updatefilelist;
|
||||||
}
|
}
|
||||||
if ($dzz_upgrade -> check_folder_perm($checkupdatefilelist)) {
|
if ($dzz_upgrade -> check_folder_perm($checkupdatefilelist)) {
|
||||||
$confirm = 'file';
|
$confirm = 'file';
|
||||||
} else {
|
} else {
|
||||||
$linkurl = $theurl . '&step=4';
|
$linkurl = $theurl . '&step=4';
|
||||||
$ftplinkurl = $linkurl . '&siteftpsetting=1';
|
$ftplinkurl = $linkurl . '&siteftpsetting=1';
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_cannot_access_file') . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_cannot_access_file') . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_set_ftp') . '" />';
|
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_set_ftp') . '" />';
|
||||||
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_reset') . '" /></p>';
|
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_reset') . '" /></p>';
|
||||||
$msg .= "<script type=\"text/javascript\">";
|
$msg .= "<script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script>";
|
$msg .= "</script>";
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$paraftp = '';
|
$paraftp = '';
|
||||||
if ($_GET['siteftp']) {
|
if ($_GET['siteftp']) {
|
||||||
foreach ($_GET['siteftp'] as $k => $v) {
|
foreach ($_GET['siteftp'] as $k => $v) {
|
||||||
$paraftp .= '&siteftp[' . $k . ']=' . $v;
|
$paraftp .= '&siteftp[' . $k . ']=' . $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$_GET['startupgrade']) {
|
if (!$_GET['startupgrade']) {
|
||||||
if (!$_GET['backfile']) {
|
if (!$_GET['backfile']) {
|
||||||
$linkurl = $theurl . '&step=4&backfile=1&confirm=' . $confirm . $paraftp;
|
$linkurl = $theurl . '&step=4&backfile=1&confirm=' . $confirm . $paraftp;
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_backuping', array('upgradeurl' => upgradeinformation(2))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_backuping', array('upgradeurl' => upgradeinformation(2))) . '</p>';
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($linkurl) . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($linkurl) . '\';", 1000);</script>';
|
||||||
$msg .= ' <p style="margin:10px 0"><a href="' . $linkurl . '">' . lang('message_redirect') . '</p>';
|
$msg .= ' <p style="margin:10px 0"><a href="' . $linkurl . '">' . lang('message_redirect') . '</p>';
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
foreach ($updatefilelist as $updatefile) {
|
foreach ($updatefilelist as $updatefile) {
|
||||||
$destfile = DZZ_ROOT . $updatefile;
|
$destfile = DZZ_ROOT . $updatefile;
|
||||||
$backfile = DZZ_ROOT . './data/back/pichome' . CORE_VERSION . '/' . $updatefile;
|
$backfile = DZZ_ROOT . './data/back/pichome' . CORE_VERSION . '/' . $updatefile;
|
||||||
if (is_file($destfile)) {
|
if (is_file($destfile)) {
|
||||||
if (!$dzz_upgrade -> copy_file($destfile, $backfile, 'file')) {
|
if (!$dzz_upgrade -> copy_file($destfile, $backfile, 'file')) {
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_backup_error', array('upgradeurl' => upgradeinformation(-5))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_backup_error', array('upgradeurl' => upgradeinformation(-5))) . '</p>';
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_backup_complete', array('upgradeurl' => upgradeinformation(3))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_backup_complete', array('upgradeurl' => upgradeinformation(3))) . '</p>';
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp) . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp) . '\';", 1000);</script>';
|
||||||
$msg .= ' <p><a href="' . ($theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp) . '">' . lang('message_redirect') . '</p>';
|
$msg .= ' <p><a href="' . ($theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp) . '">' . lang('message_redirect') . '</p>';
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkurl = $theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp;
|
$linkurl = $theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp;
|
||||||
$ftplinkurl = $theurl . '&step=4&startupgrade=1&siteftpsetting=1';
|
$ftplinkurl = $theurl . '&step=4&startupgrade=1&siteftpsetting=1';
|
||||||
foreach ($updatefilelist as $updatefile) {
|
foreach ($updatefilelist as $updatefile) {
|
||||||
$srcfile = DZZ_ROOT . './data/update/pichome' . $version . '/' . $updatefile;
|
$srcfile = DZZ_ROOT . './data/update/pichome' . $version . '/' . $updatefile;
|
||||||
if ($confirm == 'ftp') {
|
if ($confirm == 'ftp') {
|
||||||
$destfile = $updatefile;
|
$destfile = $updatefile;
|
||||||
} else {
|
} else {
|
||||||
$destfile = DZZ_ROOT . $updatefile;
|
$destfile = DZZ_ROOT . $updatefile;
|
||||||
}
|
}
|
||||||
if (!$dzz_upgrade -> copy_file($srcfile, $destfile, $confirm)) {
|
if (!$dzz_upgrade -> copy_file($srcfile, $destfile, $confirm)) {
|
||||||
if ($confirm == 'ftp') {
|
if ($confirm == 'ftp') {
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_ftp_upload_error', array('file' => $updatefile, 'upgradeurl' => upgradeinformation(-6))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_ftp_upload_error', array('file' => $updatefile, 'upgradeurl' => upgradeinformation(-6))) . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_reupload') . '" />';
|
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_reupload') . '" />';
|
||||||
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_reset_ftp') . '" /></p>';
|
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_reset_ftp') . '" /></p>';
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_copy_error', array('file' => $updatefile, 'upgradeurl' => upgradeinformation(-7))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_copy_error', array('file' => $updatefile, 'upgradeurl' => upgradeinformation(-7))) . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_recopy') . '" />';
|
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_recopy') . '" />';
|
||||||
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_set_ftp') . '" /></p>';
|
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_set_ftp') . '" /></p>';
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($upgradeinfo['isupdatedb']) {
|
if ($upgradeinfo['isupdatedb']) {
|
||||||
|
|
||||||
$upgrade_step['step'] = 'dbupdate';
|
$upgrade_step['step'] = 'dbupdate';
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
||||||
$linkurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
$linkurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_file_successful', array('upgradeurl' => upgradeinformation(4))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_file_successful', array('upgradeurl' => upgradeinformation(4))) . '</p>';
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout(function(){createIframe(\'' . $linkurl . '\');}, 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout(function(){createIframe(\'' . $linkurl . '\');}, 1000);</script>';
|
||||||
$msg .= ' <p><a href="javascript:;" onclick="createIframe(\'' . $linkurl . '\');return false">' . lang('message_redirect') . '</p>';
|
$msg .= ' <p><a href="javascript:;" onclick="createIframe(\'' . $linkurl . '\');return false">' . lang('message_redirect') . '</p>';
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = outputurl( $_G['siteurl'].MOD_URL.'&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5' );
|
$url = outputurl( $_G['siteurl'].MOD_URL.'&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5' );
|
||||||
dheader('Location: ' . $url);
|
dheader('Location: ' . $url);
|
||||||
|
|
||||||
} elseif ($step == 5) {
|
} elseif ($step == 5) {
|
||||||
$file = DZZ_ROOT . './data/update/pichome' . $version . '/updatelist.tmp';
|
$file = DZZ_ROOT . './data/update/pichome' . $version . '/updatelist.tmp';
|
||||||
@unlink($file);
|
@unlink($file);
|
||||||
@unlink(DZZ_ROOT . './install/update.php');
|
@unlink(DZZ_ROOT . './install/update.php');
|
||||||
C::t('cache') -> delete('upgrade_step');
|
C::t('cache') -> delete('upgrade_step');
|
||||||
C::t('cache') -> delete('upgrade_run');
|
C::t('cache') -> delete('upgrade_run');
|
||||||
C::t('setting') -> update('upgrade', '');
|
C::t('setting') -> update('upgrade', '');
|
||||||
updatecache('setting');
|
updatecache('setting');
|
||||||
$old_update_dir = './data/update/';
|
$old_update_dir = './data/update/';
|
||||||
$new_update_dir = './data/update' . md5('update' . $_G['config']['security']['authkey']) . '/';
|
$new_update_dir = './data/update' . md5('update' . $_G['config']['security']['authkey']) . '/';
|
||||||
$old_back_dir = './data/back/';
|
$old_back_dir = './data/back/';
|
||||||
$new_back_dir = './data/back' . md5('back' . $_G['config']['security']['authkey']) . '/';
|
$new_back_dir = './data/back' . md5('back' . $_G['config']['security']['authkey']) . '/';
|
||||||
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_update_dir, DZZ_ROOT . $new_update_dir);
|
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_update_dir, DZZ_ROOT . $new_update_dir);
|
||||||
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_back_dir, DZZ_ROOT . $new_back_dir);
|
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_back_dir, DZZ_ROOT . $new_back_dir);
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_back_dir);
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_back_dir);
|
||||||
|
|
||||||
$msg = lang('upgrade_successful', array('version' => $version, 'save_update_dir' => $new_update_dir, 'save_back_dir' => $new_back_dir, 'upgradeurl' => upgradeinformation(0)));
|
$msg = lang('upgrade_successful', array('version' => $version, 'save_update_dir' => $new_update_dir, 'save_back_dir' => $new_back_dir, 'upgradeurl' => upgradeinformation(0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif ($operation == 'check') {
|
elseif ($operation == 'check') {
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (!intval($_GET['rechecking'])) {
|
if (!intval($_GET['rechecking'])) {
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
if (!empty($upgrade_step['cachevalue'])) {
|
if (!empty($upgrade_step['cachevalue'])) {
|
||||||
$upgrade_step['cachevalue'] = dunserialize($upgrade_step['cachevalue']);
|
$upgrade_step['cachevalue'] = dunserialize($upgrade_step['cachevalue']);
|
||||||
if (!empty($upgrade_step['cachevalue']['step'])) {
|
if (!empty($upgrade_step['cachevalue']['step'])) {
|
||||||
$theurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $upgrade_step['cachevalue']['operation'] . '&version=' . $upgrade_step['cachevalue']['version'] . '&locale=' . $upgrade_step['cachevalue']['locale'] . '&charset=' . $upgrade_step['cachevalue']['charset'];
|
$theurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $upgrade_step['cachevalue']['operation'] . '&version=' . $upgrade_step['cachevalue']['version'] . '&locale=' . $upgrade_step['cachevalue']['locale'] . '&charset=' . $upgrade_step['cachevalue']['charset'];
|
||||||
|
|
||||||
$recheckurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=recheck';
|
$recheckurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=recheck';
|
||||||
if ($upgrade_step['cachevalue']['step'] == 'dbupdate') {
|
if ($upgrade_step['cachevalue']['step'] == 'dbupdate') {
|
||||||
$dbreturnurl = $_G['siteurl'] . $theurl . '&step=5';
|
$dbreturnurl = $_G['siteurl'] . $theurl . '&step=5';
|
||||||
$stepurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
$stepurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
||||||
$msg = '<p style="margin:10px 0;">' . lang('upgrade_continue_db', array('steplang' => $steplang['dbupdate'], 'stepurl' => $stepurl, 'recheckurl' => $recheckurl)) . '</p>';
|
$msg = '<p style="margin:10px 0;">' . lang('upgrade_continue_db', array('steplang' => $steplang['dbupdate'], 'stepurl' => $stepurl, 'recheckurl' => $recheckurl)) . '</p>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$stepurl = $theurl . '&step=' . $upgrade_step['cachevalue']['step'];
|
$stepurl = $theurl . '&step=' . $upgrade_step['cachevalue']['step'];
|
||||||
$msg = '<p style="margin:10px 0;">' . lang('upgrade_continue', array('steplang' => $steplang[$upgrade_step['cachevalue']['step']], 'stepurl' => $stepurl, 'recheckurl' => $recheckurl)) . '</p>';
|
$msg = '<p style="margin:10px 0;">' . lang('upgrade_continue', array('steplang' => $steplang[$upgrade_step['cachevalue']['step']], 'stepurl' => $stepurl, 'recheckurl' => $recheckurl)) . '</p>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
C::t('cache') -> delete('upgrade_step');
|
C::t('cache') -> delete('upgrade_step');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!intval($_GET['checking']) || $msg) {
|
if (!intval($_GET['checking']) || $msg) {
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$dzz_upgrade -> check_upgrade();
|
$dzz_upgrade -> check_upgrade();
|
||||||
$url = outputurl( $_G['siteurl'].MOD_URL.'&op=systemupgrade&operation=showupgrade' );
|
$url = outputurl( $_G['siteurl'].MOD_URL.'&op=systemupgrade&operation=showupgrade' );
|
||||||
dheader('Location: ' . $url);
|
dheader('Location: ' . $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif ($operation == 'showupgrade') {
|
elseif ($operation == 'showupgrade') {
|
||||||
|
|
||||||
if ($_G['setting']['upgrade']) {
|
if ($_G['setting']['upgrade']) {
|
||||||
|
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize(array('curversion' => $dzz_upgrade -> versionpath())), 'dateline' => $_G['timestamp'], ), false, true);
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize(array('curversion' => $dzz_upgrade -> versionpath())), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
|
|
||||||
$upgraderow = $patchrow = array();
|
$upgraderow = $patchrow = array();
|
||||||
$charset = str_replace('-', '', strtoupper($_G['config']['output']['charset']));
|
$charset = str_replace('-', '', strtoupper($_G['config']['output']['charset']));
|
||||||
$dbversion = helper_dbtool::dbversion();
|
$dbversion = helper_dbtool::dbversion();
|
||||||
$locale = '';
|
$locale = '';
|
||||||
|
|
||||||
if ($charset == 'BIG5') {
|
if ($charset == 'BIG5') {
|
||||||
$locale = 'TC';
|
$locale = 'TC';
|
||||||
} elseif ($charset == 'GBK') {
|
} elseif ($charset == 'GBK') {
|
||||||
$locale = 'SC';
|
$locale = 'SC';
|
||||||
} elseif ($charset == 'UTF8') {
|
} elseif ($charset == 'UTF8') {
|
||||||
if ($_G['config']['output']['language'] == 'zh-cn' || $_G['config']['output']['language'] == 'zh_cn') {
|
if ($_G['config']['output']['language'] == 'zh-cn' || $_G['config']['output']['language'] == 'zh_cn') {
|
||||||
$locale = 'SC';
|
$locale = 'SC';
|
||||||
} elseif ($_G['config']['output']['language'] == 'zh-tw' || $_G['config']['output']['language'] == 'zh_tw') {
|
} elseif ($_G['config']['output']['language'] == 'zh-tw' || $_G['config']['output']['language'] == 'zh_tw') {
|
||||||
$locale = 'TC';
|
$locale = 'TC';
|
||||||
}else{
|
}else{
|
||||||
$locale = 'SC';
|
$locale = 'SC';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($_G['setting']['upgrade']))
|
if (!is_array($_G['setting']['upgrade']))
|
||||||
$_G['setting']['upgrade'] = unserialize($_G['setting']['upgrade']);
|
$_G['setting']['upgrade'] = unserialize($_G['setting']['upgrade']);
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($_G['setting']['upgrade'] as $type => $upgrade) {
|
foreach ($_G['setting']['upgrade'] as $type => $upgrade) {
|
||||||
$unupgrade = 0;
|
$unupgrade = 0;
|
||||||
if (version_compare($upgrade['phpversion'], PHP_VERSION) > 0 || version_compare($upgrade['mysqlversion'], $dbversion) > 0) {
|
if (version_compare($upgrade['phpversion'], PHP_VERSION) > 0 || version_compare($upgrade['mysqlversion'], $dbversion) > 0) {
|
||||||
$unupgrade = 1;
|
$unupgrade = 1;
|
||||||
}
|
}
|
||||||
$list[$type]['linkurl'] = $linkurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $type . '&version=' . $upgrade['latestversion'] . '&locale=' . $locale . '&charset=' . $charset;
|
$list[$type]['linkurl'] = $linkurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $type . '&version=' . $upgrade['latestversion'] . '&locale=' . $locale . '&charset=' . $charset;
|
||||||
if ($unupgrade) {
|
if ($unupgrade) {
|
||||||
$list[$type]['title'] = 'oaooa PicHome' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
$list[$type]['title'] = 'oaooa PicHome' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
||||||
$list[$type]['btn1'] = lang('founder_upgrade_require_config') . ' php v' . PHP_VERSION . 'MYSQL v' . $dbversion;
|
$list[$type]['btn1'] = lang('founder_upgrade_require_config') . ' php v' . PHP_VERSION . 'MYSQL v' . $dbversion;
|
||||||
} else {
|
} else {
|
||||||
$list[$type]['title'] = 'oaooa PicHome' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
$list[$type]['title'] = 'oaooa PicHome' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
||||||
$list[$type]['btn1'] = '<input type="button" class="btn btn-success" onclick="confirm(\'' . lang('founder_upgrade_backup_remind') . '\') ? window.location.href=\'' . $linkurl . '\' : \'\';" value="' . lang('founder_upgrade_automatically') . '">';
|
$list[$type]['btn1'] = '<input type="button" class="btn btn-success" onclick="confirm(\'' . lang('founder_upgrade_backup_remind') . '\') ? window.location.href=\'' . $linkurl . '\' : \'\';" value="' . lang('founder_upgrade_automatically') . '">';
|
||||||
$list[$type]['official'] = '<a class="btn btn-link" href="' . $upgrade['official'] . '" target="_blank">' . lang('founder_upgrade_manually') . '</a>';
|
$list[$type]['official'] = '<a class="btn btn-link" href="' . $upgrade['official'] . '" target="_blank">' . lang('founder_upgrade_manually') . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$msg = lang('upgrade_latest_version');
|
$msg = lang('upgrade_latest_version');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif ($operation == 'recheck') {
|
elseif ($operation == 'recheck') {
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
||||||
$file = DZZ_ROOT . './data/update/pichome' . $upgrade_step['version'] . '/updatelist.tmp';
|
$file = DZZ_ROOT . './data/update/pichome' . $upgrade_step['version'] . '/updatelist.tmp';
|
||||||
@unlink($file);
|
@unlink($file);
|
||||||
@unlink(DZZ_ROOT . './install/update.php');
|
@unlink(DZZ_ROOT . './install/update.php');
|
||||||
C::t('cache') -> delete('upgrade_step');
|
C::t('cache') -> delete('upgrade_step');
|
||||||
C::t('cache') -> delete('upgrade_run');
|
C::t('cache') -> delete('upgrade_run');
|
||||||
C::t('setting') -> update('upgrade', '');
|
C::t('setting') -> update('upgrade', '');
|
||||||
updatecache('setting');
|
updatecache('setting');
|
||||||
$old_update_dir = './data/update/';
|
$old_update_dir = './data/update/';
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
||||||
|
|
||||||
$url = outputurl($_G['siteurl'].MOD_URL.'&op=systemupgrade' );
|
$url = outputurl($_G['siteurl'].MOD_URL.'&op=systemupgrade' );
|
||||||
dheader('Location: ' . $url);
|
dheader('Location: ' . $url);
|
||||||
}
|
}
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
?>
|
?>
|
||||||
@@ -1,188 +1,188 @@
|
|||||||
<!--{template common/header_simple_start}-->
|
<!--{template common/header_simple_start}-->
|
||||||
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
|
|
||||||
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
||||||
<script src="admin/scripts/admin.js?{VERHASH}"></script>
|
<script src="admin/scripts/admin.js?{VERHASH}"></script>
|
||||||
<style>
|
<style>
|
||||||
input[type="text"] {
|
input[type="text"] {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
ul.help-block, ul.help-block li, .help-block li{
|
ul.help-block, ul.help-block li, .help-block li{
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<!--{template common/header_simple_end}-->
|
<!--{template common/header_simple_end}-->
|
||||||
<!--{template common/commer_header}-->
|
<!--{template common/commer_header}-->
|
||||||
<div class="bs-container clearfix">
|
<div class="bs-container clearfix">
|
||||||
<div class="bs-left-container clearfix">
|
<div class="bs-left-container clearfix">
|
||||||
<!--{template left}-->
|
<!--{template left}-->
|
||||||
</div>
|
</div>
|
||||||
<div class="left-drager">
|
<div class="left-drager">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bs-main-container clearfix">
|
<div class="bs-main-container clearfix">
|
||||||
<div class="main-header clearfix">
|
<div class="main-header clearfix">
|
||||||
<ul class="nav nav-pills nav-pills-bottomguide">
|
<ul class="nav nav-pills nav-pills-bottomguide">
|
||||||
<li <!--{if empty($_GET[ 'edit']) && empty($_GET[ 'run'])}-->class="active"<!--{/if}-->>
|
<li <!--{if empty($_GET[ 'edit']) && empty($_GET[ 'run'])}-->class="active"<!--{/if}-->>
|
||||||
<a hidefocus="true" href="{BASESCRIPT}?mod={MOD_NAME}&op=cron">{lang cron}</a>
|
<a hidefocus="true" href="{BASESCRIPT}?mod={MOD_NAME}&op=cron">{lang cron}</a>
|
||||||
</li>
|
</li>
|
||||||
<!--{if !empty($_GET['edit'])}-->
|
<!--{if !empty($_GET['edit'])}-->
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a hidefocus="true" href="{BASESCRIPT}?mod={MOD_NAME}&op=cron&edit=$_GET[edit]">{lang misc_cron_edit}</a>
|
<a hidefocus="true" href="{BASESCRIPT}?mod={MOD_NAME}&op=cron&edit=$_GET[edit]">{lang misc_cron_edit}</a>
|
||||||
</li>
|
</li>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{if !empty($_GET['run'])}-->
|
<!--{if !empty($_GET['run'])}-->
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a hidefocus="true" href="{BASESCRIPT}?mod={MOD_NAME}&op=cron&run=$_GET[run]">{lang misc_cron_operation}</a>
|
<a hidefocus="true" href="{BASESCRIPT}?mod={MOD_NAME}&op=cron&run=$_GET[run]">{lang misc_cron_operation}</a>
|
||||||
</li>
|
</li>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="main-content" style="padding:15px;border-top:1px solid #FFF">
|
<div class="main-content" style="padding:15px;border-top:1px solid #FFF">
|
||||||
<!--{if $msg}-->
|
<!--{if $msg}-->
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<p class="$msg_type">$msg</p>
|
<p class="$msg_type">$msg</p>
|
||||||
<!--{if $redirecturl}-->
|
<!--{if $redirecturl}-->
|
||||||
<p class="text-info">
|
<p class="text-info">
|
||||||
<a href="{$redirecturl}" class="lightlink">{lang message_redirect}</a>
|
<a href="{$redirecturl}" class="lightlink">{lang message_redirect}</a>
|
||||||
</p>
|
</p>
|
||||||
<script type="text/JavaScript">setTimeout(function(){location.href='{$redirecturl}';}, 2000);</script>
|
<script type="text/JavaScript">setTimeout(function(){location.href='{$redirecturl}';}, 2000);</script>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<!--{if $_GET['edit']>0}-->
|
<!--{if $_GET['edit']>0}-->
|
||||||
<ul class="help-block">
|
<ul class="help-block">
|
||||||
<h4>{lang board_message}</h4> {lang misc_cron_edit_tips}
|
<h4>{lang board_message}</h4> {lang misc_cron_edit_tips}
|
||||||
</ul>
|
</ul>
|
||||||
<form id="cpform" action="{BASESCRIPT}?mod=system&op=cron&edit=$cronid" class="form-horizontal form-horizontal-left" method="post" name="cpform">
|
<form id="cpform" action="{BASESCRIPT}?mod=system&op=cron&edit=$cronid" class="form-horizontal form-horizontal-left" method="post" name="cpform">
|
||||||
<input type="hidden" value="{FORMHASH}" name="formhash">
|
<input type="hidden" value="{FORMHASH}" name="formhash">
|
||||||
<input type="hidden" value="true" name="editsubmit">
|
<input type="hidden" value="true" name="editsubmit">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang weekly}:</dt>
|
<dt>{lang weekly}:</dt>
|
||||||
<dd class="clearfix">
|
<dd class="clearfix">
|
||||||
<select name="weekdaynew" class="form-control">
|
<select name="weekdaynew" class="form-control">
|
||||||
<option value="-1" selected="selected">*</option>
|
<option value="-1" selected="selected">*</option>
|
||||||
$weekdayselect
|
$weekdayselect
|
||||||
</select>
|
</select>
|
||||||
<span class="help-inline">{lang misc_cron_edit_weekday_comment}</span>
|
<span class="help-inline">{lang misc_cron_edit_weekday_comment}</span>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang everyday}:</dt>
|
<dt>{lang everyday}:</dt>
|
||||||
<dd class="clearfix">
|
<dd class="clearfix">
|
||||||
<select name="daynew" class="form-control">
|
<select name="daynew" class="form-control">
|
||||||
<option value="-1" selected="selected">*</option>
|
<option value="-1" selected="selected">*</option>
|
||||||
$dayselect
|
$dayselect
|
||||||
</select>
|
</select>
|
||||||
<span class="help-inline">{lang misc_cron_edit_day_comment}</span>
|
<span class="help-inline">{lang misc_cron_edit_day_comment}</span>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang hour}:</dt>
|
<dt>{lang hour}:</dt>
|
||||||
<dd class="clearfix">
|
<dd class="clearfix">
|
||||||
<select name="hournew" class="form-control">
|
<select name="hournew" class="form-control">
|
||||||
<option value="-1" selected="selected">*</option>
|
<option value="-1" selected="selected">*</option>
|
||||||
$hourselect
|
$hourselect
|
||||||
</select>
|
</select>
|
||||||
<span class="help-inline">{lang misc_cron_edit_hour_comment}</span>
|
<span class="help-inline">{lang misc_cron_edit_hour_comment}</span>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang minute}:</dt>
|
<dt>{lang minute}:</dt>
|
||||||
<dd class="clearfix">
|
<dd class="clearfix">
|
||||||
<input name="minutenew" value="{eval echo implode(',',$cron[minute])}" type="text" class="form-control">
|
<input name="minutenew" value="{eval echo implode(',',$cron[minute])}" type="text" class="form-control">
|
||||||
<span class="help-inline">{lang misc_cron_edit_minute_comment}</span>
|
<span class="help-inline">{lang misc_cron_edit_minute_comment}</span>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang misc_cron_edit_filename}:</dt>
|
<dt>{lang misc_cron_edit_filename}:</dt>
|
||||||
<dd class="clearfix">
|
<dd class="clearfix">
|
||||||
<input name="filenamenew" value="$cron[filename]" type="text" class="form-control">
|
<input name="filenamenew" value="$cron[filename]" type="text" class="form-control">
|
||||||
<span class="help-inline">{lang misc_cron_edit_filename_comment}</span>
|
<span class="help-inline">{lang misc_cron_edit_filename_comment}</span>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dd class="clearfix">
|
<dd class="clearfix">
|
||||||
<button type="submit" class="btn btn-primary" name="exportsubmit" value="true">{lang blank_submit}</button>
|
<button type="submit" class="btn btn-primary" name="exportsubmit" value="true">{lang blank_submit}</button>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</form>
|
</form>
|
||||||
<!--{elseif $_GET['run']}-->
|
<!--{elseif $_GET['run']}-->
|
||||||
|
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<ul class="help-block">
|
<ul class="help-block">
|
||||||
<h5>{lang board_message}</h5> {lang misc_cron_tips}
|
<h5>{lang board_message}</h5> {lang misc_cron_tips}
|
||||||
<li class="text-danger mt10">计划任务默认通过用户访问触发。缺点是影响用户访问体验;计划任务执行不及时。可以修改config.php文件,设置参数 {eval echo '$_config[remote][on]=1; $_config[remote][cron]=1;';} 停止这种触发方式。</li>
|
<li class="text-danger mt10">计划任务默认通过用户访问触发。缺点是影响用户访问体验;计划任务执行不及时。可以修改config.php文件,设置参数 {eval echo '$_config[remote][on]=1; $_config[remote][cron]=1;';} 停止这种触发方式。</li>
|
||||||
<li class="text-danger">推荐设置通过系统计划任务来触发。如linux系统,可以修改/etc/crontab,加入一行 * * * * root php {eval echo DZZ_ROOT.'cron.php >>/dev/null 2>$1';}</li>
|
<li class="text-danger">推荐设置通过系统计划任务来触发。如linux系统,可以修改/etc/crontab,加入一行 * * * * root php {eval echo DZZ_ROOT.'cron.php >>/dev/null 2>$1';}</li>
|
||||||
<li>详细请查阅官方文档 <a href="http://help.oaooa.com/corpus/list?cid=24#fid_330" target="_blank">管理员手册-计划任务</a> 中的相关内容</li>
|
<li>详细请查阅官方文档 <a href="http://help.oaooa.com/corpus/list?cid=24#fid_330" target="_blank">管理员手册-计划任务</a> 中的相关内容</li>
|
||||||
</ul>
|
</ul>
|
||||||
<form id="cpform" action="{BASESCRIPT}?mod=system&op=cron" class="form-horizontal form-horizontal-left" method="post" name="cpform">
|
<form id="cpform" action="{BASESCRIPT}?mod=system&op=cron" class="form-horizontal form-horizontal-left" method="post" name="cpform">
|
||||||
<input type="hidden" value="{FORMHASH}" name="formhash">
|
<input type="hidden" value="{FORMHASH}" name="formhash">
|
||||||
<input type="hidden" value="true" name="cronssubmit">
|
<input type="hidden" value="true" name="cronssubmit">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<th width="45"></th>
|
<th width="45"></th>
|
||||||
<th>{lang name}</th>
|
<th>{lang name}</th>
|
||||||
<th>{lang available}</th>
|
<th>{lang available}</th>
|
||||||
<th>{lang type}</th>
|
<th>{lang type}</th>
|
||||||
<th>{lang time}</th>
|
<th>{lang time}</th>
|
||||||
<th>{lang misc_cron_last_run}</th>
|
<th>{lang misc_cron_last_run}</th>
|
||||||
<th>{lang misc_cron_next_run}</th>
|
<th>{lang misc_cron_next_run}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</thead>
|
</thead>
|
||||||
<!--{loop $crons $cron}-->
|
<!--{loop $crons $cron}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right"><input type="checkbox" name="delete[]" value="$cron[cronid]" <!--{if $cron[type]=='system' }-->disabled
|
<td align="right"><input type="checkbox" name="delete[]" value="$cron[cronid]" <!--{if $cron[type]=='system' }-->disabled
|
||||||
<!--{/if}-->></td>
|
<!--{/if}-->></td>
|
||||||
<td>
|
<td>
|
||||||
<p class="clearfix">
|
<p class="clearfix">
|
||||||
<input type="text" name="namenew[{$cron[cronid]}]" class="form-control" value="$cron[name]"></p>
|
<input type="text" name="namenew[{$cron[cronid]}]" class="form-control" value="$cron[name]"></p>
|
||||||
<strong>$cron[filename]</strong>
|
<strong>$cron[filename]</strong>
|
||||||
</td>
|
</td>
|
||||||
<td><label class="checkbox-inline"><input type="checkbox" name="availablenew[{$cron[cronid]}]" value="1" <!--{if $cron[available]>0}-->checked="checked"<!--{/if}-->></label></td>
|
<td><label class="checkbox-inline"><input type="checkbox" name="availablenew[{$cron[cronid]}]" value="1" <!--{if $cron[available]>0}-->checked="checked"<!--{/if}-->></label></td>
|
||||||
<td>
|
<td>
|
||||||
<!--{if $cron['type'] == 'system'}-->
|
<!--{if $cron['type'] == 'system'}-->
|
||||||
{lang inbuilt}
|
{lang inbuilt}
|
||||||
<!--{elseif $cron['type'] == 'user'}-->
|
<!--{elseif $cron['type'] == 'user'}-->
|
||||||
{lang custom}
|
{lang custom}
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</td>
|
</td>
|
||||||
<td>$cron[time]</td>
|
<td>$cron[time]</td>
|
||||||
<td>$cron[lastrun]</td>
|
<td>$cron[lastrun]</td>
|
||||||
<td>$cron[nextrun]</td>
|
<td>$cron[nextrun]</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a href="{BASESCRIPT}?mod=system&op=cron&edit=$cron[cronid]">{lang edit}</a>
|
<a href="{BASESCRIPT}?mod=system&op=cron&edit=$cron[cronid]">{lang edit}</a>
|
||||||
<br />
|
<br />
|
||||||
<!--{if $cron['run']}-->
|
<!--{if $cron['run']}-->
|
||||||
<a href="{BASESCRIPT}?mod=system&op=cron&run=$cron[cronid]">{lang execute}</a>
|
<a href="{BASESCRIPT}?mod=system&op=cron&run=$cron[cronid]">{lang execute}</a>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<a href="javascript:;" class="text-muted">{lang execute}</a>
|
<a href="javascript:;" class="text-muted">{lang execute}</a>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>{lang add_new}</td>
|
<td>{lang add_new}</td>
|
||||||
<td colspan="10"><input type="text" name="newname" value="" class="form-control"></td>
|
<td colspan="10"><input type="text" name="newname" value="" class="form-control"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="15" style="border-bottom:none"><label class="checkbox-inline ml20"><input type="checkbox" name="chkall" id="chkallspKI" onclick="checkAll('prefix', this.form, 'delete')">{lang del}</label> <button type="submit" class="btn btn-primary" name="exportsubmit" value="true">{lang blank_submit}</button>
|
<td colspan="15" style="border-bottom:none"><label class="checkbox-inline ml20"><input type="checkbox" name="chkall" id="chkallspKI" onclick="checkAll('prefix', this.form, 'delete')">{lang del}</label> <button type="submit" class="btn btn-primary" name="exportsubmit" value="true">{lang blank_submit}</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.left-drager').leftDrager_layout();
|
jQuery('.left-drager').leftDrager_layout();
|
||||||
</script>
|
</script>
|
||||||
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
||||||
<!--{template common/footer_simple}-->
|
<!--{template common/footer_simple}-->
|
||||||
@@ -1,236 +1,236 @@
|
|||||||
<!--{template common/header_simple_start}-->
|
<!--{template common/header_simple_start}-->
|
||||||
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
|
|
||||||
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
||||||
<script src="admin/scripts/admin.js?{VERHASH}"></script>
|
<script src="admin/scripts/admin.js?{VERHASH}"></script>
|
||||||
<!--{template common/header_simple_end}-->
|
<!--{template common/header_simple_end}-->
|
||||||
<!--{template common/commer_header}-->
|
<!--{template common/commer_header}-->
|
||||||
<div class="bs-container clearfix">
|
<div class="bs-container clearfix">
|
||||||
<div class="bs-left-container clearfix">
|
<div class="bs-left-container clearfix">
|
||||||
<!--{template left}-->
|
<!--{template left}-->
|
||||||
</div>
|
</div>
|
||||||
<div class="left-drager">
|
<div class="left-drager">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bs-main-container clearfix">
|
<div class="bs-main-container clearfix">
|
||||||
<div class="main-header clearfix">
|
<div class="main-header clearfix">
|
||||||
<ul class="nav nav-pills nav-pills-bottomguide">
|
<ul class="nav nav-pills nav-pills-bottomguide">
|
||||||
<li <!--{if $operation=='export' }-->class="active"<!--{/if}-->>
|
<li <!--{if $operation=='export' }-->class="active"<!--{/if}-->>
|
||||||
<a hidefocus="true" href="{MOD_URL}&op=database&operation=export">{lang export}</a>
|
<a hidefocus="true" href="{MOD_URL}&op=database&operation=export">{lang export}</a>
|
||||||
</li>
|
</li>
|
||||||
<li <!--{if $operation=='import' }-->class="active"<!--{/if}-->>
|
<li <!--{if $operation=='import' }-->class="active"<!--{/if}-->>
|
||||||
<a hidefocus="true" href="{MOD_URL}&op=database&operation=import">{lang nav_db_import}</a>
|
<a hidefocus="true" href="{MOD_URL}&op=database&operation=import">{lang nav_db_import}</a>
|
||||||
</li>
|
</li>
|
||||||
<li <!--{if $operation=='runquery' }-->class="active"<!--{/if}-->>
|
<li <!--{if $operation=='runquery' }-->class="active"<!--{/if}-->>
|
||||||
<a hidefocus="true" href="{MOD_URL}&op=database&operation=runquery">{lang nav_db_runquery}</a>
|
<a hidefocus="true" href="{MOD_URL}&op=database&operation=runquery">{lang nav_db_runquery}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!--{if $operation=='export'}-->
|
<!--{if $operation=='export'}-->
|
||||||
<ul class="help-block mt20">
|
<ul class="help-block mt20">
|
||||||
<h5>{lang board_message}</h5> {lang db_export_tips}
|
<h5>{lang board_message}</h5> {lang db_export_tips}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<!--{if !$submit}-->
|
<!--{if !$submit}-->
|
||||||
|
|
||||||
<form id="cpform" action="{MOD_URL}&op=database&operation=export&setup=1" class="form-horizontal form-horizontal-left" method="post" name="cpform">
|
<form id="cpform" action="{MOD_URL}&op=database&operation=export&setup=1" class="form-horizontal form-horizontal-left" method="post" name="cpform">
|
||||||
<input type="hidden" value="{FORMHASH}" name="formhash">
|
<input type="hidden" value="{FORMHASH}" name="formhash">
|
||||||
<input type="hidden" value="true" name="exportsubmit">
|
<input type="hidden" value="true" name="exportsubmit">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_export_type}:</dt>
|
<dt>{lang db_export_type}:</dt>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="type" value="dzz" checked="" onclick="document.getElementById('showtables').style.display = 'none';">{lang all_data_table}</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="type" value="dzz" checked="" onclick="document.getElementById('showtables').style.display = 'none';">{lang all_data_table}</label></dd>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="type" value="custom" onclick="document.getElementById('showtables').style.display = '';">{lang db_export_custom}</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="type" value="custom" onclick="document.getElementById('showtables').style.display = '';">{lang db_export_custom}</label></dd>
|
||||||
<dd id="showtables" class="clearfix" style="display:none;border:1px solid #D2D2D2">
|
<dd id="showtables" class="clearfix" style="display:none;border:1px solid #D2D2D2">
|
||||||
<h4 class="clearfix ml20"> <label class="checkbox-inline" for ="chkalltables"><input name="chkall" onclick="checkAll('prefix', this.form, 'customtables', 'chkall', true)" checked="checked" type="checkbox" id="chkalltables">{lang check_all_data_table}</label></h4>
|
<h4 class="clearfix ml20"> <label class="checkbox-inline" for ="chkalltables"><input name="chkall" onclick="checkAll('prefix', this.form, 'customtables', 'chkall', true)" checked="checked" type="checkbox" id="chkalltables">{lang check_all_data_table}</label></h4>
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<!--{loop $dztables $value}-->
|
<!--{loop $dztables $value}-->
|
||||||
<li class="col-xs-4"><label class="checkbox-inline"><input type="checkbox" name="customtables[]" value="$value" checked="checked">$value</label></li>
|
<li class="col-xs-4"><label class="checkbox-inline"><input type="checkbox" name="customtables[]" value="$value" checked="checked">$value</label></li>
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<div id="advanceoption" style="display:none">
|
<div id="advanceoption" style="display:none">
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_export_method}:</dt>
|
<dt>{lang db_export_method}:</dt>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="method" value="shell" onclick="if('0') {if(this.form.sqlcompat[2].checked==true) this.form.sqlcompat[0].checked=true; this.form.sqlcompat[2].disabled=true; this.form.sizelimit.disabled=true;} else {this.form.sqlcharset[0].checked=true; for(var i=1; i<=5; i++) {if(this.form.sqlcharset[i]) this.form.sqlcharset[i].disabled=true;}}" id="method_shell">{lang db_export_shell}</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="method" value="shell" onclick="if('0') {if(this.form.sqlcompat[2].checked==true) this.form.sqlcompat[0].checked=true; this.form.sqlcompat[2].disabled=true; this.form.sizelimit.disabled=true;} else {this.form.sqlcharset[0].checked=true; for(var i=1; i<=5; i++) {if(this.form.sqlcharset[i]) this.form.sqlcharset[i].disabled=true;}}" id="method_shell">{lang db_export_shell}</label></dd>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="method" value="multivol" checked="checked" onclick="this.form.sqlcompat[2].disabled=false; this.form.sizelimit.disabled=false; for(var i=1; i<=5; i++) {if(this.form.sqlcharset[i]) this.form.sqlcharset[i].disabled=false;}" id="method_multivol">{lang db_export_multivol}</label>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="method" value="multivol" checked="checked" onclick="this.form.sqlcompat[2].disabled=false; this.form.sizelimit.disabled=false; for(var i=1; i<=5; i++) {if(this.form.sqlcharset[i]) this.form.sqlcharset[i].disabled=false;}" id="method_multivol">{lang db_export_multivol}</label>
|
||||||
<input type="text" class="input-sm form-control" style="width:50px;" name="sizelimit" value="2048">
|
<input type="text" class="input-sm form-control" style="width:50px;" name="sizelimit" value="2048">
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_export_options_extended_insert}:</dt>
|
<dt>{lang db_export_options_extended_insert}:</dt>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="extendins" value="1">{lang yes}</label><label class="radio radio-inline"><input type="radio" name="extendins" value="0" checked="checked">{lang no}</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="extendins" value="1">{lang yes}</label><label class="radio radio-inline"><input type="radio" name="extendins" value="0" checked="checked">{lang no}</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_export_options_sql_compatible}:</dt>
|
<dt>{lang db_export_options_sql_compatible}:</dt>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="sqlcompat" value="" checked="">{lang default}</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="sqlcompat" value="" checked="">{lang default}</label></dd>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="sqlcompat" value="MYSQL40"> MySQL 3.23/4.0.x</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="sqlcompat" value="MYSQL40"> MySQL 3.23/4.0.x</label></dd>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="sqlcompat" value="MYSQL41" disabled=""> MySQL 4.1.x/5.x</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="sqlcompat" value="MYSQL41" disabled=""> MySQL 4.1.x/5.x</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_export_options_charset}:</dt>
|
<dt>{lang db_export_options_charset}:</dt>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="sqlcharset" value="">{lang db_export_options_charset}</label>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="sqlcharset" value="">{lang db_export_options_charset}</label>
|
||||||
<label class="radio radio-inline"><input type="radio" name="sqlcharset" value="utf8"> UTF8</label></dd>
|
<label class="radio radio-inline"><input type="radio" name="sqlcharset" value="utf8"> UTF8</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_export_usehex}:</dt>
|
<dt>{lang db_export_usehex}:</dt>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="usehex" value="1" checked="checked">{lang yes}</label>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="usehex" value="1" checked="checked">{lang yes}</label>
|
||||||
<label class="radio radio-inline"><input type="radio" name="usehex" value="0" >{lang no}</label></dd>
|
<label class="radio radio-inline"><input type="radio" name="usehex" value="0" >{lang no}</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_export_usezip}:</dt>
|
<dt>{lang db_export_usezip}:</dt>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="usezip" value="1">{lang db_export_zip_1}</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="usezip" value="1">{lang db_export_zip_1}</label></dd>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="usezip" value="2">{lang db_export_zip_2}</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="usezip" value="2">{lang db_export_zip_2}</label></dd>
|
||||||
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="usezip" value="0" checked>{lang db_export_zip_3}</label></dd>
|
<dd class="clearfix"><label class="radio radio-inline"><input type="radio" name="usezip" value="0" checked>{lang db_export_zip_3}</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_export_filename}:</dt>
|
<dt>{lang db_export_filename}:</dt>
|
||||||
<dd class="clearfix"><input type="text" class="form-control" name="filename" value="$defaultfilename"></dd>
|
<dd class="clearfix"><input type="text" class="form-control" name="filename" value="$defaultfilename"></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<dl>
|
<dl>
|
||||||
<dd class="clearfix"><button type="submit" class="btn btn-primary" name="exportsubmit" value="true" >{lang blank_submit}</button>
|
<dd class="clearfix"><button type="submit" class="btn btn-primary" name="exportsubmit" value="true" >{lang blank_submit}</button>
|
||||||
<label class="checkbox inline"><input type="checkbox" value="1" onclick="document.getElementById('advanceoption').style.display = document.getElementById('advanceoption').style.display == 'none' ? '' : 'none'; this.value = this.value == 1 ? 0 : 1; this.checked = this.value == 1 ? false : true" id="btn_more">{lang more_options}</label></dd>
|
<label class="checkbox inline"><input type="checkbox" value="1" onclick="document.getElementById('advanceoption').style.display = document.getElementById('advanceoption').style.display == 'none' ? '' : 'none'; this.value = this.value == 1 ? 0 : 1; this.checked = this.value == 1 ? false : true" id="btn_more">{lang more_options}</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</form>
|
</form>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<!--{if $msg}-->
|
<!--{if $msg}-->
|
||||||
<p class="$msg_type">$msg</p>
|
<p class="$msg_type">$msg</p>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{if $redirecturl}-->
|
<!--{if $redirecturl}-->
|
||||||
<p class="text-info">
|
<p class="text-info">
|
||||||
<a href="{$redirecturl}" class="lightlink">{lang message_redirect}</a>
|
<a href="{$redirecturl}" class="lightlink">{lang message_redirect}</a>
|
||||||
</p>
|
</p>
|
||||||
<script type="text/JavaScript">setTimeout(function(){location.href='{$redirecturl}';}, 2000);</script>
|
<script type="text/JavaScript">setTimeout(function(){location.href='{$redirecturl}';}, 2000);</script>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{elseif $operation=='import'}-->
|
<!--{elseif $operation=='import'}-->
|
||||||
<div class="main-content" style="border:1px solid #FFF">
|
<div class="main-content" style="border:1px solid #FFF">
|
||||||
<!--{if $msg}-->
|
<!--{if $msg}-->
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<p class="$msg_type">$msg</p>
|
<p class="$msg_type">$msg</p>
|
||||||
<!--{if $redirecturl}-->
|
<!--{if $redirecturl}-->
|
||||||
<p class="text-info">
|
<p class="text-info">
|
||||||
<a href="{$redirecturl}" class="lightlink">{lang message_redirect}</a>
|
<a href="{$redirecturl}" class="lightlink">{lang message_redirect}</a>
|
||||||
</p>
|
</p>
|
||||||
<script type="text/JavaScript">setTimeout(function(){location.href='{$redirecturl}';}, 2000);</script>
|
<script type="text/JavaScript">setTimeout(function(){location.href='{$redirecturl}';}, 2000);</script>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
|
|
||||||
<ul class="help-block">
|
<ul class="help-block">
|
||||||
<h5>{lang board_message}</h5> {lang db_import_tips}
|
<h5>{lang board_message}</h5> {lang db_import_tips}
|
||||||
</ul>
|
</ul>
|
||||||
$do_import_option
|
$do_import_option
|
||||||
<form id="cpform" action="{MOD_URL}&op=database&operation=import" class="form-horizontal form-horizontal-left " method="post" name="cpform">
|
<form id="cpform" action="{MOD_URL}&op=database&operation=import" class="form-horizontal form-horizontal-left " method="post" name="cpform">
|
||||||
<input type="hidden" value="{FORMHASH}" name="formhash">
|
<input type="hidden" value="{FORMHASH}" name="formhash">
|
||||||
<input type="hidden" value="true" name="deletesubmit">
|
<input type="hidden" value="true" name="deletesubmit">
|
||||||
<table class="table table-hover" style="border-top:1px solid #DDD">
|
<table class="table table-hover" style="border-top:1px solid #DDD">
|
||||||
<thead>
|
<thead>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>{lang filename}</th>
|
<th>{lang filename}</th>
|
||||||
<th>{lang version}</th>
|
<th>{lang version}</th>
|
||||||
<th>{lang time}</th>
|
<th>{lang time}</th>
|
||||||
<th>{lang type}</th>
|
<th>{lang type}</th>
|
||||||
<th>{lang big_small}</th>
|
<th>{lang big_small}</th>
|
||||||
<th>{lang db_method}</th>
|
<th>{lang db_method}</th>
|
||||||
<th>{lang db_volume}</th>
|
<th>{lang db_volume}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</thead>
|
</thead>
|
||||||
<!--{loop $list $key $val}-->
|
<!--{loop $list $key $val}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="checkbox" name="delete[]" value="$key"></td>
|
<td><input type="checkbox" name="delete[]" value="$key"></td>
|
||||||
<td>
|
<td>
|
||||||
<!--{if $val['list']}-->
|
<!--{if $val['list']}-->
|
||||||
<a href="javascript:;" onclick="jQuery('#exportlog_{$key}').toggle()">$key</a>
|
<a href="javascript:;" onclick="jQuery('#exportlog_{$key}').toggle()">$key</a>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<a href="$val[filename]">$key</a>
|
<a href="$val[filename]">$key</a>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</td>
|
</td>
|
||||||
<td>$val[version]</td>
|
<td>$val[version]</td>
|
||||||
<td>$val[dateline]</td>
|
<td>$val[dateline]</td>
|
||||||
<td>$val[ftype]</td>
|
<td>$val[ftype]</td>
|
||||||
<td>$val[size]</td>
|
<td>$val[size]</td>
|
||||||
<td>$val[method]</td>
|
<td>$val[method]</td>
|
||||||
<td>$val[volume]</td>
|
<td>$val[volume]</td>
|
||||||
<td>
|
<td>
|
||||||
<!--{if $val['list']}-->
|
<!--{if $val['list']}-->
|
||||||
<a href="{$datasiteurl}restore.php?operation=import&from=server&datafile_server=$val[datafile_server]&importsubmit=yes" <!--{if $info[ 'version'] !=$_G[ 'setting'][ 'version']}--> onclick="return confirm('{lang db_import_confirm}');"<!--{else}-->onclick="return confirm('{lang db_import_confirm_sql}');"<!--{/if}-->target="_blank">{lang import}</a>
|
<a href="{$datasiteurl}restore.php?operation=import&from=server&datafile_server=$val[datafile_server]&importsubmit=yes" <!--{if $info[ 'version'] !=$_G[ 'setting'][ 'version']}--> onclick="return confirm('{lang db_import_confirm}');"<!--{else}-->onclick="return confirm('{lang db_import_confirm_sql}');"<!--{/if}-->target="_blank">{lang import}</a>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<a href="{$datasiteurl}restore.php?operation=importzip&datafile_server=$info[datafile_server]&importsubmit=yes" onclick="return confirm('{lang db_import_confirm_zip}');" target="_blank">{lang db_import_unzip}</a>
|
<a href="{$datasiteurl}restore.php?operation=importzip&datafile_server=$info[datafile_server]&importsubmit=yes" onclick="return confirm('{lang db_import_confirm_zip}');" target="_blank">{lang db_import_unzip}</a>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<thead id="exportlog_{$key}" style="display:none;">
|
<thead id="exportlog_{$key}" style="display:none;">
|
||||||
<!--{loop $val[list] $key1 $val1}-->
|
<!--{loop $val[list] $key1 $val1}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="$val1[filename]">$val1[filename]</a>
|
<a href="$val1[filename]">$val1[filename]</a>
|
||||||
</td>
|
</td>
|
||||||
<td>$val1[version]</td>
|
<td>$val1[version]</td>
|
||||||
<td>$val1[dateline]</td>
|
<td>$val1[dateline]</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>$val1[size]</td>
|
<td>$val1[size]</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>$val1[volume]</td>
|
<td>$val1[volume]</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
</thead>
|
</thead>
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="15"><input type="checkbox" name="chkall" id="chkallspKI" onclick="checkAll('prefix', this.form, 'delete')">{lang del} <button type="submit" class="btn btn-primary" name="exportsubmit" value="true" >{lang blank_submit}</button>
|
<td colspan="15"><input type="checkbox" name="chkall" id="chkallspKI" onclick="checkAll('prefix', this.form, 'delete')">{lang del} <button type="submit" class="btn btn-primary" name="exportsubmit" value="true" >{lang blank_submit}</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{elseif $operation=='runquery'}-->
|
<!--{elseif $operation=='runquery'}-->
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
|
|
||||||
<ul class="help-block">
|
<ul class="help-block">
|
||||||
<h4>{lang board_message}</h4>
|
<h4>{lang board_message}</h4>
|
||||||
{lang db_runquery_tips}
|
{lang db_runquery_tips}
|
||||||
</ul>
|
</ul>
|
||||||
<!--{if $msg}-->
|
<!--{if $msg}-->
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<p class="$msg_type">$msg</p>
|
<p class="$msg_type">$msg</p>
|
||||||
<!--{if $redirecturl}-->
|
<!--{if $redirecturl}-->
|
||||||
<p class="text-info">
|
<p class="text-info">
|
||||||
<a href="{$redirecturl}" class="lightlink">{lang message_redirect}</a>
|
<a href="{$redirecturl}" class="lightlink">{lang message_redirect}</a>
|
||||||
</p>
|
</p>
|
||||||
<script type="text/JavaScript">setTimeout(function(){location.href='{$redirecturl}';}, 5000);</script>
|
<script type="text/JavaScript">setTimeout(function(){location.href='{$redirecturl}';}, 5000);</script>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
|
|
||||||
<form id="cpform" action="{MOD_URL}&op=database&operation=runquery" method="post" name="cpform">
|
<form id="cpform" action="{MOD_URL}&op=database&operation=runquery" method="post" name="cpform">
|
||||||
<input type="hidden" value="{FORMHASH}" name="formhash">
|
<input type="hidden" value="{FORMHASH}" name="formhash">
|
||||||
<input type="hidden" value="true" name="sqlsubmit">
|
<input type="hidden" value="true" name="sqlsubmit">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang db_runquery_sql}</dt>
|
<dt>{lang db_runquery_sql}</dt>
|
||||||
<dd class="clearfix"><textarea cols="85" rows="10" name="queries" style="width:500px;"></textarea></dd>
|
<dd class="clearfix"><textarea cols="85" rows="10" name="queries" style="width:500px;"></textarea></dd>
|
||||||
<dd class="clearfix mt10"><label class="checkbox-inline"><input name="createcompatible" type="checkbox" value="1" checked="checked" />{lang db_runquery_createcompatible}</label></dd>
|
<dd class="clearfix mt10"><label class="checkbox-inline"><input name="createcompatible" type="checkbox" value="1" checked="checked" />{lang db_runquery_createcompatible}</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dd class="clearfix"><button type="submit" class="btn btn-primary">{lang blank_submit}</button></dd>
|
<dd class="clearfix"><button type="submit" class="btn btn-primary">{lang blank_submit}</button></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</form>
|
</form>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.left-drager').leftDrager_layout();
|
jQuery('.left-drager').leftDrager_layout();
|
||||||
</script>
|
</script>
|
||||||
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
||||||
<!--{template common/footer_simple}-->
|
<!--{template common/footer_simple}-->
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{eval $oparr=array('updatecache','database','cron','systemupgrade' );}
|
{eval $oparr=array('updatecache','database','cron','systemupgrade' );}
|
||||||
{eval $leftmenu=array();}
|
{eval $leftmenu=array();}
|
||||||
{eval foreach($oparr as $key => $value){}
|
{eval foreach($oparr as $key => $value){}
|
||||||
{eval $leftmenu[$value]=array('title'=>lang($value),'active'=>'');}
|
{eval $leftmenu[$value]=array('title'=>lang($value),'active'=>'');}
|
||||||
{eval if($value==$op) $leftmenu[$value]['active']='class="active"';}
|
{eval if($value==$op) $leftmenu[$value]['active']='class="active"';}
|
||||||
{eval }}
|
{eval }}
|
||||||
|
|
||||||
<ul class="nav-stacked">
|
<ul class="nav-stacked">
|
||||||
<!--{loop $leftmenu $key $value}-->
|
<!--{loop $leftmenu $key $value}-->
|
||||||
<li $value[active]><a hidefocus="true" href="{MOD_URL}&op=$key">$value[title]</a></li>
|
<li $value[active]><a hidefocus="true" href="{MOD_URL}&op=$key">$value[title]</a></li>
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
</ul>
|
</ul>
|
||||||
@@ -1,73 +1,73 @@
|
|||||||
<!--{template common/header_simple_start}-->
|
<!--{template common/header_simple_start}-->
|
||||||
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
|
|
||||||
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
||||||
<!--{template common/header_simple_end}-->
|
<!--{template common/header_simple_end}-->
|
||||||
<!--{template common/commer_header}-->
|
<!--{template common/commer_header}-->
|
||||||
<div class="bs-container clearfix">
|
<div class="bs-container clearfix">
|
||||||
<div class="bs-left-container clearfix">
|
<div class="bs-left-container clearfix">
|
||||||
<!--{template left}-->
|
<!--{template left}-->
|
||||||
</div>
|
</div>
|
||||||
<div class="left-drager">
|
<div class="left-drager">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bs-main-container clearfix">
|
<div class="bs-main-container clearfix">
|
||||||
|
|
||||||
<div class="main-header">
|
<div class="main-header">
|
||||||
<div class="clearfix" style="line-height:40px;padding:0 10px">
|
<div class="clearfix" style="line-height:40px;padding:0 10px">
|
||||||
<!-- <strong style="font-size:14px;">{lang updatecache}</strong>-->
|
<!-- <strong style="font-size:14px;">{lang updatecache}</strong>-->
|
||||||
<span class="text-muted" id="step1" <!--{if $step==1}-->style="color:green"<!--{/if}-->>1.{lang nav_updatecache_confirm}</span>
|
<span class="text-muted" id="step1" <!--{if $step==1}-->style="color:green"<!--{/if}-->>1.{lang nav_updatecache_confirm}</span>
|
||||||
<span class="text-muted" id="step2" <!--{if $step==2}-->style="color:green"<!--{/if}-->>2.{lang nav_updatecache_verify}</span>
|
<span class="text-muted" id="step2" <!--{if $step==2}-->style="color:green"<!--{/if}-->>2.{lang nav_updatecache_verify}</span>
|
||||||
<span class="text-muted" id="step3" <!--{if $step==3}-->style="color:green"<!--{/if}-->>3.{lang nav_updatecache_completed}</span>
|
<span class="text-muted" id="step3" <!--{if $step==3}-->style="color:green"<!--{/if}-->>3.{lang nav_updatecache_completed}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main-content" style="padding:20px;border-top:1px solid #FFF">
|
<div class="main-content" style="padding:20px;border-top:1px solid #FFF">
|
||||||
<div class="well well-sm">
|
<div class="well well-sm">
|
||||||
<!--{if $step==1}-->
|
<!--{if $step==1}-->
|
||||||
<form method="post" class="form-horizontal form-horizontal-left" action="{MOD_URL}&op=updatecache&step=2">
|
<form method="post" class="form-horizontal form-horizontal-left" action="{MOD_URL}&op=updatecache&step=2">
|
||||||
<input name="formhash" value="{VERHASH}" type="hidden">
|
<input name="formhash" value="{VERHASH}" type="hidden">
|
||||||
<p class="clearfix ml20">
|
<p class="clearfix ml20">
|
||||||
<label class="checkbox-inline">
|
<label class="checkbox-inline">
|
||||||
<input name="type[]" value="data" checked="" type="checkbox">
|
<input name="type[]" value="data" checked="" type="checkbox">
|
||||||
{lang tools_updatecache_data}
|
{lang tools_updatecache_data}
|
||||||
</label>
|
</label>
|
||||||
<label class="checkbox-inline">
|
<label class="checkbox-inline">
|
||||||
<input name="type[]" value="tpl" id="tplcache" checked="" type="checkbox">
|
<input name="type[]" value="tpl" id="tplcache" checked="" type="checkbox">
|
||||||
{lang tools_updatecache_tpl}
|
{lang tools_updatecache_tpl}
|
||||||
</label>
|
</label>
|
||||||
<label class="checkbox-inline">
|
<label class="checkbox-inline">
|
||||||
<input name="type[]" value="memory" id="momerycache" type="checkbox">
|
<input name="type[]" value="memory" id="momerycache" type="checkbox">
|
||||||
{lang tools_updatecache_memory}
|
{lang tools_updatecache_memory}
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p class="clearfix ml20">
|
<p class="clearfix ml20">
|
||||||
<input class="btn btn-primary" name="confirmed" value="{lang confirms}" type="submit">
|
<input class="btn btn-primary" name="confirmed" value="{lang confirms}" type="submit">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<input type="button" class="btn btn-default" value="{lang cancel}" onClick="history.go(-1);">');
|
if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<input type="button" class="btn btn-default" value="{lang cancel}" onClick="history.go(-1);">');
|
||||||
</script>
|
</script>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<!--{elseif $step==2}-->
|
<!--{elseif $step==2}-->
|
||||||
<p class="ml20">{lang tools_updatecache_waiting}</p>
|
<p class="ml20">{lang tools_updatecache_waiting}</p>
|
||||||
<p class="text-success ml20">
|
<p class="text-success ml20">
|
||||||
<a href="{MOD_URL}&op=updatecache&step=3&type=$type" class="lightlink">{lang message_redirect}</a>
|
<a href="{MOD_URL}&op=updatecache&step=3&type=$type" class="lightlink">{lang message_redirect}</a>
|
||||||
</p>
|
</p>
|
||||||
<script type="text/JavaScript">setTimeout(function(){location.href='{MOD_URL}&op=updatecache&step=3&type=$type';}, 2000);</script>
|
<script type="text/JavaScript">setTimeout(function(){location.href='{MOD_URL}&op=updatecache&step=3&type=$type';}, 2000);</script>
|
||||||
<!--{elseif $step==3}-->
|
<!--{elseif $step==3}-->
|
||||||
<p class="text-success ml20" style="margin:10px;">{lang update_cache_succeed}</p>
|
<p class="text-success ml20" style="margin:10px;">{lang update_cache_succeed}</p>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.setTimeout(function() { location.href = '{MOD_URL}&op=updatecache'; }, 5000);
|
window.setTimeout(function() { location.href = '{MOD_URL}&op=updatecache'; }, 5000);
|
||||||
</script>
|
</script>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<ul class="help-block">
|
<ul class="help-block">
|
||||||
<h5>{lang board_message}</h5> {lang tools_updatecache_tips}
|
<h5>{lang board_message}</h5> {lang tools_updatecache_tips}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.left-drager').leftDrager_layout();
|
jQuery('.left-drager').leftDrager_layout();
|
||||||
</script>
|
</script>
|
||||||
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
||||||
<!--{template common/footer_simple}-->
|
<!--{template common/footer_simple}-->
|
||||||
@@ -1,246 +1,246 @@
|
|||||||
<!--{template common/header_simple_start}-->
|
<!--{template common/header_simple_start}-->
|
||||||
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
|
|
||||||
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
||||||
<script src="admin/scripts/admin.js?{VERHASH}"></script>
|
<script src="admin/scripts/admin.js?{VERHASH}"></script>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
.progress.active .progress-bar {
|
.progress.active .progress-bar {
|
||||||
-webkit-animation: none;
|
-webkit-animation: none;
|
||||||
animation: none;
|
animation: none;
|
||||||
transition: none;
|
transition: none;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<!--{template common/header_simple_end}-->
|
<!--{template common/header_simple_end}-->
|
||||||
<!--{template common/commer_header}-->
|
<!--{template common/commer_header}-->
|
||||||
<div class="bs-container clearfix">
|
<div class="bs-container clearfix">
|
||||||
<div class="bs-left-container clearfix">
|
<div class="bs-left-container clearfix">
|
||||||
<!--{template left}-->
|
<!--{template left}-->
|
||||||
</div>
|
</div>
|
||||||
<div class="left-drager">
|
<div class="left-drager">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bs-main-container clearfix">
|
<div class="bs-main-container clearfix">
|
||||||
|
|
||||||
<!--{if $operation == 'patch' || $operation == 'cross'}-->
|
<!--{if $operation == 'patch' || $operation == 'cross'}-->
|
||||||
<div class="main-header">
|
<div class="main-header">
|
||||||
<div class="clearfix" style="line-height:40px;padding:0 10px;font-size:12px;">
|
<div class="clearfix" style="line-height:40px;padding:0 10px;font-size:12px;">
|
||||||
<strong style="font-size:14px;">{lang upgrade}</strong>
|
<strong style="font-size:14px;">{lang upgrade}</strong>
|
||||||
<!--{loop $steplang $key $value}-->
|
<!--{loop $steplang $key $value}-->
|
||||||
<!--{if $key>0 && $key<=5}-->
|
<!--{if $key>0 && $key<=5}-->
|
||||||
<span class="text-muted" <!--{if $key==$step}-->style="color:green"<!--{/if}-->>{$key}.{$value}</span>
|
<span class="text-muted" <!--{if $key==$step}-->style="color:green"<!--{/if}-->>{$key}.{$value}</span>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{if $operation=='check'}-->
|
<!--{if $operation=='check'}-->
|
||||||
<div class="main-content" style="border-top:1px solid #FFF">
|
<div class="main-content" style="border-top:1px solid #FFF">
|
||||||
<!--{if $msg}-->
|
<!--{if $msg}-->
|
||||||
<div id="step4" style="padding:20px;height:450px">
|
<div id="step4" style="padding:20px;height:450px">
|
||||||
<div class="alert alert-warning text-center">
|
<div class="alert alert-warning text-center">
|
||||||
$msg
|
$msg
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<div style="padding:20px;">
|
<div style="padding:20px;">
|
||||||
<div class="text-center" style="width:300px;margin:0 auto">
|
<div class="text-center" style="width:300px;margin:0 auto">
|
||||||
<p style="margin:20px 0;">{lang upgrade_checking}</p>
|
<p style="margin:20px 0;">{lang upgrade_checking}</p>
|
||||||
<div class="progress progress-striped active" style="border:1px solid #5bc0de">
|
<div class="progress progress-striped active" style="border:1px solid #5bc0de">
|
||||||
<div class="progress-bar progress-bar-info " role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%"><span class="sr-only">100% Complete</span></div>
|
<div class="progress-bar progress-bar-info " role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%"><span class="sr-only">100% Complete</span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.progress-bar').animate({ width: '100%' }, 3000, function() {
|
jQuery('.progress-bar').animate({ width: '100%' }, 3000, function() {
|
||||||
window.location.href = '{MOD_URL}&op=systemupgrade&operation=check&checking=1';
|
window.location.href = '{MOD_URL}&op=systemupgrade&operation=check&checking=1';
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{elseif $operation=='showupgrade'}-->
|
<!--{elseif $operation=='showupgrade'}-->
|
||||||
<div class="main-content" style="border-top:1px solid #FFF">
|
<div class="main-content" style="border-top:1px solid #FFF">
|
||||||
<!--{if $msg}-->
|
<!--{if $msg}-->
|
||||||
<div id="step4" style="padding:20px;height:450px">
|
<div id="step4" style="padding:20px;height:450px">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
$msg
|
$msg
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan="5">{lang founder_upgrade_select_version}</th>
|
<th colspan="5">{lang founder_upgrade_select_version}</th>
|
||||||
</thead>
|
</thead>
|
||||||
<!--{loop $list $value}-->
|
<!--{loop $list $value}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>$value[title]</td>
|
<td>$value[title]</td>
|
||||||
<td>$value[btn1]</td>
|
<td>$value[btn1]</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
<!--{elseif $operation=='patch' || $operation=='cross' }-->
|
<!--{elseif $operation=='patch' || $operation=='cross' }-->
|
||||||
|
|
||||||
<div class="main-content" style="border-top:1px solid #FFF;">
|
<div class="main-content" style="border-top:1px solid #FFF;">
|
||||||
<!--{if !$_G['setting']['bbclosed']}-->
|
<!--{if !$_G['setting']['bbclosed']}-->
|
||||||
<div style="padding:20px;height:450px">
|
<div style="padding:20px;height:450px">
|
||||||
<div class="alert alert-warning text-center">
|
<div class="alert alert-warning text-center">
|
||||||
$msg
|
$msg
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--{elseif $step==1}-->
|
<!--{elseif $step==1}-->
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan="5">{lang founder_upgrade_preupdatelist}</th>
|
<th colspan="5">{lang founder_upgrade_preupdatelist}</th>
|
||||||
</thead>
|
</thead>
|
||||||
<!--{loop $updatefilelist $value}-->
|
<!--{loop $updatefilelist $value}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td> <i class="glyphicon glyphicon-file"></i> $value</td>
|
<td> <i class="glyphicon glyphicon-file"></i> $value</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan="5"> {lang founder_upgrade_store_directory} ./data/update/oaooa$version</th>
|
<th colspan="5"> {lang founder_upgrade_store_directory} ./data/update/oaooa$version</th>
|
||||||
</thead>
|
</thead>
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan="5"> <input type="button" class="btn btn-primary" onclick="window.location.href='$linkurl'" value="{lang founder_upgrade_download}">{eval echo upgradeinformation(0)}</th>
|
<th colspan="5"> <input type="button" class="btn btn-primary" onclick="window.location.href='$linkurl'" value="{lang founder_upgrade_download}">{eval echo upgradeinformation(0)}</th>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!--{elseif $step==2}-->
|
<!--{elseif $step==2}-->
|
||||||
<div style="padding:20px;">$msg</div>
|
<div style="padding:20px;">$msg</div>
|
||||||
|
|
||||||
<!--{elseif $step==3}-->
|
<!--{elseif $step==3}-->
|
||||||
<!--{if $msg}-->
|
<!--{if $msg}-->
|
||||||
<div id="step4" style="padding:20px;">
|
<div id="step4" style="padding:20px;">
|
||||||
<div class="alert alert-warning text-center">
|
<div class="alert alert-warning text-center">
|
||||||
$msg
|
$msg
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan="5">{lang founder_upgrade_diff_show}</th>
|
<th colspan="5">{lang founder_upgrade_diff_show}</th>
|
||||||
</thead>
|
</thead>
|
||||||
<!--{loop $updatefilelist $v}-->
|
<!--{loop $updatefilelist $v}-->
|
||||||
<!--{if isset($ignorelist[$v])}-->
|
<!--{if isset($ignorelist[$v])}-->
|
||||||
|
|
||||||
<!--{elseif isset($modifylist[$v])}-->
|
<!--{elseif isset($modifylist[$v])}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-danger"> {lang founder_upgrade_diff} <i class="glyphicon glyphicon-exclamation-sign"></i> $v</td>
|
<td class="text-danger"> {lang founder_upgrade_diff} <i class="glyphicon glyphicon-exclamation-sign"></i> $v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--{elseif isset($showlist[$v])}-->
|
<!--{elseif isset($showlist[$v])}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-success"> {lang founder_upgrade_normal} <i class="glyphicon glyphicon-ok"></i> $v</td>
|
<td class="text-success"> {lang founder_upgrade_normal} <i class="glyphicon glyphicon-ok"></i> $v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--{elseif isset($newlist[$v])}-->
|
<!--{elseif isset($newlist[$v])}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-info"> {lang founder_upgrade_new} <i class="glyphicon glyphicon-plus"></i> $v</td>
|
<td class="text-info"> {lang founder_upgrade_new} <i class="glyphicon glyphicon-plus"></i> $v</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan="5">{lang founder_upgrade_download_file} ./data/update/oaooa{$version}</th>
|
<th colspan="5">{lang founder_upgrade_download_file} ./data/update/oaooa{$version}</th>
|
||||||
</thead>
|
</thead>
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan="5"> {lang founder_upgrade_backup_file} ./data/back/oaooa{CORE_VERSION} {lang founder_upgrade_backup_file2} </th>
|
<th colspan="5"> {lang founder_upgrade_backup_file} ./data/back/oaooa{CORE_VERSION} {lang founder_upgrade_backup_file2} </th>
|
||||||
</thead>
|
</thead>
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan="5"> <input type="button" class="btn btn-primary" onclick="window.location.href='{$linkurl}';" value="<!--{if !empty($modifylist)}-->{lang founder_upgrade_force}<!--{else}-->{lang founder_upgrade_regular}<!--{/if}-->" /> {eval echo upgradeinformation(0)}</th>
|
<th colspan="5"> <input type="button" class="btn btn-primary" onclick="window.location.href='{$linkurl}';" value="<!--{if !empty($modifylist)}-->{lang founder_upgrade_force}<!--{else}-->{lang founder_upgrade_regular}<!--{/if}-->" /> {eval echo upgradeinformation(0)}</th>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{elseif $step==4}-->
|
<!--{elseif $step==4}-->
|
||||||
<!--{if $msg}-->
|
<!--{if $msg}-->
|
||||||
<div id="step4" style="padding:20px;height:450px">
|
<div id="step4" style="padding:20px;height:450px">
|
||||||
<div class="alert alert-warning text-center">
|
<div class="alert alert-warning text-center">
|
||||||
$msg
|
$msg
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--{elseif $_GET['siteftpsetting']}-->
|
<!--{elseif $_GET['siteftpsetting']}-->
|
||||||
<form name="aliform" class="form-horizontal form-horizontal-left" action="$action" method="post" style="padding:20px;">
|
<form name="aliform" class="form-horizontal form-horizontal-left" action="$action" method="post" style="padding:20px;">
|
||||||
<input type="hidden" name="formhash" value="{FORMHASH}">
|
<input type="hidden" name="formhash" value="{FORMHASH}">
|
||||||
<p style="padding-left:20px;font-weight:bold;font-size:16px;padding-bottom:20px;">{lang upgrade_website_FTP_set}</p>
|
<p style="padding-left:20px;font-weight:bold;font-size:16px;padding-bottom:20px;">{lang upgrade_website_FTP_set}</p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">FTP {lang server_address}</label>
|
<label class="control-label">FTP {lang server_address}</label>
|
||||||
<input type="text" class="form-control required" name="siteftp[host]" value="" placeholder="{lang host_IP_address}">
|
<input type="text" class="form-control required" name="siteftp[host]" value="" placeholder="{lang host_IP_address}">
|
||||||
<span class="help-inline">{lang FTP_server_IP_site_domain}</span>
|
<span class="help-inline">{lang FTP_server_IP_site_domain}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">FTP {lang server_port}</label>
|
<label class="control-label">FTP {lang server_port}</label>
|
||||||
<input type="text" class="form-control required" name="siteftp[port]" value="21" placeholder="{lang port}">
|
<input type="text" class="form-control required" name="siteftp[port]" value="21" placeholder="{lang port}">
|
||||||
<span class="help-inline">{lang default_for_the_21st}</span>
|
<span class="help-inline">{lang default_for_the_21st}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">FTP {lang account}</label>
|
<label class="control-label">FTP {lang account}</label>
|
||||||
<input type="text" class="form-control required" name="siteftp[username]" value="" placeholder="{lang FTP_account_user_name}">
|
<input type="text" class="form-control required" name="siteftp[username]" value="" placeholder="{lang FTP_account_user_name}">
|
||||||
<span class="help-inline">{lang accounts_supreme_authority}</span>
|
<span class="help-inline">{lang accounts_supreme_authority}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">FTP {lang password}</label>
|
<label class="control-label">FTP {lang password}</label>
|
||||||
<input type="password" class="form-control required" name="siteftp[password]" value="" placeholder="{lang FTP_account_user_password}">
|
<input type="password" class="form-control required" name="siteftp[password]" value="" placeholder="{lang FTP_account_user_password}">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!--<div class="form-group">
|
<!--<div class="form-group">
|
||||||
<label class="control-label">编码</label>
|
<label class="control-label">编码</label>
|
||||||
<select class="form-control" name="siteftp[charset]">
|
<select class="form-control" name="siteftp[charset]">
|
||||||
<option value="GBK" selected="selected">GBK</option>
|
<option value="GBK" selected="selected">GBK</option>
|
||||||
<option value="UTF-8">UTF-8</option>
|
<option value="UTF-8">UTF-8</option>
|
||||||
<option value="BIG5">BIG5</option>
|
<option value="BIG5">BIG5</option>
|
||||||
</select>
|
</select>
|
||||||
<span class="help-inline">根据FTP服务器的编码设置,不一致会导致乱码</span>
|
<span class="help-inline">根据FTP服务器的编码设置,不一致会导致乱码</span>
|
||||||
|
|
||||||
</div>-->
|
</div>-->
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">{lang sitepath}</label>
|
<label class="control-label">{lang sitepath}</label>
|
||||||
<input type="text" class="form-control required" name="siteftp[attachdir]" value="">
|
<input type="text" class="form-control required" name="siteftp[attachdir]" value="">
|
||||||
<span class="help-inline">{lang site_absolute_path_root_directory}</span>
|
<span class="help-inline">{lang site_absolute_path_root_directory}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label"></label>
|
<label class="control-label"></label>
|
||||||
<label class="checkbox-inline" style="width:180px;"><input type="checkbox" name="siteftp[pasv]" value="1">{lang use_Passive_Mode}</label>
|
<label class="checkbox-inline" style="width:180px;"><input type="checkbox" name="siteftp[pasv]" value="1">{lang use_Passive_Mode}</label>
|
||||||
<span class="help-inline">{lang general_condition_passive_mode}</span>
|
<span class="help-inline">{lang general_condition_passive_mode}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label"></label>
|
<label class="control-label"></label>
|
||||||
<label class="checkbox-inline" style="width:180px;"><input type="checkbox" name="siteftp[ssl]" value="1">{lang enable_secure_link}</label>
|
<label class="checkbox-inline" style="width:180px;"><input type="checkbox" name="siteftp[ssl]" value="1">{lang enable_secure_link}</label>
|
||||||
<span class="help-inline">{lang notice_FTP_open_SSL}</span>
|
<span class="help-inline">{lang notice_FTP_open_SSL}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label"></label>
|
<label class="control-label"></label>
|
||||||
<input type="submit" class="btn btn-primary" style="padding:6px 25px" value="{lang confirms}">
|
<input type="submit" class="btn btn-primary" style="padding:6px 25px" value="{lang confirms}">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{elseif $step==5}-->
|
<!--{elseif $step==5}-->
|
||||||
<div style="padding:20px;">
|
<div style="padding:20px;">
|
||||||
<div class="alert alert-success text-center">
|
<div class="alert alert-success text-center">
|
||||||
$msg
|
$msg
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.left-drager').leftDrager_layout();
|
jQuery('.left-drager').leftDrager_layout();
|
||||||
|
|
||||||
function createIframe(src) {
|
function createIframe(src) {
|
||||||
document.getElementById('step4').innerHTML = '<iframe marginheight="0" marginwidth="0" allowtransparency="true" frameborder="0" src="' + src + '" style="width:100%;height:100%;"></iframe>';
|
document.getElementById('step4').innerHTML = '<iframe marginheight="0" marginwidth="0" allowtransparency="true" frameborder="0" src="' + src + '" style="width:100%;height:100%;"></iframe>';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
||||||
<!--{template common/footer_simple}-->
|
<!--{template common/footer_simple}-->
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<link rel="stylesheet" type="text/css" href="static/bootstrap/css/bootstrap.min.css">
|
<link rel="stylesheet" type="text/css" href="static/bootstrap/css/bootstrap.min.css">
|
||||||
<link href="static/css/common.css" rel="stylesheet" media="all">
|
<link href="static/css/common.css" rel="stylesheet" media="all">
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
$msg
|
$msg
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -1,46 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
$oparr = array('updatecache', 'database', /*'security','patch','update',*/
|
$oparr = array('updatecache', 'database', /*'security','patch','update',*/
|
||||||
'cron', 'log');
|
'cron', 'log');
|
||||||
$leftmenu = array();
|
$leftmenu = array();
|
||||||
$op = $_GET['op'];
|
$op = $_GET['op'];
|
||||||
foreach ($oparr as $key => $value) {
|
foreach ($oparr as $key => $value) {
|
||||||
$leftmenu[$value] = array('title' => lang($value), 'active' => '');
|
$leftmenu[$value] = array('title' => lang($value), 'active' => '');
|
||||||
if ($value == $op)
|
if ($value == $op)
|
||||||
$leftmenu[$value]['active'] = 'class="active"';
|
$leftmenu[$value]['active'] = 'class="active"';
|
||||||
}
|
}
|
||||||
|
|
||||||
include libfile('function/cache');
|
include libfile('function/cache');
|
||||||
|
|
||||||
$navtitle = lang('updatecache') . ' - ' . lang('admin_navtitle');
|
$navtitle = lang('updatecache') . ' - ' . lang('admin_navtitle');
|
||||||
$step = max(1, intval($_GET['step']));
|
$step = max(1, intval($_GET['step']));
|
||||||
|
|
||||||
if ($step == 1) {
|
if ($step == 1) {
|
||||||
} elseif ($step == 2) {
|
} elseif ($step == 2) {
|
||||||
$type = implode('_', (array)$_GET['type']);
|
$type = implode('_', (array)$_GET['type']);
|
||||||
|
|
||||||
} elseif ($step == 3) {
|
} elseif ($step == 3) {
|
||||||
$type = explode('_', $_GET['type']);
|
$type = explode('_', $_GET['type']);
|
||||||
if (in_array('data', $type)) {
|
if (in_array('data', $type)) {
|
||||||
updatecache();
|
updatecache();
|
||||||
}
|
}
|
||||||
if (in_array('tpl', $type) && $_G['config']['output']['tplrefresh']) {
|
if (in_array('tpl', $type) && $_G['config']['output']['tplrefresh']) {
|
||||||
cleartemplatecache();
|
cleartemplatecache();
|
||||||
}
|
}
|
||||||
if (in_array('memory', $type)) {
|
if (in_array('memory', $type)) {
|
||||||
//清空内存缓存
|
//清空内存缓存
|
||||||
C::memory()->clear();
|
C::memory()->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include template('updatecache');
|
include template('updatecache');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,414 +1,416 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if (!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
$navtitle = lang('upgrade') . ' - ' . lang('admin_navtitle');
|
$navtitle = lang('upgrade') . ' - ' . lang('admin_navtitle');
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
include_once DZZ_ROOT . './core/core_version.php';
|
include_once DZZ_ROOT . './core/core_version.php';
|
||||||
include_once libfile('function/admin');
|
include_once libfile('function/admin');
|
||||||
include_once libfile('function/cache');
|
include_once libfile('function/cache');
|
||||||
$dzz_upgrade = new dzz_upgrade();
|
$dzz_upgrade = new dzz_upgrade();
|
||||||
$step = intval($_GET['step']);
|
$step = intval($_GET['step']);
|
||||||
$op = $_GET['op'];
|
$op = $_GET['op'];
|
||||||
$step = $step ? $step : 1;
|
$step = $step ? $step : 1;
|
||||||
$operation = $_GET['operation'] ? trim($_GET['operation']) : 'check';
|
$operation = $_GET['operation'] ? trim($_GET['operation']) : 'check';
|
||||||
|
|
||||||
$steplang = array('', lang('founder_upgrade_updatelist'), lang('founder_upgrade_download'), lang('founder_upgrade_compare'), lang('founder_upgrade_upgrading'), lang('founder_upgrade_complete'), 'dbupdate' => lang('founder_upgrade_dbupdate'));
|
$steplang = array('', lang('founder_upgrade_updatelist'), lang('founder_upgrade_download'), lang('founder_upgrade_compare'), lang('founder_upgrade_upgrading'), lang('founder_upgrade_complete'), 'dbupdate' => lang('founder_upgrade_dbupdate'));
|
||||||
|
|
||||||
|
|
||||||
if ($operation == 'patch' || $operation == 'cross') {
|
if ($operation == 'patch' || $operation == 'cross') {
|
||||||
|
|
||||||
if (!$_G['setting']['bbclosed']) {
|
if (!$_G['setting']['bbclosed']) {
|
||||||
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_close_site') . '</p>';
|
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_close_site') . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.reload();" value="' . lang('founder_upgrade_reset') . '" /></p>';
|
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.reload();" value="' . lang('founder_upgrade_reset') . '" /></p>';
|
||||||
|
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$version = trim($_GET['version']);
|
$version = trim($_GET['version']);
|
||||||
//$release = trim($_GET['release']);
|
//$release = trim($_GET['release']);
|
||||||
$locale = trim($_GET['locale']);
|
$locale = trim($_GET['locale']);
|
||||||
$charset = trim($_GET['charset']);
|
$charset = trim($_GET['charset']);
|
||||||
$upgradeinfo = $upgrade_step = array();
|
$upgradeinfo = $upgrade_step = array();
|
||||||
|
|
||||||
if ($_GET['ungetfrom']) {
|
if ($_GET['ungetfrom']) {
|
||||||
if (md5($_GET['ungetfrom'] . $_G['config']['security']['authkey']) == $_GET['ungetfrommd5']) {
|
if (md5($_GET['ungetfrom'] . $_G['config']['security']['authkey']) == $_GET['ungetfrommd5']) {
|
||||||
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
||||||
$url = outputurl( $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey'])) );
|
$url = outputurl( $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey'])) );
|
||||||
dheader('Location: ' . $url);
|
dheader('Location: ' . $url);
|
||||||
} else {
|
} else {
|
||||||
showmessage('upgrade_param_error');
|
showmessage('upgrade_param_error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
||||||
$upgrade_step['step'] = $step;
|
$upgrade_step['step'] = $step;
|
||||||
$upgrade_step['operation'] = $operation;
|
$upgrade_step['operation'] = $operation;
|
||||||
$upgrade_step['version'] = $version;
|
$upgrade_step['version'] = $version;
|
||||||
//$upgrade_step['release'] = $release;
|
//$upgrade_step['release'] = $release;
|
||||||
$upgrade_step['charset'] = $charset;
|
$upgrade_step['charset'] = $charset;
|
||||||
$upgrade_step['locale'] = $locale;
|
$upgrade_step['locale'] = $locale;
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
|
|
||||||
$upgrade_run = C::t('cache') -> fetch('upgrade_run');
|
$upgrade_run = C::t('cache') -> fetch('upgrade_run');
|
||||||
if (!$upgrade_run) {
|
if (!$upgrade_run) {
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_run', 'cachevalue' => serialize($_G['setting']['upgrade']), 'dateline' => $_G['timestamp'], ), false, true);
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_run', 'cachevalue' => serialize($_G['setting']['upgrade']), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
$upgrade_run = $_G['setting']['upgrade'];
|
$upgrade_run = $_G['setting']['upgrade'];
|
||||||
} else {
|
} else {
|
||||||
$upgrade_run = dunserialize($upgrade_run['cachevalue']);
|
$upgrade_run = dunserialize($upgrade_run['cachevalue']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($step != 5) {
|
if ($step != 5) {
|
||||||
|
|
||||||
foreach ($upgrade_run as $type => $list) {
|
foreach ($upgrade_run as $type => $list) {
|
||||||
if ($type == $operation && $version == $list['latestversion']) {
|
if ($type == $operation && $version == $list['latestversion']) {
|
||||||
$dzz_upgrade -> locale = $locale;
|
$dzz_upgrade -> locale = $locale;
|
||||||
$dzz_upgrade -> charset = $charset;
|
$dzz_upgrade -> charset = $charset;
|
||||||
$upgradeinfo = $list;
|
$upgradeinfo = $list;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$upgradeinfo) {
|
if (!$upgradeinfo) {
|
||||||
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_none', array('upgradeurl' => upgradeinformation(-1))) . '</p>';
|
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_none', array('upgradeurl' => upgradeinformation(-1))) . '</p>';
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$updatefilelist = $dzz_upgrade -> fetch_updatefile_list($upgradeinfo);
|
$updatefilelist = $dzz_upgrade -> fetch_updatefile_list($upgradeinfo);
|
||||||
$updatemd5filelist = $updatefilelist['md5'];
|
$updatemd5filelist = $updatefilelist['md5'];
|
||||||
$updatefilelist = $updatefilelist['file'];
|
$updatefilelist = $updatefilelist['file'];
|
||||||
$theurl = $_G['siteurl'].ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&locale=' . $locale . '&charset=' . $charset;
|
$theurl = $_G['siteurl'].ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&locale=' . $locale . '&charset=' . $charset;
|
||||||
|
|
||||||
if (empty($updatefilelist)) {
|
if (empty($updatefilelist)) {
|
||||||
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_download_upgradelist_error', array('upgradeurl' => upgradeinformation(-2))) . '</p>';
|
$msg = '<p style="margin:10px 0;color:red">' . lang('upgrade_download_upgradelist_error', array('upgradeurl' => upgradeinformation(-2))) . '</p>';
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($thurl) . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($thurl) . '\';", 1000);</script>';
|
||||||
$msg .= ' <p style="margin:10px 0"><a href="' . $thurl . '">' . lang('message_redirect') . '</p>';
|
$msg .= ' <p style="margin:10px 0"><a href="' . $thurl . '">' . lang('message_redirect') . '</p>';
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($step == 1) {
|
if ($step == 1) {
|
||||||
$linkurl = $theurl . '&step=2';
|
$linkurl = $theurl . '&step=2';
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
} elseif ($step == 2) {
|
} elseif ($step == 2) {
|
||||||
$fileseq = intval($_GET['fileseq']);
|
$fileseq = intval($_GET['fileseq']);
|
||||||
$fileseq = $fileseq ? $fileseq : 1;
|
$fileseq = $fileseq ? $fileseq : 1;
|
||||||
if ($fileseq > count($updatefilelist)) {
|
if ($fileseq > count($updatefilelist)) {
|
||||||
|
|
||||||
$linkurl = $theurl . '&step=3';
|
$linkurl = $theurl . '&step=3';
|
||||||
$downloadstatus = 3;
|
$downloadstatus = 3;
|
||||||
$msg = lang('upgrade_download_complete_to_compare', array('upgradeurl' => upgradeinformation(0)));
|
$msg = lang('upgrade_download_complete_to_compare', array('upgradeurl' => upgradeinformation(0)));
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 1000);</script>';
|
||||||
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
||||||
} else {
|
} else {
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("parent.location.href=\'' . $linkurl . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("parent.location.href=\'' . $linkurl . '\';", 1000);</script>';
|
||||||
$msg .= ' <p><a href="javascript:;" onclick="parent.location.href=\'' . $linkurl . '\';return false;">' . lang('message_redirect') . '</a></p>';
|
$msg .= ' <p><a href="javascript:;" onclick="parent.location.href=\'' . $linkurl . '\';return false;">' . lang('message_redirect') . '</a></p>';
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!$_GET['iframe']) {
|
if (!$_GET['iframe']) {
|
||||||
$linkurl = $theurl . '&step=2&fileseq=' . $fileseq . '&iframe=1';
|
$linkurl = $theurl . '&step=2&fileseq=' . $fileseq . '&iframe=1';
|
||||||
$msg = '<iframe id="downiframe" marginheight="0" marginwidth="0" allowtransparency="true" frameborder="0" src="' . $linkurl . '" style="width:100%;height:100%;"></iframe>';
|
$msg = '<iframe id="downiframe" marginheight="0" marginwidth="0" allowtransparency="true" frameborder="0" src="' . $linkurl . '" style="width:100%;height:100%;"></iframe>';
|
||||||
} else {
|
} else {
|
||||||
$downloadstatus = $dzz_upgrade -> download_file($upgradeinfo, $updatefilelist[$fileseq - 1], 'upload', $updatemd5filelist[$fileseq - 1]);
|
$downloadstatus = $dzz_upgrade -> download_file($upgradeinfo, $updatefilelist[$fileseq - 1], 'upload', $updatemd5filelist[$fileseq - 1]);
|
||||||
if ($downloadstatus == 1) {
|
if ($downloadstatus == 1) {
|
||||||
$linkurl = $theurl . '&step=2&fileseq=' . $fileseq . '&iframe=1';
|
$linkurl = $theurl . '&step=2&fileseq=' . $fileseq . '&iframe=1';
|
||||||
$msg = lang('upgrade_downloading_file', array('file' => $updatefilelist[$fileseq - 1], 'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)) . '%', 'upgradeurl' => upgradeinformation(1))) . '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 10);</script>';
|
$msg = lang('upgrade_downloading_file', array('file' => $updatefilelist[$fileseq - 1], 'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)) . '%', 'upgradeurl' => upgradeinformation(1))) . '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 10);</script>';
|
||||||
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
||||||
|
|
||||||
} elseif ($downloadstatus == 2) {
|
} elseif ($downloadstatus == 2) {
|
||||||
$linkurl = $theurl . '&step=2&fileseq=' . ($fileseq + 1) . '&iframe=1';
|
$linkurl = $theurl . '&step=2&fileseq=' . ($fileseq + 1) . '&iframe=1';
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_downloading_file', array('file' => $updatefilelist[$fileseq - 1], 'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)) . '%', 'upgradeurl' => upgradeinformation(1))) . '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 10);</script></p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_downloading_file', array('file' => $updatefilelist[$fileseq - 1], 'percent' => sprintf("%2d", 100 * $fileseq / count($updatefilelist)) . '%', 'upgradeurl' => upgradeinformation(1))) . '<script type="text/JavaScript">setTimeout("location.href=\'' . $linkurl . '\';", 10);</script></p>';
|
||||||
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
$msg .= ' <p><a href="' . $linkurl . '">' . lang('message_redirect') . '</a></p>';
|
||||||
} else {
|
} else {
|
||||||
$linkurl = $theurl . '&step=2&fileseq=' . ($fileseq) . '&iframe=1';
|
$linkurl = $theurl . '&step=2&fileseq=' . ($fileseq) . '&iframe=1';
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_redownload', array('file' => $updatefilelist[$fileseq - 1], 'upgradeurl' => upgradeinformation(-3))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_redownload', array('file' => $updatefilelist[$fileseq - 1], 'upgradeurl' => upgradeinformation(-3))) . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0;"><input type="button" class="btn btn-success" value="'.lang('founder_upgrade_reset').'" onclick="location.href=\'' . $linkurl . '\'" />';
|
$msg .= '<p style="margin:10px 0;"><input type="button" class="btn btn-success" value="'.lang('founder_upgrade_reset').'" onclick="location.href=\'' . $linkurl . '\'" />';
|
||||||
}
|
}
|
||||||
include template('upgrade_iframe');
|
include template('upgrade_iframe');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($step == 3) {
|
} elseif ($step == 3) {
|
||||||
list($modifylist, $showlist, $ignorelist,$newlist) = $dzz_upgrade -> compare_basefile($upgradeinfo, $updatefilelist,$updatemd5filelist);
|
list($modifylist, $showlist, $ignorelist,$newlist) = $dzz_upgrade -> compare_basefile($upgradeinfo, $updatefilelist,$updatemd5filelist);
|
||||||
if (empty($modifylist) && empty($showlist) && empty($ignorelist) && empty($newlist)) {
|
if (empty($modifylist) && empty($showlist) && empty($ignorelist) && empty($newlist)) {
|
||||||
$msg = lang('filecheck_nofound_md5file', array('upgradeurl' => upgradeinformation(-4)));
|
$msg = lang('filecheck_nofound_md5file', array('upgradeurl' => upgradeinformation(-4)));
|
||||||
}
|
}
|
||||||
$linkurl = $theurl . '&step=4';
|
$linkurl = $theurl . '&step=4';
|
||||||
} elseif ($step == 4) {
|
} elseif ($step == 4) {
|
||||||
|
|
||||||
$confirm = $_GET['confirm'];
|
$confirm = $_GET['confirm'];
|
||||||
if (!$confirm) {
|
if (!$confirm) {
|
||||||
if ($_GET['siteftpsetting']) {
|
if ($_GET['siteftpsetting']) {
|
||||||
$action = $theurl . '&step=4&confirm=ftp' . ($_GET['startupgrade'] ? '&startupgrade=1' : '');
|
$action = $theurl . '&step=4&confirm=ftp' . ($_GET['startupgrade'] ? '&startupgrade=1' : '');
|
||||||
|
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($upgradeinfo['isupdatedb']) {
|
if ($upgradeinfo['isupdatedb']) {
|
||||||
$checkupdatefilelist = array('install/update.php', 'install/data/install.sql', 'install/data/install_data.sql');
|
$checkupdatefilelist = array('install/update.php', 'install/data/install.sql', 'install/data/install_data.sql');
|
||||||
$checkupdatefilelist = array_merge($checkupdatefilelist, $updatefilelist);
|
$checkupdatefilelist = array_merge($checkupdatefilelist, $updatefilelist);
|
||||||
} else {
|
} else {
|
||||||
$checkupdatefilelist = $updatefilelist;
|
$checkupdatefilelist = $updatefilelist;
|
||||||
}
|
}
|
||||||
if ($dzz_upgrade -> check_folder_perm($checkupdatefilelist)) {
|
if ($dzz_upgrade -> check_folder_perm($checkupdatefilelist)) {
|
||||||
$confirm = 'file';
|
$confirm = 'file';
|
||||||
} else {
|
} else {
|
||||||
$linkurl = $theurl . '&step=4';
|
$linkurl = $theurl . '&step=4';
|
||||||
$ftplinkurl = $linkurl . '&siteftpsetting=1';
|
$ftplinkurl = $linkurl . '&siteftpsetting=1';
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_cannot_access_file') . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_cannot_access_file') . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_set_ftp') . '" />';
|
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_set_ftp') . '" />';
|
||||||
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_reset') . '" /></p>';
|
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_reset') . '" /></p>';
|
||||||
$msg .= "<script type=\"text/javascript\">";
|
$msg .= "<script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script>";
|
$msg .= "</script>";
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$paraftp = '';
|
$paraftp = '';
|
||||||
if ($_GET['siteftp']) {
|
if ($_GET['siteftp']) {
|
||||||
foreach ($_GET['siteftp'] as $k => $v) {
|
foreach ($_GET['siteftp'] as $k => $v) {
|
||||||
$paraftp .= '&siteftp[' . $k . ']=' . $v;
|
$paraftp .= '&siteftp[' . $k . ']=' . $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$_GET['startupgrade']) {
|
if (!$_GET['startupgrade']) {
|
||||||
if (!$_GET['backfile']) {
|
if (!$_GET['backfile']) {
|
||||||
$linkurl = $theurl . '&step=4&backfile=1&confirm=' . $confirm . $paraftp;
|
$linkurl = $theurl . '&step=4&backfile=1&confirm=' . $confirm . $paraftp;
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_backuping', array('upgradeurl' => upgradeinformation(2))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_backuping', array('upgradeurl' => upgradeinformation(2))) . '</p>';
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($linkurl) . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($linkurl) . '\';", 1000);</script>';
|
||||||
$msg .= ' <p style="margin:10px 0"><a href="' . $linkurl . '">' . lang('message_redirect') . '</p>';
|
$msg .= ' <p style="margin:10px 0"><a href="' . $linkurl . '">' . lang('message_redirect') . '</p>';
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
foreach ($updatefilelist as $updatefile) {
|
foreach ($updatefilelist as $updatefile) {
|
||||||
$destfile = DZZ_ROOT . $updatefile;
|
$destfile = DZZ_ROOT . $updatefile;
|
||||||
$backfile = DZZ_ROOT . './data/back/pichome' . CORE_VERSION . '/' . $updatefile;
|
$backfile = DZZ_ROOT . './data/back/pichome' . CORE_VERSION . '/' . $updatefile;
|
||||||
if (is_file($destfile)) {
|
if (is_file($destfile)) {
|
||||||
if (!$dzz_upgrade -> copy_file($destfile, $backfile, 'file')) {
|
if (!$dzz_upgrade -> copy_file($destfile, $backfile, 'file')) {
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_backup_error', array('upgradeurl' => upgradeinformation(-5))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_backup_error', array('upgradeurl' => upgradeinformation(-5))) . '</p>';
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" >" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_backup_complete', array('upgradeurl' => upgradeinformation(3))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_backup_complete', array('upgradeurl' => upgradeinformation(3))) . '</p>';
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp) . '\';", 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout("location.href=\'' . ($theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp) . '\';", 1000);</script>';
|
||||||
$msg .= ' <p><a href="' . ($theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp) . '">' . lang('message_redirect') . '</p>';
|
$msg .= ' <p><a href="' . ($theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp) . '">' . lang('message_redirect') . '</p>';
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkurl = $theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp;
|
$linkurl = $theurl . '&step=4&startupgrade=1&confirm=' . $confirm . $paraftp;
|
||||||
$ftplinkurl = $theurl . '&step=4&startupgrade=1&siteftpsetting=1';
|
$ftplinkurl = $theurl . '&step=4&startupgrade=1&siteftpsetting=1';
|
||||||
foreach ($updatefilelist as $updatefile) {
|
foreach ($updatefilelist as $updatefile) {
|
||||||
$srcfile = DZZ_ROOT . './data/update/pichome' . $version . '/' . $updatefile;
|
$srcfile = DZZ_ROOT . './data/update/pichome' . $version . '/' . $updatefile;
|
||||||
if ($confirm == 'ftp') {
|
if ($confirm == 'ftp') {
|
||||||
$destfile = $updatefile;
|
$destfile = $updatefile;
|
||||||
} else {
|
} else {
|
||||||
$destfile = DZZ_ROOT . $updatefile;
|
$destfile = DZZ_ROOT . $updatefile;
|
||||||
}
|
}
|
||||||
if (!$dzz_upgrade -> copy_file($srcfile, $destfile, $confirm)) {
|
if (!$dzz_upgrade -> copy_file($srcfile, $destfile, $confirm)) {
|
||||||
if ($confirm == 'ftp') {
|
if ($confirm == 'ftp') {
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_ftp_upload_error', array('file' => $updatefile, 'upgradeurl' => upgradeinformation(-6))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_ftp_upload_error', array('file' => $updatefile, 'upgradeurl' => upgradeinformation(-6))) . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_reupload') . '" />';
|
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_reupload') . '" />';
|
||||||
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_reset_ftp') . '" /></p>';
|
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_reset_ftp') . '" /></p>';
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_copy_error', array('file' => $updatefile, 'upgradeurl' => upgradeinformation(-7))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_copy_error', array('file' => $updatefile, 'upgradeurl' => upgradeinformation(-7))) . '</p>';
|
||||||
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_recopy') . '" />';
|
$msg .= '<p style="margin:10px 0"><input type="button" class="btn btn-primary" onclick="window.location.href=\'' . $linkurl . '\'" value="' . lang('founder_upgrade_recopy') . '" />';
|
||||||
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_set_ftp') . '" /></p>';
|
$msg .= ' <input type="button" class="btn btn-default" onclick="window.location.href=\'' . $ftplinkurl . '\'" value="' . lang('founder_upgrade_set_ftp') . '" /></p>';
|
||||||
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
$msg .= "<p style=\"margin:10px 0\"><script type=\"text/javascript\">";
|
||||||
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
$msg .= "if(history.length > (BROWSER.ie ? 0 : 1)) document.write('<a href=\"javascript:history.go(-1);\" class=\"lightlink\">" . lang('message_return') . "</a>');";
|
||||||
$msg .= "</script></p>";
|
$msg .= "</script></p>";
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($upgradeinfo['isupdatedb']) {
|
if ($upgradeinfo['isupdatedb']) {
|
||||||
|
|
||||||
$upgrade_step['step'] = 'dbupdate';
|
$upgrade_step['step'] = 'dbupdate';
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize($upgrade_step), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
$dbreturnurl = $_G['siteurl'] . ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5';
|
||||||
$linkurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
$linkurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
||||||
$msg = '<p style="margin:10px 0">' . lang('upgrade_file_successful', array('upgradeurl' => upgradeinformation(4))) . '</p>';
|
$msg = '<p style="margin:10px 0">' . lang('upgrade_file_successful', array('upgradeurl' => upgradeinformation(4))) . '</p>';
|
||||||
$msg .= '<script type="text/JavaScript">setTimeout(function(){createIframe(\'' . $linkurl . '\');}, 1000);</script>';
|
$msg .= '<script type="text/JavaScript">setTimeout(function(){createIframe(\'' . $linkurl . '\');}, 1000);</script>';
|
||||||
$msg .= ' <p><a href="javascript:;" onclick="createIframe(\'' . $linkurl . '\');return false">' . lang('message_redirect') . '</p>';
|
$msg .= ' <p><a href="javascript:;" onclick="createIframe(\'' . $linkurl . '\');return false">' . lang('message_redirect') . '</p>';
|
||||||
include template('upgrade');
|
include template('upgrade');
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = outputurl( $_G['siteurl'].MOD_URL.'&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5' );
|
$url = outputurl( $_G['siteurl'].MOD_URL.'&op=systemupgrade&operation=' . $operation . '&version=' . $version . '&step=5' );
|
||||||
dheader('Location: ' . $url);
|
dheader('Location: ' . $url);
|
||||||
|
|
||||||
} elseif ($step == 5) {
|
} elseif ($step == 5) {
|
||||||
$file = DZZ_ROOT . './data/update/pichome' . $version . '/updatelist.tmp';
|
print_r(1111);
|
||||||
@unlink($file);
|
die;
|
||||||
@unlink(DZZ_ROOT . './install/update.php');
|
$file = DZZ_ROOT . './data/update/pichome' . $version . '/updatelist.tmp';
|
||||||
C::t('cache') -> delete('upgrade_step');
|
@unlink($file);
|
||||||
C::t('cache') -> delete('upgrade_run');
|
@unlink(DZZ_ROOT . './install/update.php');
|
||||||
C::t('setting') -> update('upgrade', '');
|
C::t('cache') -> delete('upgrade_step');
|
||||||
updatecache('setting');
|
C::t('cache') -> delete('upgrade_run');
|
||||||
$old_update_dir = './data/update/';
|
C::t('setting') -> update('upgrade', '');
|
||||||
$new_update_dir = './data/update' . md5('update' . $_G['config']['security']['authkey']) . '/';
|
updatecache('setting');
|
||||||
$old_back_dir = './data/back/';
|
$old_update_dir = './data/update/';
|
||||||
$new_back_dir = './data/back' . md5('back' . $_G['config']['security']['authkey']) . '/';
|
$new_update_dir = './data/update' . md5('update' . $_G['config']['security']['authkey']) . '/';
|
||||||
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_update_dir, DZZ_ROOT . $new_update_dir);
|
$old_back_dir = './data/back/';
|
||||||
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_back_dir, DZZ_ROOT . $new_back_dir);
|
$new_back_dir = './data/back' . md5('back' . $_G['config']['security']['authkey']) . '/';
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_update_dir, DZZ_ROOT . $new_update_dir);
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_back_dir);
|
$dzz_upgrade -> copy_dir(DZZ_ROOT . $old_back_dir, DZZ_ROOT . $new_back_dir);
|
||||||
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
||||||
$msg = lang('upgrade_successful', array('version' => $version, 'save_update_dir' => $new_update_dir, 'save_back_dir' => $new_back_dir, 'upgradeurl' => upgradeinformation(0)));
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_back_dir);
|
||||||
|
|
||||||
}
|
$msg = lang('upgrade_successful', array('version' => $version, 'save_update_dir' => $new_update_dir, 'save_back_dir' => $new_back_dir, 'upgradeurl' => upgradeinformation(0)));
|
||||||
|
|
||||||
}elseif ($operation == 'check') {
|
}
|
||||||
$msg = '';
|
|
||||||
if (!intval($_GET['rechecking'])) {
|
}elseif ($operation == 'check') {
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
$msg = '';
|
||||||
if (!empty($upgrade_step['cachevalue'])) {
|
if (!intval($_GET['rechecking'])) {
|
||||||
$upgrade_step['cachevalue'] = dunserialize($upgrade_step['cachevalue']);
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
if (!empty($upgrade_step['cachevalue']['step'])) {
|
if (!empty($upgrade_step['cachevalue'])) {
|
||||||
$theurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $upgrade_step['cachevalue']['operation'] . '&version=' . $upgrade_step['cachevalue']['version'] . '&locale=' . $upgrade_step['cachevalue']['locale'] . '&charset=' . $upgrade_step['cachevalue']['charset'];
|
$upgrade_step['cachevalue'] = dunserialize($upgrade_step['cachevalue']);
|
||||||
|
if (!empty($upgrade_step['cachevalue']['step'])) {
|
||||||
$recheckurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=recheck';
|
$theurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $upgrade_step['cachevalue']['operation'] . '&version=' . $upgrade_step['cachevalue']['version'] . '&locale=' . $upgrade_step['cachevalue']['locale'] . '&charset=' . $upgrade_step['cachevalue']['charset'];
|
||||||
if ($upgrade_step['cachevalue']['step'] == 'dbupdate') {
|
|
||||||
$dbreturnurl = $_G['siteurl'] . $theurl . '&step=5';
|
$recheckurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=recheck';
|
||||||
$stepurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
if ($upgrade_step['cachevalue']['step'] == 'dbupdate') {
|
||||||
$msg = '<p style="margin:10px 0;">' . lang('upgrade_continue_db', array('steplang' => $steplang['dbupdate'], 'stepurl' => $stepurl, 'recheckurl' => $recheckurl)) . '</p>';
|
$dbreturnurl = $_G['siteurl'] . $theurl . '&step=5';
|
||||||
|
$stepurl = $_G['siteurl'] . 'install/update.php?step=prepare&from=' . rawurlencode($dbreturnurl) . '&frommd5=' . rawurlencode(md5($dbreturnurl . $_G['config']['security']['authkey']));
|
||||||
} else {
|
$msg = '<p style="margin:10px 0;">' . lang('upgrade_continue_db', array('steplang' => $steplang['dbupdate'], 'stepurl' => $stepurl, 'recheckurl' => $recheckurl)) . '</p>';
|
||||||
$stepurl = $theurl . '&step=' . $upgrade_step['cachevalue']['step'];
|
|
||||||
$msg = '<p style="margin:10px 0;">' . lang('upgrade_continue', array('steplang' => $steplang[$upgrade_step['cachevalue']['step']], 'stepurl' => $stepurl, 'recheckurl' => $recheckurl)) . '</p>';
|
} else {
|
||||||
|
$stepurl = $theurl . '&step=' . $upgrade_step['cachevalue']['step'];
|
||||||
}
|
$msg = '<p style="margin:10px 0;">' . lang('upgrade_continue', array('steplang' => $steplang[$upgrade_step['cachevalue']['step']], 'stepurl' => $stepurl, 'recheckurl' => $recheckurl)) . '</p>';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
C::t('cache') -> delete('upgrade_step');
|
}
|
||||||
}
|
} else {
|
||||||
|
C::t('cache') -> delete('upgrade_step');
|
||||||
if (!intval($_GET['checking']) || $msg) {
|
}
|
||||||
|
|
||||||
|
if (!intval($_GET['checking']) || $msg) {
|
||||||
} else {
|
|
||||||
$dzz_upgrade -> check_upgrade();
|
|
||||||
$url = outputurl( $_G['siteurl'].MOD_URL.'&op=systemupgrade&operation=showupgrade' );
|
} else {
|
||||||
dheader('Location: ' . $url);
|
$dzz_upgrade -> check_upgrade();
|
||||||
}
|
$url = outputurl( $_G['siteurl'].MOD_URL.'&op=systemupgrade&operation=showupgrade' );
|
||||||
|
dheader('Location: ' . $url);
|
||||||
}elseif ($operation == 'showupgrade') {
|
}
|
||||||
|
|
||||||
if ($_G['setting']['upgrade']) {
|
}elseif ($operation == 'showupgrade') {
|
||||||
|
|
||||||
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize(array('curversion' => $dzz_upgrade -> versionpath())), 'dateline' => $_G['timestamp'], ), false, true);
|
if ($_G['setting']['upgrade']) {
|
||||||
|
|
||||||
$upgraderow = $patchrow = array();
|
C::t('cache') -> insert(array('cachekey' => 'upgrade_step', 'cachevalue' => serialize(array('curversion' => $dzz_upgrade -> versionpath())), 'dateline' => $_G['timestamp'], ), false, true);
|
||||||
$charset = str_replace('-', '', strtoupper($_G['config']['output']['charset']));
|
|
||||||
$dbversion = helper_dbtool::dbversion();
|
$upgraderow = $patchrow = array();
|
||||||
$locale = '';
|
$charset = str_replace('-', '', strtoupper($_G['config']['output']['charset']));
|
||||||
|
$dbversion = helper_dbtool::dbversion();
|
||||||
if ($charset == 'BIG5') {
|
$locale = '';
|
||||||
$locale = 'TC';
|
|
||||||
} elseif ($charset == 'GBK') {
|
if ($charset == 'BIG5') {
|
||||||
$locale = 'SC';
|
$locale = 'TC';
|
||||||
} elseif ($charset == 'UTF8') {
|
} elseif ($charset == 'GBK') {
|
||||||
if ($_G['config']['output']['language'] == 'zh-cn' || $_G['config']['output']['language'] == 'zh_cn') {
|
$locale = 'SC';
|
||||||
$locale = 'SC';
|
} elseif ($charset == 'UTF8') {
|
||||||
} elseif ($_G['config']['output']['language'] == 'zh-tw' || $_G['config']['output']['language'] == 'zh_tw') {
|
if ($_G['config']['output']['language'] == 'zh-cn' || $_G['config']['output']['language'] == 'zh_cn') {
|
||||||
$locale = 'TC';
|
$locale = 'SC';
|
||||||
}else{
|
} elseif ($_G['config']['output']['language'] == 'zh-tw' || $_G['config']['output']['language'] == 'zh_tw') {
|
||||||
$locale = 'SC';
|
$locale = 'TC';
|
||||||
}
|
}else{
|
||||||
}
|
$locale = 'SC';
|
||||||
|
}
|
||||||
if (!is_array($_G['setting']['upgrade']))
|
}
|
||||||
$_G['setting']['upgrade'] = unserialize($_G['setting']['upgrade']);
|
|
||||||
$list = array();
|
if (!is_array($_G['setting']['upgrade']))
|
||||||
foreach ($_G['setting']['upgrade'] as $type => $upgrade) {
|
$_G['setting']['upgrade'] = unserialize($_G['setting']['upgrade']);
|
||||||
$unupgrade = 0;
|
$list = array();
|
||||||
if (version_compare($upgrade['phpversion'], PHP_VERSION) > 0 || version_compare($upgrade['mysqlversion'], $dbversion) > 0) {
|
foreach ($_G['setting']['upgrade'] as $type => $upgrade) {
|
||||||
$unupgrade = 1;
|
$unupgrade = 0;
|
||||||
}
|
if (version_compare($upgrade['phpversion'], PHP_VERSION) > 0 || version_compare($upgrade['mysqlversion'], $dbversion) > 0) {
|
||||||
$list[$type]['linkurl'] = $linkurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $type . '&version=' . $upgrade['latestversion'] . '&locale=' . $locale . '&charset=' . $charset;
|
$unupgrade = 1;
|
||||||
if ($unupgrade) {
|
}
|
||||||
$list[$type]['title'] = 'oaooa PicHome ' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
$list[$type]['linkurl'] = $linkurl = ADMINSCRIPT . '?mod=system&op=systemupgrade&operation=' . $type . '&version=' . $upgrade['latestversion'] . '&locale=' . $locale . '&charset=' . $charset;
|
||||||
$list[$type]['btn1'] = lang('founder_upgrade_require_config') . ' php v' . PHP_VERSION . 'MYSQL v' . $dbversion;
|
if ($unupgrade) {
|
||||||
} else {
|
$list[$type]['title'] = 'oaooa PicHome ' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
||||||
$list[$type]['title'] = 'oaooa PicHome ' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
$list[$type]['btn1'] = lang('founder_upgrade_require_config') . ' php v' . PHP_VERSION . 'MYSQL v' . $dbversion;
|
||||||
$list[$type]['btn1'] = '<input type="button" class="btn btn-success" onclick="confirm(\'' . lang('founder_upgrade_backup_remind') . '\') ? window.location.href=\'' . $linkurl . '\' : \'\';" value="' . lang('founder_upgrade_automatically') . '">';
|
} else {
|
||||||
$list[$type]['official'] = '<a class="btn btn-link" href="' . $upgrade['official'] . '" target="_blank">' . lang('founder_upgrade_manually') . '</a>';
|
$list[$type]['title'] = 'oaooa PicHome ' . $upgrade['latestversion'] . '_' . $locale . '_' . $charset;
|
||||||
}
|
$list[$type]['btn1'] = '<input type="button" class="btn btn-success" onclick="confirm(\'' . lang('founder_upgrade_backup_remind') . '\') ? window.location.href=\'' . $linkurl . '\' : \'\';" value="' . lang('founder_upgrade_automatically') . '">';
|
||||||
}
|
$list[$type]['official'] = '<a class="btn btn-link" href="' . $upgrade['official'] . '" target="_blank">' . lang('founder_upgrade_manually') . '</a>';
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
$msg = lang('upgrade_latest_version');
|
} else {
|
||||||
}
|
|
||||||
|
$msg = lang('upgrade_latest_version');
|
||||||
}elseif ($operation == 'recheck') {
|
}
|
||||||
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
|
||||||
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
}elseif ($operation == 'recheck') {
|
||||||
$file = DZZ_ROOT . './data/update/pichome' . $upgrade_step['version'] . '/updatelist.tmp';
|
$upgrade_step = C::t('cache') -> fetch('upgrade_step');
|
||||||
@unlink($file);
|
$upgrade_step = dunserialize($upgrade_step['cachevalue']);
|
||||||
@unlink(DZZ_ROOT . './install/update.php');
|
$file = DZZ_ROOT . './data/update/pichome' . $upgrade_step['version'] . '/updatelist.tmp';
|
||||||
C::t('cache') -> delete('upgrade_step');
|
@unlink($file);
|
||||||
C::t('cache') -> delete('upgrade_run');
|
@unlink(DZZ_ROOT . './install/update.php');
|
||||||
C::t('setting') -> update('upgrade', '');
|
C::t('cache') -> delete('upgrade_step');
|
||||||
updatecache('setting');
|
C::t('cache') -> delete('upgrade_run');
|
||||||
$old_update_dir = './data/update/';
|
C::t('setting') -> update('upgrade', '');
|
||||||
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
updatecache('setting');
|
||||||
|
$old_update_dir = './data/update/';
|
||||||
$url = outputurl($_G['siteurl'].MOD_URL.'&op=systemupgrade' );
|
$dzz_upgrade -> rmdirs(DZZ_ROOT . $old_update_dir);
|
||||||
dheader('Location: ' . $url);
|
|
||||||
}
|
$url = outputurl($_G['siteurl'].MOD_URL.'&op=systemupgrade' );
|
||||||
include template('upgrade');
|
dheader('Location: ' . $url);
|
||||||
|
}
|
||||||
|
include template('upgrade');
|
||||||
?>
|
?>
|
||||||
@@ -1,51 +1,51 @@
|
|||||||
<?php
|
<?php
|
||||||
//error_reporting(E_ALL);
|
//error_reporting(E_ALL);
|
||||||
if(!defined('IN_OAOOA')) {
|
if(!defined('IN_OAOOA')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
define('NOROBOT', TRUE);
|
define('NOROBOT', TRUE);
|
||||||
$returntype = isset($_GET['returnType']) ? $_GET['returnType']: 'json';//返回值方式
|
$returntype = isset($_GET['returnType']) ? $_GET['returnType']: 'json';//返回值方式
|
||||||
|
|
||||||
$checkLanguage = $_G['language'];
|
$checkLanguage = $_G['language'];
|
||||||
if(file_exists (DZZ_ROOT.'./admin/language/'.$checkLanguage.'/'.'lang.php')){
|
if(file_exists (DZZ_ROOT.'./admin/language/'.$checkLanguage.'/'.'lang.php')){
|
||||||
include DZZ_ROOT.'./admin/language/'.$checkLanguage.'/'.'lang.php';
|
include DZZ_ROOT.'./admin/language/'.$checkLanguage.'/'.'lang.php';
|
||||||
$_G['lang']['template']=array_merge($_G['lang']['template'],$lang);
|
$_G['lang']['template']=array_merge($_G['lang']['template'],$lang);
|
||||||
}
|
}
|
||||||
//判断管理员登录
|
//判断管理员登录
|
||||||
//Hook::listen('adminlogin');
|
//Hook::listen('adminlogin');
|
||||||
//后台管理页面
|
//后台管理页面
|
||||||
if(submitcheck('settingsubmit')){
|
if(submitcheck('settingsubmit')){
|
||||||
if ($_G['adminid'] != 1){
|
if ($_G['adminid'] != 1){
|
||||||
showmessage( lang('no_privilege') ,$returntype);
|
showmessage( lang('no_privilege') ,$returntype);
|
||||||
}
|
}
|
||||||
$settingnew=$_GET["settingnew"];
|
$settingnew=$_GET["settingnew"];
|
||||||
$data=array();
|
$data=array();
|
||||||
foreach($settingnew["mark"] as $k=>$v){
|
foreach($settingnew["mark"] as $k=>$v){
|
||||||
if( isset($data[$v]) ){
|
if( isset($data[$v]) ){
|
||||||
showmessage( lang('Logtag').$v.lang('repeat') ,$returntype);
|
showmessage( lang('Logtag').$v.lang('repeat') ,$returntype);
|
||||||
}
|
}
|
||||||
$data[$v]=array(
|
$data[$v]=array(
|
||||||
"title" => $settingnew["title"][$k],
|
"title" => $settingnew["title"][$k],
|
||||||
"is_open" => intval($settingnew["is_open"][$k]),
|
"is_open" => intval($settingnew["is_open"][$k]),
|
||||||
"issystem" => $settingnew["issystem"][$k]
|
"issystem" => $settingnew["issystem"][$k]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$settingnew = serialize($data);
|
$settingnew = serialize($data);
|
||||||
$update=array(
|
$update=array(
|
||||||
"systemlog_open" =>$_GET["systemlog_open"],
|
"systemlog_open" =>$_GET["systemlog_open"],
|
||||||
"systemlog_setting" =>$settingnew,
|
"systemlog_setting" =>$settingnew,
|
||||||
);
|
);
|
||||||
$result = C::t('setting') ->update_batch($update);
|
$result = C::t('setting') ->update_batch($update);
|
||||||
if( $result ){
|
if( $result ){
|
||||||
include_once libfile('function/cache');
|
include_once libfile('function/cache');
|
||||||
updatecache('setting');
|
updatecache('setting');
|
||||||
}
|
}
|
||||||
writelog('otherlog', lang('Update_setting'));
|
writelog('otherlog', lang('Update_setting'));
|
||||||
showmessage('do_success', dreferer());
|
showmessage('do_success', dreferer());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$systemlog_setting = ($_G["setting"]["systemlog_setting"]);
|
$systemlog_setting = ($_G["setting"]["systemlog_setting"]);
|
||||||
$navtitle=lang('systemlog_setting').' - '.lang('appname');
|
$navtitle=lang('systemlog_setting').' - '.lang('appname');
|
||||||
include template("admin");
|
include template("admin");
|
||||||
}
|
}
|
||||||
@@ -1,63 +1,63 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace admin\systemlog\classes;
|
namespace admin\systemlog\classes;
|
||||||
class Systemlog{
|
class Systemlog{
|
||||||
//$arr 必须传入 level,content
|
//$arr 必须传入 level,content
|
||||||
public function run( $arr=array() ){
|
public function run( $arr=array() ){
|
||||||
global $_G;
|
global $_G;
|
||||||
if( $_G['setting']['systemlog_open'] > 0 ){
|
if( $_G['setting']['systemlog_open'] > 0 ){
|
||||||
$systemlog_setting = ($_G['setting']['systemlog_setting']);
|
$systemlog_setting = ($_G['setting']['systemlog_setting']);
|
||||||
//判断是否开启该类型日志
|
//判断是否开启该类型日志
|
||||||
if(!isset($arr["mark"]) || (isset($systemlog_setting[$arr["mark"]]) && $systemlog_setting[$arr["mark"]]["is_open"]!=1) ){
|
if(!isset($arr["mark"]) || (isset($systemlog_setting[$arr["mark"]]) && $systemlog_setting[$arr["mark"]]["is_open"]!=1) ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$file=$arr["mark"];//$arr["level"];//级别
|
$file=$arr["mark"];//$arr["level"];//级别
|
||||||
$log=$arr["content"];
|
$log=$arr["content"];
|
||||||
$yearmonth = "dzz";//dgmdate(TIMESTAMP, 'Ym', $_G['setting']['timeoffset']);
|
$yearmonth = "dzz";//dgmdate(TIMESTAMP, 'Ym', $_G['setting']['timeoffset']);
|
||||||
$logdir = DZZ_ROOT.'./data/log/';
|
$logdir = DZZ_ROOT.'./data/log/';
|
||||||
$logfile = $logdir.$yearmonth.'_'.$file.'.php';
|
$logfile = $logdir.$yearmonth.'_'.$file.'.php';
|
||||||
|
|
||||||
//检查并返回当前log文件行数
|
//检查并返回当前log文件行数
|
||||||
$i=0;
|
$i=0;
|
||||||
if( file_exists($logfile)){
|
if( file_exists($logfile)){
|
||||||
$fp=fopen($logfile, "r");
|
$fp=fopen($logfile, "r");
|
||||||
while(!feof($fp)) {
|
while(!feof($fp)) {
|
||||||
//每次最多读取1M
|
//每次最多读取1M
|
||||||
if($data=fread($fp,1024*1024*1)){
|
if($data=fread($fp,1024*1024*1)){
|
||||||
//计算读取到的行数
|
//计算读取到的行数
|
||||||
$num=substr_count($data,"\n");
|
$num=substr_count($data,"\n");
|
||||||
$i+=$num;
|
$i+=$num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
//每4000行重新生成日志文件
|
//每4000行重新生成日志文件
|
||||||
if($i>=4000) {
|
if($i>=4000) {
|
||||||
$dir = opendir($logdir);
|
$dir = opendir($logdir);
|
||||||
$length = strlen($file);
|
$length = strlen($file);
|
||||||
$maxid = $id = 0;
|
$maxid = $id = 0;
|
||||||
while($entry = readdir($dir)) {
|
while($entry = readdir($dir)) {
|
||||||
if(strpos($entry, $yearmonth.'_'.$file) !== false) {
|
if(strpos($entry, $yearmonth.'_'.$file) !== false) {
|
||||||
$id = intval(substr($entry, $length + 8, -4));
|
$id = intval(substr($entry, $length + 8, -4));
|
||||||
$id > $maxid && $maxid = $id;
|
$id > $maxid && $maxid = $id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
$logfilebak = $logdir.$yearmonth.'_'.$file.'_'.($maxid + 1).'.php';
|
$logfilebak = $logdir.$yearmonth.'_'.$file.'_'.($maxid + 1).'.php';
|
||||||
@rename($logfile, $logfilebak);
|
@rename($logfile, $logfilebak);
|
||||||
}
|
}
|
||||||
if($fp = @fopen($logfile, 'a')) {
|
if($fp = @fopen($logfile, 'a')) {
|
||||||
@flock($fp, 2);
|
@flock($fp, 2);
|
||||||
if(!is_array($log)) {
|
if(!is_array($log)) {
|
||||||
$log = array($log);
|
$log = array($log);
|
||||||
}
|
}
|
||||||
$cur_url = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
|
$cur_url = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
|
||||||
$from_url = $_SERVER['HTTP_REFERER'];
|
$from_url = $_SERVER['HTTP_REFERER'];
|
||||||
foreach($log as $tmp) {
|
foreach($log as $tmp) {
|
||||||
$tmp=implode("\t", clearlogstring(array($_G['timestamp'], $_G['username'], $_G['groupid'], $_G['clientip'],$tmp,$cur_url,$from_url))) ;
|
$tmp=implode("\t", clearlogstring(array($_G['timestamp'], $_G['username'], $_G['groupid'], $_G['clientip'],$tmp,$cur_url,$from_url))) ;
|
||||||
fwrite($fp, "<?PHP exit;?>\t".str_replace(array('<?', '?>'), '', $tmp)."\n");
|
fwrite($fp, "<?PHP exit;?>\t".str_replace(array('<?', '?>'), '', $tmp)."\n");
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,177 +1,177 @@
|
|||||||
<?php
|
<?php
|
||||||
//error_reporting(E_ALL);
|
//error_reporting(E_ALL);
|
||||||
if(!defined('IN_OAOOA')) {
|
if(!defined('IN_OAOOA')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
define('NOROBOT', TRUE);
|
define('NOROBOT', TRUE);
|
||||||
$returntype = isset($_GET['returnType']) ? $_GET['returnType']: 'json';//返回值方式
|
$returntype = isset($_GET['returnType']) ? $_GET['returnType']: 'json';//返回值方式
|
||||||
$type=$_GET['type'];
|
$type=$_GET['type'];
|
||||||
if(!in_array($type, array('list'))) {
|
if(!in_array($type, array('list'))) {
|
||||||
$type='list';
|
$type='list';
|
||||||
}
|
}
|
||||||
|
|
||||||
$checkLanguage = $_G['language'];
|
$checkLanguage = $_G['language'];
|
||||||
if(file_exists (DZZ_ROOT.'./admin/language/'.$checkLanguage.'/'.'lang.php')){
|
if(file_exists (DZZ_ROOT.'./admin/language/'.$checkLanguage.'/'.'lang.php')){
|
||||||
include DZZ_ROOT.'./admin/language/'.$checkLanguage.'/'.'lang.php';
|
include DZZ_ROOT.'./admin/language/'.$checkLanguage.'/'.'lang.php';
|
||||||
$_G['lang']['template']=array_merge($_G['lang']['template'],$lang);
|
$_G['lang']['template']=array_merge($_G['lang']['template'],$lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($type=="list"){
|
if($type=="list"){
|
||||||
//Hook::listen('adminlogin');
|
//Hook::listen('adminlogin');
|
||||||
!isset($_GET['page']) && $_GET['page']=1;
|
!isset($_GET['page']) && $_GET['page']=1;
|
||||||
$page=max(1,intval($_GET['page']));
|
$page=max(1,intval($_GET['page']));
|
||||||
$lpp = empty($_GET['lpp']) ? 15 : $_GET['lpp'];
|
$lpp = empty($_GET['lpp']) ? 15 : $_GET['lpp'];
|
||||||
$checklpp = array();
|
$checklpp = array();
|
||||||
$checklpp[$lpp] = 'selected="selected"';
|
$checklpp[$lpp] = 'selected="selected"';
|
||||||
$extrainput = '';
|
$extrainput = '';
|
||||||
$systemlog_setting = is_serialized($_G["setting"]["systemlog_setting"])?unserialize($_G["setting"]["systemlog_setting"]):$_G["setting"]["systemlog_setting"];
|
$systemlog_setting = is_serialized($_G["setting"]["systemlog_setting"])?unserialize($_G["setting"]["systemlog_setting"]):$_G["setting"]["systemlog_setting"];
|
||||||
$operationarr = array_keys($systemlog_setting);
|
$operationarr = array_keys($systemlog_setting);
|
||||||
$operation = in_array($_GET['operation'], $operationarr) ? $_GET['operation'] : "cplog";
|
$operation = in_array($_GET['operation'], $operationarr) ? $_GET['operation'] : "cplog";
|
||||||
$navtitle=$systemlog_setting[$operation]["title"].' - '.lang('appname');//lang('nav_logs_'.$operation).' - '.lang('admin_navtitle');
|
$navtitle=$systemlog_setting[$operation]["title"].' - '.lang('appname');//lang('nav_logs_'.$operation).' - '.lang('admin_navtitle');
|
||||||
|
|
||||||
$logdir = DZZ_ROOT.'./data/log/';
|
$logdir = DZZ_ROOT.'./data/log/';
|
||||||
$logfiles = get_log_files($logdir, $operation);
|
$logfiles = get_log_files($logdir, $operation);
|
||||||
|
|
||||||
if($logfiles) $logfiles=array_reverse($logfiles);
|
if($logfiles) $logfiles=array_reverse($logfiles);
|
||||||
//error_reporting(E_ALL);
|
//error_reporting(E_ALL);
|
||||||
$firstlogs = file( $logdir.$logfiles[0] ) ;
|
$firstlogs = file( $logdir.$logfiles[0] ) ;
|
||||||
$firstlogsnum = count($firstlogs);
|
$firstlogsnum = count($firstlogs);
|
||||||
$countlogfile=count($logfiles);
|
$countlogfile=count($logfiles);
|
||||||
$count = ($countlogfile-1)*4000+$firstlogsnum;
|
$count = ($countlogfile-1)*4000+$firstlogsnum;
|
||||||
$multipage = multi($count, $lpp, $page, MOD_URL."&type=list&operation=$operation&lpp=$lpp",'pull-right' );
|
$multipage = multi($count, $lpp, $page, MOD_URL."&type=list&operation=$operation&lpp=$lpp",'pull-right' );
|
||||||
|
|
||||||
$logs = array();
|
$logs = array();
|
||||||
$jishu=4000;//每个日志文件最多行数
|
$jishu=4000;//每个日志文件最多行数
|
||||||
$start = ($page - 1) * $lpp;
|
$start = ($page - 1) * $lpp;
|
||||||
$lastlog=$last_secondlog="";
|
$lastlog=$last_secondlog="";
|
||||||
|
|
||||||
$newdata=array();
|
$newdata=array();
|
||||||
foreach($logfiles as $k=>$v){
|
foreach($logfiles as $k=>$v){
|
||||||
$nowfilemaxnum=($jishu*($k+1))-($jishu-$firstlogsnum);
|
$nowfilemaxnum=($jishu*($k+1))-($jishu-$firstlogsnum);
|
||||||
$startnum=($nowfilemaxnum-$jishu)<=0?0:($nowfilemaxnum-$jishu+1);
|
$startnum=($nowfilemaxnum-$jishu)<=0?0:($nowfilemaxnum-$jishu+1);
|
||||||
$newdata[]=array("file"=>$v,"start"=>$startnum,"end"=>$nowfilemaxnum);
|
$newdata[]=array("file"=>$v,"start"=>$startnum,"end"=>$nowfilemaxnum);
|
||||||
}
|
}
|
||||||
//print_R($newdata);
|
//print_R($newdata);
|
||||||
//查询当前分页数据位于哪个日志文件
|
//查询当前分页数据位于哪个日志文件
|
||||||
$lastlog=$last_secondlog="";
|
$lastlog=$last_secondlog="";
|
||||||
foreach($newdata as $k=>$v){
|
foreach($newdata as $k=>$v){
|
||||||
if( $start<=$v["end"]){
|
if( $start<=$v["end"]){
|
||||||
$lastlog=$v;
|
$lastlog=$v;
|
||||||
if( ($start+$lpp)<$v["end"]){
|
if( ($start+$lpp)<$v["end"]){
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if( isset($newdata[$k+1])){
|
if( isset($newdata[$k+1])){
|
||||||
$last_secondlog=$newdata[$k+1];
|
$last_secondlog=$newdata[$k+1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$j=0;
|
$j=0;
|
||||||
for($i=$lastlog["start"];$i<$lastlog["end"];$i++){
|
for($i=$lastlog["start"];$i<$lastlog["end"];$i++){
|
||||||
if( $start<=($lastlog["start"]+$j) ){
|
if( $start<=($lastlog["start"]+$j) ){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
//获取数据开始
|
//获取数据开始
|
||||||
$logs = file( $logdir.$lastlog["file"] );
|
$logs = file( $logdir.$lastlog["file"] );
|
||||||
$logs = array_reverse($logs);
|
$logs = array_reverse($logs);
|
||||||
if( $lastlog["file"]!=$logfiles[0] ){
|
if( $lastlog["file"]!=$logfiles[0] ){
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
$logs = array_slice($logs, $j, $lpp);
|
$logs = array_slice($logs, $j, $lpp);
|
||||||
$onecountget = count($logs);
|
$onecountget = count($logs);
|
||||||
|
|
||||||
$jj=0;
|
$jj=0;
|
||||||
if( $last_secondlog ){
|
if( $last_secondlog ){
|
||||||
for($i=$last_secondlog["start"];$i<$last_secondlog["end"];$i++){
|
for($i=$last_secondlog["start"];$i<$last_secondlog["end"];$i++){
|
||||||
if( ($jj)>= ($lpp-$onecountget) ){//$last_secondlog["start"] ){
|
if( ($jj)>= ($lpp-$onecountget) ){//$last_secondlog["start"] ){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$jj++;
|
$jj++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($last_secondlog){
|
if($last_secondlog){
|
||||||
$logs2 = file( $logdir.$last_secondlog["file"] );
|
$logs2 = file( $logdir.$last_secondlog["file"] );
|
||||||
$logs2 = array_reverse($logs2);
|
$logs2 = array_reverse($logs2);
|
||||||
$end=$lpp-count($logs);
|
$end=$lpp-count($logs);
|
||||||
$logs2 = array_slice( $logs2, 0, $jj);
|
$logs2 = array_slice( $logs2, 0, $jj);
|
||||||
$logs=array_merge($logs,$logs2);
|
$logs=array_merge($logs,$logs2);
|
||||||
}
|
}
|
||||||
//获取数据结束
|
//获取数据结束
|
||||||
|
|
||||||
$usergroup = array();
|
$usergroup = array();
|
||||||
foreach(C::t('usergroup')->range() as $group) {
|
foreach(C::t('usergroup')->range() as $group) {
|
||||||
$usergroup[$group['groupid']] = $group['grouptitle'];
|
$usergroup[$group['groupid']] = $group['grouptitle'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$list=array();
|
$list=array();
|
||||||
foreach($logs as $k => $logrow) {
|
foreach($logs as $k => $logrow) {
|
||||||
$log = explode("\t", $logrow);
|
$log = explode("\t", $logrow);
|
||||||
if(empty($log[1])) {
|
if(empty($log[1])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$log[1] = dgmdate($log[1], 'y-n-j H:i');
|
$log[1] = dgmdate($log[1], 'y-n-j H:i');
|
||||||
$log[2] = $log[2];
|
$log[2] = $log[2];
|
||||||
$log[2] = ($log[2] != $_G['member']['username'] ? "<b>$log[2]</b>" : $log[2]);
|
$log[2] = ($log[2] != $_G['member']['username'] ? "<b>$log[2]</b>" : $log[2]);
|
||||||
$log[3] = $usergroup[$log[3]];
|
$log[3] = $usergroup[$log[3]];
|
||||||
|
|
||||||
$list[$k]=$log;
|
$list[$k]=$log;
|
||||||
}
|
}
|
||||||
|
|
||||||
include template('list');
|
include template('list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getactionarray() {
|
function getactionarray() {
|
||||||
$isfounder = true;
|
$isfounder = true;
|
||||||
unset($topmenu['index'], $menu['index']);
|
unset($topmenu['index'], $menu['index']);
|
||||||
$actioncat = $actionarray = array();
|
$actioncat = $actionarray = array();
|
||||||
$actioncat[] = 'setting';
|
$actioncat[] = 'setting';
|
||||||
$actioncat = array_merge($actioncat, array_keys($topmenu));
|
$actioncat = array_merge($actioncat, array_keys($topmenu));
|
||||||
foreach($menu as $tkey => $items) {
|
foreach($menu as $tkey => $items) {
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
$actionarray[$tkey][] = $item;
|
$actionarray[$tkey][] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return array('actions' => $actionarray, 'cats' => $actioncat);
|
return array('actions' => $actionarray, 'cats' => $actioncat);
|
||||||
}
|
}
|
||||||
function get_log_files($logdir = '', $action = 'action') {
|
function get_log_files($logdir = '', $action = 'action') {
|
||||||
$dir = opendir($logdir);
|
$dir = opendir($logdir);
|
||||||
$files = array();
|
$files = array();
|
||||||
while($entry = readdir($dir)) {
|
while($entry = readdir($dir)) {
|
||||||
$files[] = $entry;
|
$files[] = $entry;
|
||||||
}
|
}
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
|
|
||||||
if($files) {
|
if($files) {
|
||||||
sort($files);
|
sort($files);
|
||||||
$logfile = $action;
|
$logfile = $action;
|
||||||
$logfiles = array();
|
$logfiles = array();
|
||||||
$ym = '';
|
$ym = '';
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
if(strpos($file, $logfile) !== FALSE) {
|
if(strpos($file, $logfile) !== FALSE) {
|
||||||
if(substr($file, 0, 6) != $ym) {
|
if(substr($file, 0, 6) != $ym) {
|
||||||
$ym = substr($file, 0, 6);
|
$ym = substr($file, 0, 6);
|
||||||
}
|
}
|
||||||
$logfiles[$ym][] = $file;
|
$logfiles[$ym][] = $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($logfiles) {
|
if($logfiles) {
|
||||||
$lfs = array();
|
$lfs = array();
|
||||||
foreach($logfiles as $ym => $lf) {
|
foreach($logfiles as $ym => $lf) {
|
||||||
$lastlogfile = $lf[0];
|
$lastlogfile = $lf[0];
|
||||||
unset($lf[0]);
|
unset($lf[0]);
|
||||||
$lf[] = $lastlogfile;
|
$lf[] = $lastlogfile;
|
||||||
$lfs = array_merge($lfs, $lf);
|
$lfs = array_merge($lfs, $lf);
|
||||||
}
|
}
|
||||||
return $lfs;
|
return $lfs;
|
||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
@@ -1,33 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* 应用安装文件;
|
* 应用安装文件;
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author qchlian
|
* @author qchlian
|
||||||
*/
|
*/
|
||||||
if(!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if(!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
/*以下配置初始化时已存入数据库配置表
|
/*以下配置初始化时已存入数据库配置表
|
||||||
*$systemlog_setting = array(
|
*$systemlog_setting = array(
|
||||||
* 级别 名称 标记 是否开启
|
* 级别 名称 标记 是否开启
|
||||||
"errorlog"=>array("title"=>"系统错误","is_open"=>1,"issystem"=>1),
|
"errorlog"=>array("title"=>"系统错误","is_open"=>1,"issystem"=>1),
|
||||||
"cplog"=>array("title"=>"后台访问","is_open"=>1,"issystem"=>1),
|
"cplog"=>array("title"=>"后台访问","is_open"=>1,"issystem"=>1),
|
||||||
"deletelog"=>array("title"=>"数据删除","is_open"=>1,"issystem"=>1),
|
"deletelog"=>array("title"=>"数据删除","is_open"=>1,"issystem"=>1),
|
||||||
"updatelog"=>array("title"=>"数据更新","is_open"=>1,"issystem"=>1),
|
"updatelog"=>array("title"=>"数据更新","is_open"=>1,"issystem"=>1),
|
||||||
"loginlog"=>array("title"=>"用户登录","is_open"=>1,"issystem"=>1),
|
"loginlog"=>array("title"=>"用户登录","is_open"=>1,"issystem"=>1),
|
||||||
"sendmail"=>array("title"=>"邮件发送","is_open"=>1,"issystem"=>1),
|
"sendmail"=>array("title"=>"邮件发送","is_open"=>1,"issystem"=>1),
|
||||||
"otherlog"=>array("title"=>"其他信息","is_open"=>1,"issystem"=>1),
|
"otherlog"=>array("title"=>"其他信息","is_open"=>1,"issystem"=>1),
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = <<<EOF
|
$sql = <<<EOF
|
||||||
DELETE FROM `dzz_setting` WHERE `skey` = 'systemlog_open';
|
DELETE FROM `dzz_setting` WHERE `skey` = 'systemlog_open';
|
||||||
INSERT INTO `dzz_setting` (`skey`,`svalue`) VALUES ('systemlog_open', '1');
|
INSERT INTO `dzz_setting` (`skey`,`svalue`) VALUES ('systemlog_open', '1');
|
||||||
DELETE FROM `dzz_setting` WHERE `skey` = 'systemlog_setting';
|
DELETE FROM `dzz_setting` WHERE `skey` = 'systemlog_setting';
|
||||||
INSERT INTO `dzz_setting` (`skey`,`svalue`) VALUES ('systemlog_setting','a:7:{s:8:"errorlog";a:3:{s:5:"title";s:12:"系统错误";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:5:"cplog";a:3:{s:5:"title";s:12:"后台访问";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:9:"deletelog";a:3:{s:5:"title";s:12:"数据删除";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:9:"updatelog";a:3:{s:5:"title";s:12:"数据更新";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:8:"loginlog";a:3:{s:5:"title";s:12:"用户登录";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:8:"sendmail";a:3:{s:5:"title";s:12:"邮件发送";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:8:"otherlog";a:3:{s:5:"title";s:12:"其他信息";s:7:"is_open";i:1;s:8:"issystem";i:1;}}');
|
INSERT INTO `dzz_setting` (`skey`,`svalue`) VALUES ('systemlog_setting','a:7:{s:8:"errorlog";a:3:{s:5:"title";s:12:"系统错误";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:5:"cplog";a:3:{s:5:"title";s:12:"后台访问";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:9:"deletelog";a:3:{s:5:"title";s:12:"数据删除";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:9:"updatelog";a:3:{s:5:"title";s:12:"数据更新";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:8:"loginlog";a:3:{s:5:"title";s:12:"用户登录";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:8:"sendmail";a:3:{s:5:"title";s:12:"邮件发送";s:7:"is_open";i:1;s:8:"issystem";i:1;}s:8:"otherlog";a:3:{s:5:"title";s:12:"其他信息";s:7:"is_open";i:1;s:8:"issystem";i:1;}}');
|
||||||
EOF;
|
EOF;
|
||||||
runquery($sql);
|
runquery($sql);
|
||||||
$finish = true; //结束时必须加入此句,告诉应用安装程序已经完成自定义的安装流程
|
$finish = true; //结束时必须加入此句,告诉应用安装程序已经完成自定义的安装流程
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
$lang = array (
|
$lang = array (
|
||||||
'appname'=>'系统日志',
|
'appname'=>'系统日志',
|
||||||
'logs' => '运行记录',
|
'logs' => '运行记录',
|
||||||
'systemlog_setting'=>'设置',
|
'systemlog_setting'=>'设置',
|
||||||
'systemlog_list'=>'日志列表',
|
'systemlog_list'=>'日志列表',
|
||||||
'info'=>'信息',
|
'info'=>'信息',
|
||||||
'loginfo'=>'日志信息',
|
'loginfo'=>'日志信息',
|
||||||
'visit'=>'访问页面',
|
'visit'=>'访问页面',
|
||||||
'from'=>'来源页面',
|
'from'=>'来源页面',
|
||||||
'logswitch'=>'日志开关',
|
'logswitch'=>'日志开关',
|
||||||
'logtype'=>'日志类型',
|
'logtype'=>'日志类型',
|
||||||
'logtypename'=>'日志类型名称',
|
'logtypename'=>'日志类型名称',
|
||||||
'logtype'=>'日志类型',
|
'logtype'=>'日志类型',
|
||||||
'logflag'=>'日志标识',
|
'logflag'=>'日志标识',
|
||||||
'Logtag'=>'日志标记',
|
'Logtag'=>'日志标记',
|
||||||
'repeat'=>'重复',
|
'repeat'=>'重复',
|
||||||
'Update_setting'=>'更新日志设置'
|
'Update_setting'=>'更新日志设置'
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,160 +1,160 @@
|
|||||||
<!--{template common/header_simple_start}-->
|
<!--{template common/header_simple_start}-->
|
||||||
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
<link href="static/icheck/skins/minimal/blue.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/icheck/skins/minimal/blue.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
<link rel="stylesheet" href="static/css/checkbox.css">
|
<link rel="stylesheet" href="static/css/checkbox.css">
|
||||||
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
||||||
<style>
|
<style>
|
||||||
html, body {
|
html, body {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
color: #4B4B4B;
|
color: #4B4B4B;
|
||||||
}
|
}
|
||||||
.form-horizontal-left .radio-inline {
|
.form-horizontal-left .radio-inline {
|
||||||
padding: 5px 20px;
|
padding: 5px 20px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.loginset-template{
|
.loginset-template{
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.loginset-template .loginset-template-icon{
|
.loginset-template .loginset-template-icon{
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
border: 1px solid #AAB479;
|
border: 1px solid #AAB479;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 1px;
|
right: 1px;
|
||||||
top: 1px;
|
top: 1px;
|
||||||
color: #DD4B39;
|
color: #DD4B39;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.loginset-template:hover .loginset-template-icon{
|
.loginset-template:hover .loginset-template-icon{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.loginset-template:hover .loginset-template-icon>span{
|
.loginset-template:hover .loginset-template-icon>span{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.loginset-template .loginset-template-icon1{
|
.loginset-template .loginset-template-icon1{
|
||||||
display: block!important;
|
display: block!important;
|
||||||
}
|
}
|
||||||
.loginset-template .loginset-template-icon1>span{
|
.loginset-template .loginset-template-icon1>span{
|
||||||
display: block!important;
|
display: block!important;
|
||||||
}
|
}
|
||||||
#cpform{
|
#cpform{
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<!--{template common/header_simple_end}-->
|
<!--{template common/header_simple_end}-->
|
||||||
<!--{template common/commer_header}-->
|
<!--{template common/commer_header}-->
|
||||||
<div class="bs-container clearfix">
|
<div class="bs-container clearfix">
|
||||||
<div class="bs-left-container clearfix">
|
<div class="bs-left-container clearfix">
|
||||||
<!--{template left}-->
|
<!--{template left}-->
|
||||||
</div>
|
</div>
|
||||||
<div class="left-drager">
|
<div class="left-drager">
|
||||||
<div class="left-drager-op">
|
<div class="left-drager-op">
|
||||||
<div class="left-drager-sub"></div>
|
<div class="left-drager-sub"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bs-main-container clearfix">
|
<div class="bs-main-container clearfix">
|
||||||
<div class="main-title clearfix">
|
<div class="main-title clearfix">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<form id="cpform" action="{MOD_URL}&op=admin" class="form-horizontal-left" method="post" name="cpform">
|
<form id="cpform" action="{MOD_URL}&op=admin" class="form-horizontal-left" method="post" name="cpform">
|
||||||
<input type="hidden" value="{FORMHASH}" name="formhash">
|
<input type="hidden" value="{FORMHASH}" name="formhash">
|
||||||
<input type="hidden" value="basic" name="operation">
|
<input type="hidden" value="basic" name="operation">
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{lang logswitch}:</dt>
|
<dt>{lang logswitch}:</dt>
|
||||||
<dd class="clearfix">
|
<dd class="clearfix">
|
||||||
<label class="radio-inline "><input type="radio" name="systemlog_open" value="1"<!--{if $_G[setting][systemlog_open]==1}-->checked<!--{/if}--> onclick="document.getElementById('hidden1').style.display='block';">{lang enable}</label>
|
<label class="radio-inline "><input type="radio" name="systemlog_open" value="1"<!--{if $_G[setting][systemlog_open]==1}-->checked<!--{/if}--> onclick="document.getElementById('hidden1').style.display='block';">{lang enable}</label>
|
||||||
<label class="radio radio-inline"><input type="radio" name="systemlog_open" value="0"<!--{if $_G[setting][systemlog_open]==0}-->checked<!--{/if}--> onclick="document.getElementById('hidden1').style.display='none';">{lang forbidden}</label>
|
<label class="radio radio-inline"><input type="radio" name="systemlog_open" value="0"<!--{if $_G[setting][systemlog_open]==0}-->checked<!--{/if}--> onclick="document.getElementById('hidden1').style.display='none';">{lang forbidden}</label>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl id="hidden1">
|
<dl id="hidden1">
|
||||||
<dt>{lang logtype}:</dt>
|
<dt>{lang logtype}:</dt>
|
||||||
<dd class="clearfix">
|
<dd class="clearfix">
|
||||||
|
|
||||||
<table id="systemlogtable" class="table text-center" style="width: auto;margin-bottom:0; <!--{if $_G[setting][systemlog_open]==0}-->display:none<!--{/if}-->">
|
<table id="systemlogtable" class="table text-center" style="width: auto;margin-bottom:0; <!--{if $_G[setting][systemlog_open]==0}-->display:none<!--{/if}-->">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{lang logtypename}</th>
|
<th>{lang logtypename}</th>
|
||||||
<th>{lang logflag}</th>
|
<th>{lang logflag}</th>
|
||||||
<th>{lang logswitch}</th>
|
<th>{lang logswitch}</th>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{eval $i=0;}
|
{eval $i=0;}
|
||||||
<!--{loop $systemlog_setting $mark $info}-->
|
<!--{loop $systemlog_setting $mark $info}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="settingnew[issystem][$i]" value="$info[issystem]" />
|
<input type="hidden" name="settingnew[issystem][$i]" value="$info[issystem]" />
|
||||||
<input class="form-control" style="width:120px;" <!--{if $info[issystem]==1}-->readonly="readonly"<!--{/if}--> type="text" name="settingnew[title][$i]" value="$info[title]" />
|
<input class="form-control" style="width:120px;" <!--{if $info[issystem]==1}-->readonly="readonly"<!--{/if}--> type="text" name="settingnew[title][$i]" value="$info[title]" />
|
||||||
</td>
|
</td>
|
||||||
<td><input class="form-control" style="width:100px;" <!--{if $info[issystem]==1}-->readonly="readonly"<!--{/if}--> type="text" name="settingnew[mark][$i]" value="$mark" /></td>
|
<td><input class="form-control" style="width:100px;" <!--{if $info[issystem]==1}-->readonly="readonly"<!--{/if}--> type="text" name="settingnew[mark][$i]" value="$mark" /></td>
|
||||||
<td><input type="checkbox" name="settingnew[is_open][$i]" value="1" <!--{if $info[is_open]==1}-->checked<!--{/if}--> /></td>
|
<td><input type="checkbox" name="settingnew[is_open][$i]" value="1" <!--{if $info[is_open]==1}-->checked<!--{/if}--> /></td>
|
||||||
<td>
|
<td>
|
||||||
<!--{if $info[issystem]!=1}-->
|
<!--{if $info[issystem]!=1}-->
|
||||||
<a href="javascript:;" class="col-xs-2 img_delete" onclick="deletesystem(this);"><span class="dzz dzz-delete" style="font-size:22px;"></span></a>
|
<a href="javascript:;" class="col-xs-2 img_delete" onclick="deletesystem(this);"><span class="dzz dzz-delete" style="font-size:22px;"></span></a>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{eval $i++;}
|
{eval $i++;}
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" align="left"><a href="javascript:;" onclick="addsystemtype(this);"><i class="glyphicon glyphicon-plus"></i>{lang add}</a></td>
|
<td colspan="4" align="left"><a href="javascript:;" onclick="addsystemtype(this);"><i class="glyphicon glyphicon-plus"></i>{lang add}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
|
|
||||||
<dd>
|
<dd>
|
||||||
<input class="btn btn-primary" id="submit_editsubmit" name="settingsubmit" value="{lang save_changes}" type="submit">
|
<input class="btn btn-primary" id="submit_editsubmit" name="settingsubmit" value="{lang save_changes}" type="submit">
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.left-drager').leftDrager_layout();
|
jQuery('.left-drager').leftDrager_layout();
|
||||||
jQuery(document).ready(function(e) {
|
jQuery(document).ready(function(e) {
|
||||||
jQuery('input').iCheck({
|
jQuery('input').iCheck({
|
||||||
checkboxClass: 'icheckbox_minimal-blue',
|
checkboxClass: 'icheckbox_minimal-blue',
|
||||||
radioClass: 'iradio_minimal-blue',
|
radioClass: 'iradio_minimal-blue',
|
||||||
});
|
});
|
||||||
jQuery('input').on('ifChecked', function(e) {
|
jQuery('input').on('ifChecked', function(e) {
|
||||||
jQuery(this).trigger('click');
|
jQuery(this).trigger('click');
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('input[required]').on('blur', function() {
|
jQuery('input[required]').on('blur', function() {
|
||||||
if(this.value == '') { jQuery(this).addClass('input-error') } else { jQuery(this).removeClass('input-error'); }
|
if(this.value == '') { jQuery(this).addClass('input-error') } else { jQuery(this).removeClass('input-error'); }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
function addsystemtype( obj ){
|
function addsystemtype( obj ){
|
||||||
var num=jQuery("#systemlogtable").find("tr").length-1;
|
var num=jQuery("#systemlogtable").find("tr").length-1;
|
||||||
var html='<tr><td><input type="hidden" name="settingnew[issystem]['+num+']" value="0" /><input class="form-control" style="width:120px;" type="text" name="settingnew[title]['+num+']" value="" /></td><td><input class="form-control" style="width:100px;" type="text" name="settingnew[mark]['+num+']" value="" /></td><td><input type="checkbox" name="settingnew[is_open]['+num+']" value="1" checked /></td><td><a class="col-xs-2 img_delete" onclick="deletesystem(this);" href="javascript:;"><span class="dzz dzz-delete" style="font-size:22px;"></span></a></td></tr>';
|
var html='<tr><td><input type="hidden" name="settingnew[issystem]['+num+']" value="0" /><input class="form-control" style="width:120px;" type="text" name="settingnew[title]['+num+']" value="" /></td><td><input class="form-control" style="width:100px;" type="text" name="settingnew[mark]['+num+']" value="" /></td><td><input type="checkbox" name="settingnew[is_open]['+num+']" value="1" checked /></td><td><a class="col-xs-2 img_delete" onclick="deletesystem(this);" href="javascript:;"><span class="dzz dzz-delete" style="font-size:22px;"></span></a></td></tr>';
|
||||||
jQuery(obj).parents("tr").before(html);
|
jQuery(obj).parents("tr").before(html);
|
||||||
|
|
||||||
jQuery("#systemlogtable").iCheck({
|
jQuery("#systemlogtable").iCheck({
|
||||||
checkboxClass: 'icheckbox_minimal-blue',
|
checkboxClass: 'icheckbox_minimal-blue',
|
||||||
radioClass: 'iradio_minimal-blue',
|
radioClass: 'iradio_minimal-blue',
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function deletesystem( obj ){
|
function deletesystem( obj ){
|
||||||
jQuery(obj).parents("tr").remove();
|
jQuery(obj).parents("tr").remove();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
||||||
<script type="text/javascript" src="static/icheck/icheck.min.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/icheck/icheck.min.js?{VERHASH}"></script>
|
||||||
<!--{template common/footer_simple}-->
|
<!--{template common/footer_simple}-->
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<ul class="nav-stacked">
|
<ul class="nav-stacked">
|
||||||
<li <!--{if $_GET[op]!="admin" }--> class="active" <!--{/if}-->><a hidefocus="true" href="{MOD_URL}">{lang systemlog_list}</a></li>
|
<li <!--{if $_GET[op]!="admin" }--> class="active" <!--{/if}-->><a hidefocus="true" href="{MOD_URL}">{lang systemlog_list}</a></li>
|
||||||
<li <!--{if $_GET[op]=="admin" }--> class="active" <!--{/if}-->><a hidefocus="true" href="{MOD_URL}&op=admin">{lang systemlog_setting}</a></li>
|
<li <!--{if $_GET[op]=="admin" }--> class="active" <!--{/if}-->><a hidefocus="true" href="{MOD_URL}&op=admin">{lang systemlog_setting}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -1,110 +1,110 @@
|
|||||||
<!--{template common/header_simple_start}-->
|
<!--{template common/header_simple_start}-->
|
||||||
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
<link href="static/select2/select2.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/select2/select2.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
<link href="static/select2/select2-bootstrap.css?{VERHASH}" rel="stylesheet" media="all">
|
<link href="static/select2/select2-bootstrap.css?{VERHASH}" rel="stylesheet" media="all">
|
||||||
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
|
||||||
<style>
|
<style>
|
||||||
input[type="text"] {
|
input[type="text"] {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<!--{template common/header_simple_end}-->
|
<!--{template common/header_simple_end}-->
|
||||||
<!--{template common/commer_header}-->
|
<!--{template common/commer_header}-->
|
||||||
<div class="bs-container clearfix">
|
<div class="bs-container clearfix">
|
||||||
<div class="bs-left-container clearfix">
|
<div class="bs-left-container clearfix">
|
||||||
<!--{template left}-->
|
<!--{template left}-->
|
||||||
</div>
|
</div>
|
||||||
<div class="left-drager">
|
<div class="left-drager">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bs-main-container clearfix">
|
<div class="bs-main-container clearfix">
|
||||||
|
|
||||||
<div class="main-header clearfix" style="border-bottom:1px solid #e1e1e1;padding-top: 15px;">
|
<div class="main-header clearfix" style="border-bottom:1px solid #e1e1e1;padding-top: 15px;">
|
||||||
|
|
||||||
<ul class="nav nav-pills nav-pills-bottomguide">
|
<ul class="nav nav-pills nav-pills-bottomguide">
|
||||||
|
|
||||||
<!--{loop $systemlog_setting $mark $info}-->
|
<!--{loop $systemlog_setting $mark $info}-->
|
||||||
<!--{if $info[is_open]==1 }-->
|
<!--{if $info[is_open]==1 }-->
|
||||||
<li <!--{if $operation==$mark }-->class="active"<!--{/if}-->>
|
<li <!--{if $operation==$mark }-->class="active"<!--{/if}-->>
|
||||||
<a hidefocus="true" href="{BASESCRIPT}?mod=systemlog&type=list&operation=$mark">{$info['title']}</a>
|
<a hidefocus="true" href="{BASESCRIPT}?mod=systemlog&type=list&operation=$mark">{$info['title']}</a>
|
||||||
</li>
|
</li>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main-content" style="border-top:1px solid #FFF">
|
<div class="main-content" style="border-top:1px solid #FFF">
|
||||||
|
|
||||||
<form id="cpform" action="{BASESCRIPT}?mod=systemlog&type=list&operation=$operation" class="form-horizontal form-horizontal-left" method="post" name="cpform">
|
<form id="cpform" action="{BASESCRIPT}?mod=systemlog&type=list&operation=$operation" class="form-horizontal form-horizontal-left" method="post" name="cpform">
|
||||||
<input type="hidden" value="{FORMHASH}" name="formhash">
|
<input type="hidden" value="{FORMHASH}" name="formhash">
|
||||||
<input type="hidden" name="lpp" value="20">
|
<input type="hidden" name="lpp" value="20">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<th width="80">{lang operator}</th>
|
<th width="80">{lang operator}</th>
|
||||||
<th width="80">{lang usergroup}</th>
|
<th width="80">{lang usergroup}</th>
|
||||||
<th width="120">{lang ip}</th>
|
<th width="120">{lang ip}</th>
|
||||||
<th width="120">{lang time}</th>
|
<th width="120">{lang time}</th>
|
||||||
<th>{lang info}</th>
|
<th>{lang info}</th>
|
||||||
</thead>
|
</thead>
|
||||||
<!--{if $list}-->
|
<!--{if $list}-->
|
||||||
<!--{loop $list $key $log}-->
|
<!--{loop $list $key $log}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>$log[2]</td>
|
<td>$log[2]</td>
|
||||||
<td>$log[3]</td>
|
<td>$log[3]</td>
|
||||||
<td>$log[4]</td>
|
<td>$log[4]</td>
|
||||||
<td>$log[1]</td>
|
<td>$log[1]</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript:;" onclick="togglecplog('{$key}')">{eval echo cutstr($log[5], 200)}</a>
|
<a href="javascript:;" onclick="togglecplog('{$key}')">{eval echo cutstr($log[5], 200)}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<thead id="cplog_{$key}" style="display:none">
|
<thead id="cplog_{$key}" style="display:none">
|
||||||
<td colspan="10">
|
<td colspan="10">
|
||||||
{lang loginfo}: $log[5]
|
{lang loginfo}: $log[5]
|
||||||
<br/>{lang visit}: $log[6]
|
<br/>{lang visit}: $log[6]
|
||||||
<br/>{lang from}: $log[7]</td>
|
<br/>{lang from}: $log[7]</td>
|
||||||
</thead>
|
</thead>
|
||||||
<!--{/loop}-->
|
<!--{/loop}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="15">
|
<td colspan="15">
|
||||||
<div class="pull-left input-group" style="width:100px;">
|
<div class="pull-left input-group" style="width:100px;">
|
||||||
<span class="input-group-addon">{lang logs_lpp}</span>
|
<span class="input-group-addon">{lang logs_lpp}</span>
|
||||||
<select class="input-sm form-control" style="margin:0;width:60px;" onchange="if(this.options[this.selectedIndex].value != '') {this.form.lpp.value = this.options[this.selectedIndex].value;this.form.submit(); }">
|
<select class="input-sm form-control" style="margin:0;width:60px;" onchange="if(this.options[this.selectedIndex].value != '') {this.form.lpp.value = this.options[this.selectedIndex].value;this.form.submit(); }">
|
||||||
<option value="20" $checklpp[20]> 20 </option>
|
<option value="20" $checklpp[20]> 20 </option>
|
||||||
<option value="40" $checklpp[40]> 40 </option>
|
<option value="40" $checklpp[40]> 40 </option>
|
||||||
<option value="80" $checklpp[80]> 80 </option>
|
<option value="80" $checklpp[80]> 80 </option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left input-group" style="width:128px;">
|
<div class="pull-left input-group" style="width:128px;">
|
||||||
<input type="text" class="input-sm form-control" style="width:90px;border-left:0" name="keyword" value="$_GET[keyword]">
|
<input type="text" class="input-sm form-control" style="width:90px;border-left:0" name="keyword" value="$_GET[keyword]">
|
||||||
<a href="javascript:;" class="input-group-addon" onclick="document.getElementById('cpform').submit();return false"><i class="glyphicon glyphicon-search"></i></a>
|
<a href="javascript:;" class="input-group-addon" onclick="document.getElementById('cpform').submit();return false"><i class="glyphicon glyphicon-search"></i></a>
|
||||||
</div>
|
</div>
|
||||||
$multipage
|
$multipage
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--{else}-->
|
<!--{else}-->
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="5">{lang there_no_such_results}</td>
|
<td colspan="5">{lang there_no_such_results}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function togglecplog(k) {
|
function togglecplog(k) {
|
||||||
var cplogobj = document.getElementById('cplog_' + k);
|
var cplogobj = document.getElementById('cplog_' + k);
|
||||||
if(cplogobj.style.display == 'none') {
|
if(cplogobj.style.display == 'none') {
|
||||||
cplogobj.style.display = '';
|
cplogobj.style.display = '';
|
||||||
} else {
|
} else {
|
||||||
cplogobj.style.display = 'none';
|
cplogobj.style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery('.left-drager').leftDrager_layout();
|
jQuery('.left-drager').leftDrager_layout();
|
||||||
</script>
|
</script>
|
||||||
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
|
||||||
<!--{template common/footer_simple}-->
|
<!--{template common/footer_simple}-->
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* 应用卸载文件;
|
* 应用卸载文件;
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author qchlian
|
* @author qchlian
|
||||||
*/
|
*/
|
||||||
if(!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
if(!defined('IN_OAOOA') || !defined('IN_ADMIN')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
$sql = <<<EOF
|
$sql = <<<EOF
|
||||||
DELETE FROM `dzz_setting` WHERE `dzz_setting`.`skey` = 'systemlog_setting';
|
DELETE FROM `dzz_setting` WHERE `dzz_setting`.`skey` = 'systemlog_setting';
|
||||||
DELETE FROM `dzz_setting` WHERE `dzz_setting`.`skey` = 'systemlog_open';
|
DELETE FROM `dzz_setting` WHERE `dzz_setting`.`skey` = 'systemlog_open';
|
||||||
EOF;
|
EOF;
|
||||||
runquery($sql);
|
runquery($sql);
|
||||||
$finish = true;
|
$finish = true;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<ul class="nav navbar-nav navbar-nav-left" style="min-width:168px">
|
<ul class="nav navbar-nav navbar-nav-left" style="min-width:168px">
|
||||||
<li>
|
<li>
|
||||||
<a class="leftTopmenu" href="index.php?mod=appmanagement" style="padding:8px"><div class="gb_fc"><span class="dzz dzz-chevron-left" style="display:block"></span></div></a>
|
<a class="leftTopmenu" href="index.php?mod=appmanagement" style="padding:8px"><div class="gb_fc"><span class="dzz dzz-chevron-left" style="display:block"></span></div></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{MOD_URL}">{lang appname}</a>
|
<a href="{MOD_URL}">{lang appname}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
110
avatar.php
110
avatar.php
@@ -1,55 +1,55 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
define('SITEURL', strtolower(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'))));
|
define('SITEURL', strtolower(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'))));
|
||||||
|
|
||||||
$uid = isset($_GET['uid']) ? $_GET['uid'] : 0;
|
$uid = isset($_GET['uid']) ? $_GET['uid'] : 0;
|
||||||
$size = isset($_GET['size']) ? $_GET['size'] : '';
|
$size = isset($_GET['size']) ? $_GET['size'] : '';
|
||||||
$random = isset($_GET['random']) ? $_GET['random'] : '';
|
$random = isset($_GET['random']) ? $_GET['random'] : '';
|
||||||
$type = isset($_GET['type']) ? $_GET['type'] : '';
|
$type = isset($_GET['type']) ? $_GET['type'] : '';
|
||||||
$check = isset($_GET['check_file_exists']) ? $_GET['check_file_exists'] : '';
|
$check = isset($_GET['check_file_exists']) ? $_GET['check_file_exists'] : '';
|
||||||
|
|
||||||
$avatar = './data/avatar/'.get_avatar($uid, $size, $type);
|
$avatar = './data/avatar/'.get_avatar($uid, $size, $type);
|
||||||
if(file_exists(dirname(__FILE__).'/'.$avatar)) {
|
if(file_exists(dirname(__FILE__).'/'.$avatar)) {
|
||||||
if($check) {
|
if($check) {
|
||||||
echo 1;
|
echo 1;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$random = !empty($random) ? rand(1000, 9999) : '';
|
$random = !empty($random) ? rand(1000, 9999) : '';
|
||||||
$avatar_url = empty($random) ? $avatar : $avatar.'?random='.$random;
|
$avatar_url = empty($random) ? $avatar : $avatar.'?random='.$random;
|
||||||
} else {
|
} else {
|
||||||
if($check) {
|
if($check) {
|
||||||
echo 0;
|
echo 0;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$size = in_array($size, array('big', 'middle', 'small')) ? $size : 'middle';
|
$size = in_array($size, array('big', 'middle', 'small')) ? $size : 'middle';
|
||||||
$avatar_url = 'static/image/avatar/noavatar_'.$size.'.gif';
|
$avatar_url = 'data/avatar/noavatar_'.$size.'.gif';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($random)) {
|
if(empty($random)) {
|
||||||
header("HTTP/1.1 301 Moved Permanently");
|
header("HTTP/1.1 301 Moved Permanently");
|
||||||
header("Last-Modified:".date('r'));
|
header("Last-Modified:".date('r'));
|
||||||
header("Expires: ".date('r', time() + 86400));
|
header("Expires: ".date('r', time() + 86400));
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Location: '.SITEURL.'/'.$avatar_url);
|
header('Location: '.SITEURL.'/'.$avatar_url);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
function get_avatar($uid, $size = 'middle', $type = '') {
|
function get_avatar($uid, $size = 'middle', $type = '') {
|
||||||
$size = in_array($size, array('big', 'middle', 'small')) ? $size : 'middle';
|
$size = in_array($size, array('big', 'middle', 'small')) ? $size : 'middle';
|
||||||
$uid = abs(intval($uid));
|
$uid = abs(intval($uid));
|
||||||
$uid = sprintf("%09d", $uid);
|
$uid = sprintf("%09d", $uid);
|
||||||
$dir1 = substr($uid, 0, 3);
|
$dir1 = substr($uid, 0, 3);
|
||||||
$dir2 = substr($uid, 3, 2);
|
$dir2 = substr($uid, 3, 2);
|
||||||
$dir3 = substr($uid, 5, 2);
|
$dir3 = substr($uid, 5, 2);
|
||||||
$typeadd = $type == 'real' ? '_real' : '';
|
$typeadd = $type == 'real' ? '_real' : '';
|
||||||
return $dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).$typeadd."_avatar_$size.jpg";
|
return $dir1.'/'.$dir2.'/'.$dir3.'/'.substr($uid, -2).$typeadd."_avatar_$size.jpg";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
12
ceshi.php
Normal file
12
ceshi.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
$video='*.m4v,*.mp4,*.webm,*.mpg,*.mov,*.avi,*.rmvb,*.mkv,*.mpg,*.mpeg,*.flv,*.m4v';
|
||||||
|
$audio='*.aac,*.flac,*.m4a,*.mp3,*.ogg,*.wav';
|
||||||
|
$document='*.txt,*.*.pdf,*.potx,*.ppt,*.pptx,*.xls,*.xlsx,*.doc,*.docx';
|
||||||
|
$images='*.ai,*.*.cdr,*.psd*.,bmp,*.eps,*.gif,*.heic,*.icns,*.ico,*.jpeg,*.jpg,*.png,*.svg,*.tif,*.tiff,*.ttf,*.webp,*.base64,3fr,*.arw,*.cr2,*.cr3,*.crw,*.dng,*.erf,*.mrw,*.nef,*.nrw,*.orf,*.otf,*.pef,*.raf,*.raw,*.rw2,*.sr2,*.srw,*.x3f';
|
||||||
|
|
||||||
|
$defaultextstr = '';
|
||||||
|
$defaultextstr .= $images;
|
||||||
|
$defaultextstr .= ','.$document;
|
||||||
|
$defaultextstr .= ','.$audio;
|
||||||
|
$defaultextstr .= ','.$video;
|
||||||
|
echo $defaultextstr;
|
||||||
@@ -1,169 +1,248 @@
|
|||||||
<?php
|
<?php
|
||||||
$_config = array();
|
$_config = array();
|
||||||
|
|
||||||
// ---------------------------- CONFIG DB ----------------------------- //
|
// ---------------------------- CONFIG DB ----------------------------- //
|
||||||
// ---------------------------- 数据库相关设置---------------------------- //
|
// ---------------------------- 数据库相关设置---------------------------- //
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据库主服务器设置, 支持多组服务器设置, 当设置多组服务器时, 则会根据分布式策略使用某个服务器
|
* 数据库主服务器设置, 支持多组服务器设置, 当设置多组服务器时, 则会根据分布式策略使用某个服务器
|
||||||
* @example
|
* @example
|
||||||
* $_config['db']['1']['dbhost'] = 'localhost'; // 服务器地址
|
* $_config['db']['1']['dbhost'] = 'localhost'; // 服务器地址
|
||||||
* $_config['db']['1']['dbuser'] = 'root'; // 用户
|
* $_config['db']['1']['dbuser'] = 'root'; // 用户
|
||||||
* $_config['db']['1']['dbpw'] = '';// 密码
|
* $_config['db']['1']['dbpw'] = '';// 密码
|
||||||
* $_config['db']['1']['dbcharset'] = 'gbk';// 字符集
|
* $_config['db']['1']['dbcharset'] = 'gbk';// 字符集
|
||||||
* $_config['db']['1']['pconnect'] = '0';// 是否持续连接
|
* $_config['db']['1']['pconnect'] = '0';// 是否持续连接
|
||||||
* $_config['db']['1']['dbname'] = 'x1';// 数据库
|
* $_config['db']['1']['dbname'] = 'x1';// 数据库
|
||||||
* $_config['db']['1']['tablepre'] = 'pre_';// 表名前缀
|
* $_config['db']['1']['tablepre'] = 'pre_';// 表名前缀
|
||||||
*
|
*
|
||||||
* $_config['db']['2']['dbhost'] = 'localhost';
|
* $_config['db']['2']['dbhost'] = 'localhost';
|
||||||
* ...
|
* ...
|
||||||
*/
|
*/
|
||||||
$_config['db'][1]['dbhost'] = 'localhost';//支持三种直接加端口如:127.0.0.1:3306或使用UNix socket 如:/tmp/mysql.sock
|
$_config['db'][1]['dbhost'] = 'localhost';//支持三种直接加端口如:127.0.0.1:3306或使用UNix socket 如:/tmp/mysql.sock
|
||||||
$_config['db'][1]['dbuser'] = 'root';
|
$_config['db'][1]['dbuser'] = 'root';
|
||||||
$_config['db'][1]['dbpw'] = 'root';
|
$_config['db'][1]['dbpw'] = 'root';
|
||||||
$_config['db'][1]['dbcharset'] = 'utf8';
|
$_config['db'][1]['dbcharset'] = 'utf8';
|
||||||
$_config['db'][1]['pconnect'] = 0;
|
$_config['db'][1]['pconnect'] = 0;
|
||||||
$_config['db'][1]['dbname'] = 'pichome';
|
$_config['db'][1]['dbname'] = 'pichome';
|
||||||
$_config['db'][1]['tablepre'] = 'pichome_';
|
$_config['db'][1]['tablepre'] = 'pichome_';
|
||||||
$_config['db'][1]['port'] = '3306';//mysql端口
|
$_config['db'][1]['port'] = '3306';//mysql端口
|
||||||
$_config['db'][1]['unix_socket'] = '';//使用此方式连接时 dbhost设置为localhost
|
$_config['db'][1]['unix_socket'] = '';//使用此方式连接时 dbhost设置为localhost
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据库从服务器设置( slave, 只读 ), 支持多组服务器设置, 当设置多组服务器时, 系统根据每次随机使用
|
* 数据库从服务器设置( slave, 只读 ), 支持多组服务器设置, 当设置多组服务器时, 系统根据每次随机使用
|
||||||
* @example
|
* @example
|
||||||
* $_config['db']['1']['slave']['1']['dbhost'] = 'localhost';
|
* $_config['db']['1']['slave']['1']['dbhost'] = 'localhost';
|
||||||
* $_config['db']['1']['slave']['1']['dbuser'] = 'root';
|
* $_config['db']['1']['slave']['1']['dbuser'] = 'root';
|
||||||
* $_config['db']['1']['slave']['1']['dbpw'] = 'root';
|
* $_config['db']['1']['slave']['1']['dbpw'] = 'root';
|
||||||
* $_config['db']['1']['slave']['1']['dbcharset'] = 'gbk';
|
* $_config['db']['1']['slave']['1']['dbcharset'] = 'gbk';
|
||||||
* $_config['db']['1']['slave']['1']['pconnect'] = '0';
|
* $_config['db']['1']['slave']['1']['pconnect'] = '0';
|
||||||
* $_config['db']['1']['slave']['1']['dbname'] = 'x1';
|
* $_config['db']['1']['slave']['1']['dbname'] = 'x1';
|
||||||
* $_config['db']['1']['slave']['1']['tablepre'] = 'pre_';
|
* $_config['db']['1']['slave']['1']['tablepre'] = 'pre_';
|
||||||
* $_config['db']['1']['slave']['1']['weight'] = '0'; //权重:数据越大权重越高
|
* $_config['db']['1']['slave']['1']['weight'] = '0'; //权重:数据越大权重越高
|
||||||
*
|
*
|
||||||
* $_config['db']['1']['slave']['2']['dbhost'] = 'localhost';
|
* $_config['db']['1']['slave']['2']['dbhost'] = 'localhost';
|
||||||
* ...
|
* ...
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$_config['db']['1']['slave'] = array();
|
$_config['db']['1']['slave'] = array();
|
||||||
|
|
||||||
//启用从服务器的开关
|
//启用从服务器的开关
|
||||||
$_config['db']['slave'] = false;
|
$_config['db']['slave'] = false;
|
||||||
/**
|
/**
|
||||||
* 数据库 分布部署策略设置
|
* 数据库 分布部署策略设置
|
||||||
*
|
*
|
||||||
* @example 将 user 部署到第二服务器, session 部署在第三服务器, 则设置为
|
* @example 将 user 部署到第二服务器, session 部署在第三服务器, 则设置为
|
||||||
* $_config['db']['map']['user'] = 2;
|
* $_config['db']['map']['user'] = 2;
|
||||||
* $_config['db']['map']['session'] = 3;
|
* $_config['db']['map']['session'] = 3;
|
||||||
*
|
*
|
||||||
* 对于没有明确声明服务器的表, 则一律默认部署在第一服务器上
|
* 对于没有明确声明服务器的表, 则一律默认部署在第一服务器上
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$_config['db']['map'] = array();
|
$_config['db']['map'] = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据库 公共设置, 此类设置通常对针对每个部署的服务器
|
* 数据库 公共设置, 此类设置通常对针对每个部署的服务器
|
||||||
*/
|
*/
|
||||||
$_config['db']['common'] = array();
|
$_config['db']['common'] = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 禁用从数据库的数据表, 表名字之间使用逗号分割
|
* 禁用从数据库的数据表, 表名字之间使用逗号分割
|
||||||
*
|
*
|
||||||
* @example session, user 这两个表仅从主服务器读写, 不使用从服务器
|
* @example session, user 这两个表仅从主服务器读写, 不使用从服务器
|
||||||
* $_config['db']['common']['slave_except_table'] = 'session, user';
|
* $_config['db']['common']['slave_except_table'] = 'session, user';
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$_config['db']['common']['slave_except_table'] = '';
|
$_config['db']['common']['slave_except_table'] = '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内存服务器优化设置
|
* 内存服务器优化设置
|
||||||
* 以下设置需要PHP扩展组件支持,其中 memcache 优先于其他设置,
|
* 以下设置需要PHP扩展组件支持,其中 memcache 优先于其他设置,
|
||||||
* 当 memcache 无法启用时,会自动开启另外的两种优化模式
|
* 当 memcache 无法启用时,会自动开启另外的两种优化模式
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//内存变量前缀, 可更改,避免同服务器中的程序引用错乱
|
//内存变量前缀, 可更改,避免同服务器中的程序引用错乱
|
||||||
$_config['memory']['prefix'] = 'oaooa_';
|
$_config['memory']['prefix'] = 'oaooa_';
|
||||||
|
|
||||||
/* reids设置, 需要PHP扩展组件支持, timeout参数的作用没有查证 */
|
/* reids设置, 需要PHP扩展组件支持, timeout参数的作用没有查证 */
|
||||||
$_config['memory']['redis']['server'] = '';
|
$_config['memory']['redis']['server'] = '';
|
||||||
$_config['memory']['redis']['port'] = 6379;
|
$_config['memory']['redis']['port'] = 6379;
|
||||||
$_config['memory']['redis']['pconnect'] = 1;
|
$_config['memory']['redis']['pconnect'] = 1;
|
||||||
$_config['memory']['redis']['timeout'] = 0;
|
$_config['memory']['redis']['timeout'] = 0;
|
||||||
$_config['memory']['redis']['requirepass'] = '';//如果redis需要密码,请填写redis密码
|
$_config['memory']['redis']['requirepass'] = '';//如果redis需要密码,请填写redis密码
|
||||||
/**
|
/**
|
||||||
* 是否使用 Redis::SERIALIZER_IGBINARY选项,需要igbinary支持,windows下测试时请关闭,否则会出>现错误Reading from client: Connection reset by peer
|
* 是否使用 Redis::SERIALIZER_IGBINARY选项,需要igbinary支持,windows下测试时请关闭,否则会出>现错误Reading from client: Connection reset by peer
|
||||||
* 支持以下选项,默认使用PHP的serializer
|
* 支持以下选项,默认使用PHP的serializer
|
||||||
* Redis::SERIALIZER_IGBINARY =2
|
* Redis::SERIALIZER_IGBINARY =2
|
||||||
* Redis::SERIALIZER_PHP =1
|
* Redis::SERIALIZER_PHP =1
|
||||||
* Redis::SERIALIZER_NONE =0 //则不使用serialize,即无法保存array
|
* Redis::SERIALIZER_NONE =0 //则不使用serialize,即无法保存array
|
||||||
*/
|
*/
|
||||||
$_config['memory']['redis']['serializer'] = 1;
|
$_config['memory']['redis']['serializer'] = 1;
|
||||||
|
|
||||||
$_config['memory']['memcache']['server'] = ''; // memcache 服务器地址
|
$_config['memory']['memcache']['server'] = ''; // memcache 服务器地址
|
||||||
$_config['memory']['memcache']['port'] = 11211; // memcache 服务器端口
|
$_config['memory']['memcache']['port'] = 11211; // memcache 服务器端口
|
||||||
$_config['memory']['memcache']['pconnect'] = 1; // memcache 是否长久连接
|
$_config['memory']['memcache']['pconnect'] = 1; // memcache 是否长久连接
|
||||||
$_config['memory']['memcache']['timeout'] = 1; // memcache 服务器连接超时
|
$_config['memory']['memcache']['timeout'] = 1; // memcache 服务器连接超时
|
||||||
|
|
||||||
$_config['memory']['memcached']['server'] = '127.0.0.1'; // memcached 服务器地址
|
$_config['memory']['memcached']['server'] = '127.0.0.1'; // memcached 服务器地址
|
||||||
$_config['memory']['memcached']['port'] = 11211; // memcached 服务器端口
|
$_config['memory']['memcached']['port'] = 11211; // memcached 服务器端口
|
||||||
$_config['memory']['memcached']['pconnect'] = 1; // memcached 是否长久连接
|
$_config['memory']['memcached']['pconnect'] = 1; // memcached 是否长久连接
|
||||||
$_config['memory']['memcached']['timeout'] = 1; // memcached 服务器连接超时
|
$_config['memory']['memcached']['timeout'] = 1; // memcached 服务器连接超时
|
||||||
|
|
||||||
$_config['memory']['apc'] = 1; // 启动对 apc 的支持
|
$_config['memory']['apc'] = 1; // 启动对 apc 的支持
|
||||||
$_config['memory']['xcache'] = 1; // 启动对 xcache 的支持
|
$_config['memory']['xcache'] = 1; // 启动对 xcache 的支持
|
||||||
$_config['memory']['eaccelerator'] = 0; // 启动对 eaccelerator 的支持
|
$_config['memory']['eaccelerator'] = 0; // 启动对 eaccelerator 的支持
|
||||||
$_config['memory']['wincache'] = 1; // 启动对 wincache 的支持
|
$_config['memory']['wincache'] = 1; // 启动对 wincache 的支持
|
||||||
|
|
||||||
|
|
||||||
// 服务器相关设置
|
// 服务器相关设置
|
||||||
$_config['server']['id'] = 1; // 服务器编号,多webserver的时候,用于标识当前服务器的ID
|
$_config['server']['id'] = 1; // 服务器编号,多webserver的时候,用于标识当前服务器的ID
|
||||||
|
|
||||||
//计划任务设置
|
//计划任务设置
|
||||||
$_config['remote']['on']=0; //1:设定计划任务由外部触发;0:通过用户访问触发
|
$_config['remote']['on']=0; //1:设定计划任务由外部触发;0:通过用户访问触发
|
||||||
$_config['remote']['cron']=0; //1:设定计划任务由外部触发;0:通过用户访问触发
|
$_config['remote']['cron']=0; //1:设定计划任务由外部触发;0:通过用户访问触发
|
||||||
// CONFIG CACHE
|
// CONFIG CACHE
|
||||||
$_config['cache']['type'] = 'sql'; // 缓存类型 file=文件缓存, sql=数据库缓存
|
$_config['cache']['type'] = 'sql'; // 缓存类型 file=文件缓存, sql=数据库缓存
|
||||||
|
|
||||||
// 页面输出设置
|
// 页面输出设置
|
||||||
$_config['output']['charset'] = 'utf-8'; // 页面字符集
|
$_config['output']['charset'] = 'utf-8'; // 页面字符集
|
||||||
$_config['output']['forceheader'] = 1; // 强制输出页面字符集,用于避免某些环境乱码
|
$_config['output']['forceheader'] = 1; // 强制输出页面字符集,用于避免某些环境乱码
|
||||||
$_config['output']['gzip'] = 0; // 是否采用 Gzip 压缩输出
|
$_config['output']['gzip'] = 0; // 是否采用 Gzip 压缩输出
|
||||||
$_config['output']['tplrefresh'] = 1; // 模板自动刷新开关 0=关闭, 1=打开
|
$_config['output']['tplrefresh'] = 1; // 模板自动刷新开关 0=关闭, 1=打开
|
||||||
|
|
||||||
|
|
||||||
$_config['output']['language'] = 'zh-CN'; // 页面语言 zh-cn/zh-tw
|
$_config['output']['language'] = 'zh-CN'; // 页面语言 zh-cn/zh-tw
|
||||||
$_config['output']['language_list']['zh-CN']='简体中文'; // 页面语言 zh-CN/en-US
|
$_config['output']['language_list']['zh-CN']='简体中文'; // 页面语言 zh-CN/en-US
|
||||||
$_config['output']['language_list']['en-US']='English'; // 页面语言 zh-CN/en-US
|
$_config['output']['language_list']['en-US']='English'; // 页面语言 zh-CN/en-US
|
||||||
|
|
||||||
$_config['output']['staticurl'] = 'static/'; // 站点静态文件路径,“/”结尾
|
$_config['output']['staticurl'] = 'static/'; // 站点静态文件路径,“/”结尾
|
||||||
$_config['output']['ajaxvalidate'] = 0; // 是否严格验证 Ajax 页面的真实性 0=关闭,1=打开
|
$_config['output']['ajaxvalidate'] = 0; // 是否严格验证 Ajax 页面的真实性 0=关闭,1=打开
|
||||||
$_config['output']['iecompatible'] = 0; // 页面 IE 兼容模式
|
$_config['output']['iecompatible'] = 0; // 页面 IE 兼容模式
|
||||||
|
|
||||||
// COOKIE 设置
|
|
||||||
$_config['cookie']['cookiepre'] = 'oaooa_'; // COOKIE前缀
|
$_config['cookie']['cookiepre'] = 'oaooa_'; // COOKIE前缀
|
||||||
$_config['cookie']['cookiedomain'] = ''; // COOKIE作用域
|
$_config['cookie']['cookiedomain'] = ''; // COOKIE作用域
|
||||||
$_config['cookie']['cookiepath'] = '/'; // COOKIE作用路径
|
$_config['cookie']['cookiepath'] = '/'; // COOKIE作用路径
|
||||||
|
|
||||||
// 站点安全设置
|
// 站点安全设置
|
||||||
$_config['security']['authkey'] = 'oaooa'; // 站点加密密钥
|
$_config['security']['authkey'] = 'oaooa'; // 站点加密密钥
|
||||||
$_config['security']['urlxssdefend'] = true; // 自身 URL XSS 防御
|
$_config['security']['urlxssdefend'] = true; // 自身 URL XSS 防御
|
||||||
$_config['security']['attackevasive'] = 0; // CC 攻击防御 1|2|4|8
|
$_config['security']['attackevasive'] = 0; // CC 攻击防御 1|2|4|8
|
||||||
|
|
||||||
$_config['security']['querysafe']['status'] = 1; // 是否开启SQL安全检测,可自动预防SQL注入攻击
|
$_config['security']['querysafe']['status'] = 1; // 是否开启SQL安全检测,可自动预防SQL注入攻击
|
||||||
$_config['security']['querysafe']['dfunction'] = array('load_file','hex','substring','if','ord','char');
|
$_config['security']['querysafe']['dfunction'] = array('load_file','hex','substring','if','ord','char');
|
||||||
$_config['security']['querysafe']['daction'] = array('@','intooutfile','intodumpfile','unionselect','(select', 'unionall', 'uniondistinct');
|
$_config['security']['querysafe']['daction'] = array('@','intooutfile','intodumpfile','unionselect','(select', 'unionall', 'uniondistinct');
|
||||||
$_config['security']['querysafe']['dnote'] = array('/*','*/','#','--','"');
|
$_config['security']['querysafe']['dnote'] = array('/*','*/','#','--','"');
|
||||||
$_config['security']['querysafe']['dlikehex'] = 1;
|
$_config['security']['querysafe']['dlikehex'] = 1;
|
||||||
$_config['security']['querysafe']['afullnote'] = 0;
|
$_config['security']['querysafe']['afullnote'] = 0;
|
||||||
|
|
||||||
$_config['admincp']['founder'] = '1'; // 站点创始人:拥有站点管理后台的最高权限,每个站点可以设置 1名或多名创始人
|
$_config['admincp']['founder'] = '1'; // 站点创始人:拥有站点管理后台的最高权限,每个站点可以设置 1名或多名创始人
|
||||||
// 可以使用uid,也可以使用用户名;多个创始人之间请使用逗号“,”分开;
|
// 可以使用uid,也可以使用用户名;多个创始人之间请使用逗号“,”分开;
|
||||||
$_config['admincp']['checkip'] = 1; // 后台管理操作是否验证管理员的 IP, 1=是[安全], 0=否。仅在管理员无法登录后台时设置 0。
|
$_config['admincp']['checkip'] = 1; // 后台管理操作是否验证管理员的 IP, 1=是[安全], 0=否。仅在管理员无法登录后台时设置 0。
|
||||||
$_config['admincp']['runquery'] = 0; // 是否允许后台运行 SQL 语句 1=是 0=否[安全]
|
$_config['admincp']['runquery'] = 0; // 是否允许后台运行 SQL 语句 1=是 0=否[安全]
|
||||||
$_config['admincp']['dbimport'] = 0; // 是否允许后台恢复网站数据 1=是 0=否[安全]
|
$_config['admincp']['dbimport'] = 0; // 是否允许后台恢复网站数据 1=是 0=否[安全]
|
||||||
$_config['userlogin']['checkip'] = 1; //用户登录错误验证ip,对于同一ip同时使用时建议设置为0,否则当有一位用户登录错误次数超过5次,该ip被锁定15分钟,导致其他的同IP用户无法登录;
|
$_config['userlogin']['checkip'] = 1; //用户登录错误验证ip,对于同一ip同时使用时建议设置为0,否则当有一位用户登录错误次数超过5次,该ip被锁定15分钟,导致其他的同IP用户无法登录;
|
||||||
|
|
||||||
//$_config['system_os'] = 'linux'; //windows,linux,mac,系统会自动判断
|
|
||||||
//$_config['system_charset']='utf-8'; //操作系统编码,不设置系统将根据操作系统类型来判断linux:utf-8;windows:gbk;
|
|
||||||
return $_config;
|
// -------------------------- CONFIG PICHOME -------------------------- //
|
||||||
|
|
||||||
|
$_config['pichomecloseshare'] = 0; //关闭分享
|
||||||
|
|
||||||
|
$_config['pichomeclosecollect'] = 0; //关闭收藏
|
||||||
|
|
||||||
|
$_config['pichomeclosedownload'] = 0; //关闭下载
|
||||||
|
|
||||||
|
//缩略图默认设置
|
||||||
|
$_config['pichomethumsmallwidth']= 360;
|
||||||
|
$_config['pichomethumsmallheight']= 360;
|
||||||
|
$_config['pichomethumlargwidth'] = 1920;
|
||||||
|
$_config['pichomethumlargheight'] = 1080;
|
||||||
|
$_config['gdgetcolorextlimit'] = 'jpg,png,jpeg,gif'; //gd颜色后缀
|
||||||
|
$_config['imageickallowextlimit'] = 'aai,art,arw,avs,bpg,bmp,bmp2,bmp3,brf,cals,cals,cgm,cin,cip,cmyk,cmyka,cr2,crw,cube,cur,cut,dcm,dcr,dcx,dds,dib,djvu,dng,dot,dpx,emf,epdf,epi,eps,eps2,eps3,epsf,epsi,ept,exr,fax,fig,fits,fpx,gplt,gray,graya,hdr,heic,hpgl,hrz,ico,info,isobrl,isobrl6,jbig,jng,jp2,jpt,j2c,j2k,jxr,json,man,mat,miff,mono,mng,m2v,mpc,mpr,mrwmmsl,mtv,mvg,nef,orf,otb,p7,palm,pam,clipboard,pbm,pcd,pcds,pcl,pcx,pdb,pef,pes,pfa,pfb,pfm,pgm,picon,pict,pix,png8,png00,png24,png32,png48,png64,pnm,ppm,ps,ps2,ps3,psb,psd,ptif,pwp,rad,raf,rgb,rgb565,rgba,rgf,rla,rle,sfw,sgi,shtml,sid,mrsid,sum,svg,text,tga,tif,tiff,tim,ttf,ubrl,ubrl6,uil,uyvy,vicar,viff,wbmp,wpg,webp,wmf,wpg,x,xbm,xcf,xpm,xwd,x3f,YCbCr,YCbCrA,yuv,sr2,srf,srw,rw2,nrw,mrw,kdc,erf,canvas,caption,clip,clipboard,fractal,gradient,hald,histogram,inline,map,mask,matte,null,pango,plasma,preview,print,scan,radial_gradient,scanx,screenshot,stegano,tile,unique,vid,win,xc,granite,logo,netscpe,rose,wizard,bricks,checkerboard,circles,crosshatch,crosshatch30,crosshatch45,fishscales,gray0,gray5,gray10,gray15,gray20,gray25,gray30,gray35,gray40,gray45,gray50,gray55,gray60,gray65,gray70,gray75,gray80,gray85,gray90,gray95,gray100,hexagons,horizontal,horizontal2,horizontal3,horizontalsaw,hs_bdiagonal,hs_cross,hs_diagcross,hs_fdiagonal,hs_vertical,left30,left45,leftshingle,octagons,right30,right45,rightshingle,smallfishcales,vertical,vertical2,vertical3,verticalfishingle,vericalrightshingle,verticalleftshingle,verticalsaw,fff,3fr,ai,iiq,cdr'; //gd颜色后缀
|
||||||
|
|
||||||
|
$_config['pichomespecialimgext'] = 'aai,art,arw,avs,bpg,bmp,bmp2,bmp3,brf,cals,cals,cgm,cin,cip,cmyk,cmyka,cr2,crw,cube,cur,cut,dcm,dcr,dcx,dds,dib,djvu,dng,dot,dpx,emf,epdf,epi,eps,eps2,eps3,epsf,epsi,ept,exr,fax,fig,fits,fpx,gplt,gray,graya,hdr,heic,hpgl,hrz,ico,info,isobrl,isobrl6,jbig,jng,jp2,jpt,j2c,j2k,jxr,json,man,mat,miff,mono,mng,m2v,mpc,mpr,mrwmmsl,mtv,mvg,nef,orf,otb,p7,palm,pam,clipboard,pbm,pcd,pcds,pcl,pcx,pdb,pef,pes,pfa,pfb,pfm,pgm,picon,pict,pix,png8,png00,png24,png32,png48,png64,pnm,ppm,ps,ps2,ps3,psb,psd,ptif,pwp,rad,raf,rgb,rgb565,rgba,rgf,rla,rle,sfw,sgi,shtml,sid,mrsid,sum,text,tga,tif,tiff,tim,ttf,ubrl,ubrl6,uil,uyvy,vicar,viff,wbmp,wpg,wmf,wpg,x,xbm,xcf,xpm,xwd,x3f,YCbCr,YCbCrA,yuv,sr2,srf,srw,rw2,nrw,mrw,kdc,erf,canvas,caption,clip,clipboard,fractal,gradient,hald,histogram,inline,map,mask,matte,null,pango,plasma,preview,print,scan,radial_gradient,scanx,screenshot,stegano,tile,unique,vid,win,xc,granite,logo,netscpe,rose,wizard,bricks,checkerboard,circles,crosshatch,crosshatch30,crosshatch45,fishscales,gray0,gray5,gray10,gray15,gray20,gray25,gray30,gray35,gray40,gray45,gray50,gray55,gray60,gray65,gray70,gray75,gray80,gray85,gray90,gray95,gray100,hexagons,horizontal,horizontal2,horizontal3,horizontalsaw,hs_bdiagonal,hs_cross,hs_diagcross,hs_fdiagonal,hs_vertical,left30,left45,leftshingle,octagons,right30,right45,rightshingle,smallfishcales,vertical,vertical2,vertical3,verticalfishingle,vericalrightshingle,verticalleftshingle,verticalsaw,fff,3fr,ai,iiq,cdr'; //gd颜色后缀
|
||||||
|
$_config['pichomecommimageext'] = 'jpg,png,jpeg,gif,svg,webp';//pichome直接预览图片后缀
|
||||||
|
//本地文档支持格式
|
||||||
|
$_config['onlyofficeviewextlimit'] = 'pdf,doc,docx,rtf,odt,htm,html,mht,txt,ppt,pptx,pps,ppsx,odp,xls,xlsx,ods,csv';
|
||||||
|
|
||||||
|
//腾讯云格式支持
|
||||||
|
$_config['qcosmedia']='3gp,avi,flv,mp4,m3u8,mpg,asf,wmv,mkv,mov,ts,webm,mxf';
|
||||||
|
$_config['qcosoffice']='pptx,ppt,pot,potx,pps,ppsx,dps,dpt,pptm,potm,ppsm,doc,dot,wps,wpt,docx,dotx,docm,dotm,xls,xlt,et,ett,xlsx,xltx,csv,xlsb,xlsm,xltm,ets,pdf,lrc,c,cpp,h,asm,s,java,asp,bat,bas,prg,cmd,rtf,txt,log,xml,htm,html';
|
||||||
|
$_config['qcosimage']='jpg,bmp,gif,png,webp';
|
||||||
|
|
||||||
|
//ffmpeg默认设置
|
||||||
|
$_config['pichomeffmpegposition'] = '';
|
||||||
|
$_config['pichomeffprobposition'] = '';
|
||||||
|
$_config['pichomeffmpeggetvieoinfoext']= 'avi,rm,rmvb,mkv,mov,wmv,asf,mpg,mpe,mpeg,mp4,m4v,mpeg,f4v,vob,ogv,mts,m2ts,3gp,webm,flv,wav,mp3,ogg,midi,wma,vqf,ra,aac,flac,ape,amr,aiff,au,m4a'; //ffmpeg支持获取音视频信息的后缀
|
||||||
|
$_config['pichomeffmpeggetthumbext']= 'avi,rm,rmvb,mkv,mov,wmv,asf,mpg,mpe,mpeg,mp4,m4v,mpeg,f4v,vob,ogv,mts,m2ts,3gp,webm,flv,wav,mp3,ogg,midi,wma,vqf,ra,aac,flac,ape,amr,aiff,au,m4a'; //ffmpeg支持获取音视频缩略图后缀
|
||||||
|
$_config['pichomeffmpegconvertext']= 'avi,rm,rmvb,mkv,mov,wmv,asf,mpg,mpe,mpeg,mp4,m4v,mpeg,f4v,vob,ogv,mts,m2ts,3gp,webm,flv,wav,mp3,ogg,midi,wma,vqf,ra,aac,flac,ape,amr,aiff,au,m4a'; //ffmpeg支持转码后缀
|
||||||
|
|
||||||
|
//支持转码后缀
|
||||||
|
$_config['pichomeplayermediaext'] = 'mp3,mp4,webm,ogv,ogg,wav,m3u8,hls,mpg,mpeg';
|
||||||
|
$_config['pichomeconvertext'] = 'webm,ogv,ogg,wav,m3u8,hls,mpg,3gp,avi,flv,mp4,asf,wmv,mkv,mov,ts,mxf';
|
||||||
|
|
||||||
|
$_config['pichomexgplayer'] = 'mp3,mp4,flv,webm,ogv,ogg,wav,m3u8,hls,mpg,avi,rm,rmvb,mkv,mov,wmv,asf,mpg,mpeg,f4v,vob,ogv,mts,m2ts,mpe,ogg,3gp,flv,midi,wma,vqf,ra,aac,flac,ape,amr,aiff,au,m4a,m4v';
|
||||||
|
|
||||||
|
//转码质量参数
|
||||||
|
$_config['videoquality'][0]['name'] = '流畅';
|
||||||
|
$_config['videoquality'][0]['width'] = 640;
|
||||||
|
$_config['videoquality'][0]['height'] = 360;
|
||||||
|
$_config['videoquality'][0]['bitrate'] = 400;
|
||||||
|
|
||||||
|
$_config['videoquality'][1]['name'] = '标清';
|
||||||
|
$_config['videoquality'][1]['width'] = 960;
|
||||||
|
$_config['videoquality'][1]['height'] = 510;
|
||||||
|
$_config['videoquality'][1]['bitrate'] = 900;
|
||||||
|
|
||||||
|
$_config['videoquality'][2]['name'] = '高清';
|
||||||
|
$_config['videoquality'][2]['width'] = 1280;
|
||||||
|
$_config['videoquality'][2]['height'] = 720;
|
||||||
|
$_config['videoquality'][2]['bitrate'] = 1500;
|
||||||
|
|
||||||
|
$_config['videoquality'][3]['name'] = '超清';
|
||||||
|
$_config['videoquality'][3]['width'] = 1920;
|
||||||
|
$_config['videoquality'][3]['height'] = 1080;
|
||||||
|
$_config['videoquality'][3]['bitrate'] = 3000;
|
||||||
|
|
||||||
|
$_config['videoquality'][4]['name'] = '2k';
|
||||||
|
$_config['videoquality'][4]['width'] = 3500;
|
||||||
|
$_config['videoquality'][4]['height'] = 2560;
|
||||||
|
$_config['videoquality'][4]['bitrate'] = 1440;
|
||||||
|
|
||||||
|
$_config['videoquality'][5]['name'] = '4k';
|
||||||
|
$_config['videoquality'][5]['width'] = 3840;
|
||||||
|
$_config['videoquality'][5]['height'] = 2160;
|
||||||
|
$_config['videoquality'][5]['bitrate'] = 6000;
|
||||||
|
|
||||||
|
$_config['defaultvideoquality'] = 1;
|
||||||
|
|
||||||
|
//转换缩略图进程数
|
||||||
|
$_config['thumbprocessnum'] = 1;
|
||||||
|
//获取信息进程数
|
||||||
|
$_config['infoprocessnum'] = 1;
|
||||||
|
//转换缩略图进程数
|
||||||
|
$_config['convertprocessnum'] = 1;
|
||||||
|
|
||||||
|
return $_config;
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
$_config = array();
|
$_config = array();
|
||||||
$_config['namespacelist'] = array(
|
$_config['namespacelist'] = array(
|
||||||
'root' =>DZZ_ROOT,
|
'root' =>DZZ_ROOT,
|
||||||
'coreroot' => DZZ_ROOT.'core',
|
'coreroot' => DZZ_ROOT.'core',
|
||||||
'admin' => DZZ_ROOT.'admin',
|
'admin' => DZZ_ROOT.'admin',
|
||||||
'core' => CORE_PATH,
|
'core' => CORE_PATH,
|
||||||
'dzz' => DZZ_ROOT.APP_DIRNAME,
|
'dzz' => DZZ_ROOT.APP_DIRNAME,
|
||||||
'user' => DZZ_ROOT.'user',
|
'user' => DZZ_ROOT.'user',
|
||||||
'misc' => DZZ_ROOT.'misc'
|
'misc' => DZZ_ROOT.'misc'
|
||||||
);
|
);
|
||||||
|
|
||||||
$_config['default_mod'] = 'index';
|
$_config['default_mod'] = 'index';
|
||||||
|
|
||||||
$_config['default_op'] = 'index';
|
$_config['default_op'] = 'index';
|
||||||
|
|
||||||
$_config['default_action'] = 'index';
|
$_config['default_action'] = 'index';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其它配置
|
* 其它配置
|
||||||
*/
|
*/
|
||||||
$_config['allow_robot'] = false;
|
$_config['allow_robot'] = false;
|
||||||
$_config['allow_view'] = 0;//(0=>所有人,1=>用户,2=>管理员,3=>创始人)
|
$_config['allow_view'] = 0;//(0=>所有人,1=>用户,2=>管理员,3=>创始人)
|
||||||
$_config['libfile'] = '';
|
$_config['libfile'] = '';
|
||||||
$_config['language'] = '';
|
$_config['language'] = '';
|
||||||
$_config['mod_view_perm'] = '';
|
$_config['mod_view_perm'] = '';
|
||||||
$_config['action_name'] = 'do';
|
$_config['action_name'] = 'do';
|
||||||
$_config['do_name'] = 'action';
|
$_config['do_name'] = 'action';
|
||||||
|
|
||||||
$_config['profile']['privacy'] = array(
|
$_config['profile']['privacy'] = array(
|
||||||
'-1'=>'私密',
|
'-1'=>'私密',
|
||||||
'0'=>'公开',
|
'0'=>'公开',
|
||||||
'1'=>'本部门可见',
|
'1'=>'本部门可见',
|
||||||
'2'=>'本机构可见',
|
'2'=>'本机构可见',
|
||||||
);
|
);
|
||||||
return $_config;
|
return $_config;
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
|
||||||
* @license https://www.oaooa.com/licenses/
|
* @license https://www.oaooa.com/licenses/
|
||||||
*
|
*
|
||||||
* @link https://www.oaooa.com
|
* @link https://www.oaooa.com
|
||||||
* @author zyx(zyx@oaooa.com)
|
* @author zyx(zyx@oaooa.com)
|
||||||
*/
|
*/
|
||||||
require __DIR__.'/coreBase.php';
|
require __DIR__.'/coreBase.php';
|
||||||
$dzz = C::app();
|
$dzz = C::app();
|
||||||
Hook::listen('dzz_initbefore');//初始化前钩子
|
Hook::listen('dzz_initbefore');//初始化前钩子
|
||||||
$dzz->init();
|
$dzz->init();
|
||||||
|
|
||||||
$admincp = new dzz_admincp();
|
$admincp = new dzz_admincp();
|
||||||
$admincp->core = $dzz;
|
$admincp->core = $dzz;
|
||||||
$admincp->init();
|
$admincp->init();
|
||||||
Hook::listen('dzz_initafter');//初始化后钩子
|
Hook::listen('dzz_initafter');//初始化后钩子
|
||||||
$files = Hook::listen('dzz_route',$_GET);//路由钩子,返回文件路径
|
$files = Hook::listen('dzz_route',$_GET);//路由钩子,返回文件路径
|
||||||
foreach($files as $v){
|
foreach($files as $v){
|
||||||
require $v;//包含文件
|
require $v;//包含文件
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
core/api/Qcos/.gitignore
vendored
Normal file
2
core/api/Qcos/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
17
core/api/Qcos/.travis.yml
Normal file
17
core/api/Qcos/.travis.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
language: php
|
||||||
|
php:
|
||||||
|
- 5.6
|
||||||
|
notifications:
|
||||||
|
email:
|
||||||
|
recipients:
|
||||||
|
- wjielai@tencent.com
|
||||||
|
- fysntian@tencent.com
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- composer install --prefer-dist --dev --no-interaction
|
||||||
|
|
||||||
|
script:
|
||||||
|
- phpunit -v --coverage-clover=coverage.xml
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
21
core/api/Qcos/LICENSE
Normal file
21
core/api/Qcos/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2017 腾讯云
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
302
core/api/Qcos/README.md
Normal file
302
core/api/Qcos/README.md
Normal file
@@ -0,0 +1,302 @@
|
|||||||
|
# COS-PHP-SDK-V5
|
||||||
|
|
||||||
|
腾讯云 COS-PHP-SDK-V5([XML API](https://cloud.tencent.com/document/product/436/7751))
|
||||||
|
|
||||||
|
[](https://packagist.org/packages/qcloud/cos-sdk-v5)
|
||||||
|
[](https://packagist.org/packages/qcloud/cos-sdk-v5)
|
||||||
|
[](https://travis-ci.org/tencentyun/cos-php-sdk-v5)
|
||||||
|
[](https://codecov.io/gh/tencentyun/cos-php-sdk-v5)
|
||||||
|
|
||||||
|
## 环境准备
|
||||||
|
|
||||||
|
- PHP 5.6+ 您可以通过`php -v`命令查看当前的 PHP 版本。
|
||||||
|
|
||||||
|
> - 如果您的 php 版本 `>=5.3` 且 `<5.6` , 请使用 [v1.3](https://github.com/tencentyun/cos-php-sdk-v5/tree/1.3) 版本
|
||||||
|
|
||||||
|
- cURL 扩展 您可以通过`php -m`命令查看 cURL 扩展是否已经安装好。
|
||||||
|
|
||||||
|
> - Ubuntu 系统中,您可以使用 apt-get 包管理器安装 PHP 的 cURL 扩展,安装命令如下。
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt-get install php-curl
|
||||||
|
```
|
||||||
|
|
||||||
|
> - CentOS 系统中,您可以使用 yum 包管理器安装 PHP 的 cURL 扩展。
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo yum install php-curl
|
||||||
|
```
|
||||||
|
|
||||||
|
## SDK 安装
|
||||||
|
|
||||||
|
SDK 安装有三种方式:
|
||||||
|
|
||||||
|
- Composer 方式
|
||||||
|
- Phar 方式
|
||||||
|
- 源码方式
|
||||||
|
|
||||||
|
### Composer 方式
|
||||||
|
|
||||||
|
推荐使用 Composer 安装 cos-php-sdk-v5,Composer 是 PHP 的依赖管理工具,允许您声明项目所需的依赖,然后自动将它们安装到您的项目中。
|
||||||
|
|
||||||
|
> 您可以在 [Composer 官网](https://getcomposer.org/) 上找到更多关于如何安装 Composer,配置自动加载以及用于定义依赖项的其他最佳实践等相关信息。
|
||||||
|
|
||||||
|
#### 安装步骤:
|
||||||
|
|
||||||
|
1. 打开终端。
|
||||||
|
2. 下载 Composer,执行以下命令。
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -sS https://getcomposer.org/installer | php
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 创建一个名为`composer.json`的文件,内容如下。
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"qcloud/cos-sdk-v5": "2.*"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 使用 Composer 安装,执行以下命令。
|
||||||
|
|
||||||
|
```
|
||||||
|
php composer.phar install
|
||||||
|
```
|
||||||
|
|
||||||
|
使用该命令后会在当前目录中创建一个 vendor 文件夹,里面包含 SDK 的依赖库和一个 autoload.php 脚本,方便在项目中调用。
|
||||||
|
|
||||||
|
5. 通过 autoload.php 脚本调用 cos-php-sdk-v5。
|
||||||
|
|
||||||
|
```php
|
||||||
|
require '/path/to/vendor/autoload.php';
|
||||||
|
```
|
||||||
|
|
||||||
|
现在您的项目已经可以使用 COS 的 V5 版本 SDK 了。
|
||||||
|
|
||||||
|
### Phar 方式
|
||||||
|
|
||||||
|
Phar 方式安装 SDK 的步骤如下:
|
||||||
|
|
||||||
|
1. 在 [GitHub 发布页面](https://github.com/tencentyun/cos-php-sdk-v5/releases) 下载相应的 phar 文件。
|
||||||
|
2. 在代码中引入 phar 文件:
|
||||||
|
|
||||||
|
```php
|
||||||
|
require '/path/to/cos-sdk-v5.phar';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 源码方式
|
||||||
|
|
||||||
|
源码方式安装 SDK 的步骤如下:
|
||||||
|
|
||||||
|
1. 在 [GitHub 发布页面](https://github.com/tencentyun/cos-php-sdk-v5/releases) 下载相应的 cos-sdk-v5.tar.gz 文件。
|
||||||
|
2. 解压后通过 autoload.php 脚本加载 SDK:
|
||||||
|
|
||||||
|
```php
|
||||||
|
require '/path/to/cos-php-sdk-v5/vendor/autoload.php';
|
||||||
|
```
|
||||||
|
|
||||||
|
## 快速入门
|
||||||
|
|
||||||
|
可参照 Demo 程序,详见 [sample 目录](https://github.com/tencentyun/cos-php-sdk-v5/tree/master/sample)。
|
||||||
|
|
||||||
|
## 接口文档
|
||||||
|
|
||||||
|
PHP SDK 接口文档,详见 [https://cloud.tencent.com/document/product/436/12267](https://cloud.tencent.com/document/product/436/12267)
|
||||||
|
|
||||||
|
### 配置文件
|
||||||
|
|
||||||
|
```php
|
||||||
|
$cosClient = new Qcloud\Cos\Client(array(
|
||||||
|
'region' => '<Region>',
|
||||||
|
'credentials' => array(
|
||||||
|
'secretId' => '<SecretId>',
|
||||||
|
'secretKey' => '<SecretKey>'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
```
|
||||||
|
|
||||||
|
若您使用 [临时密钥](https://cloud.tencent.com/document/product/436/14048) 初始化,请用下面方式创建实例。
|
||||||
|
|
||||||
|
```php
|
||||||
|
$cosClient = new Qcloud\Cos\Client(array(
|
||||||
|
'region' => '<Region>',
|
||||||
|
'credentials' => array(
|
||||||
|
'secretId' => '<SecretId>',
|
||||||
|
'secretKey' => '<SecretKey>',
|
||||||
|
'token' => '<XCosSecurityToken>'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
```
|
||||||
|
|
||||||
|
### 上传文件
|
||||||
|
|
||||||
|
- 使用 putObject 接口上传文件(最大 5G)
|
||||||
|
- 使用 Upload 接口分块上传文件
|
||||||
|
|
||||||
|
```php
|
||||||
|
# 上传文件
|
||||||
|
## putObject(上传接口,最大支持上传5G文件)
|
||||||
|
### 上传内存中的字符串
|
||||||
|
//bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
|
||||||
|
try {
|
||||||
|
$result = $cosClient->putObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'Body' => 'Hello World!'));
|
||||||
|
print_r($result);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
### 上传文件流
|
||||||
|
try {
|
||||||
|
$result = $cosClient->putObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'Body' => fopen($local_path, 'rb')));
|
||||||
|
print_r($result);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
### 设置header和meta
|
||||||
|
try {
|
||||||
|
$result = $cosClient->putObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'Body' => fopen($local_path, 'rb'),
|
||||||
|
'ACL' => 'string',
|
||||||
|
'CacheControl' => 'string',
|
||||||
|
'ContentDisposition' => 'string',
|
||||||
|
'ContentEncoding' => 'string',
|
||||||
|
'ContentLanguage' => 'string',
|
||||||
|
'ContentLength' => integer,
|
||||||
|
'ContentType' => 'string',
|
||||||
|
'Expires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime',
|
||||||
|
'Metadata' => array(
|
||||||
|
'string' => 'string',
|
||||||
|
),
|
||||||
|
'StorageClass' => 'string'));
|
||||||
|
print_r($result);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
## Upload(高级上传接口,默认使用分块上传最大支持50T)
|
||||||
|
### 上传内存中的字符串
|
||||||
|
try {
|
||||||
|
$result = $cosClient->Upload(
|
||||||
|
$bucket = $bucket,
|
||||||
|
$key = $key,
|
||||||
|
$body = 'Hello World!');
|
||||||
|
print_r($result);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
### 上传文件流
|
||||||
|
try {
|
||||||
|
$result = $cosClient->Upload(
|
||||||
|
$bucket = $bucket,
|
||||||
|
$key = $key,
|
||||||
|
$body = fopen($local_path, 'rb'));
|
||||||
|
print_r($result);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
### 设置header和meta
|
||||||
|
try {
|
||||||
|
$result = $cosClient->Upload(
|
||||||
|
$bucket= $bucket,
|
||||||
|
$key = $key,
|
||||||
|
$body = fopen($local_path, 'rb'),
|
||||||
|
$options = array(
|
||||||
|
'ACL' => 'string',
|
||||||
|
'CacheControl' => 'string',
|
||||||
|
'ContentDisposition' => 'string',
|
||||||
|
'ContentEncoding' => 'string',
|
||||||
|
'ContentLanguage' => 'string',
|
||||||
|
'ContentLength' => integer,
|
||||||
|
'ContentType' => 'string',
|
||||||
|
'Expires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime',
|
||||||
|
'Metadata' => array(
|
||||||
|
'string' => 'string',
|
||||||
|
),
|
||||||
|
'StorageClass' => 'string'));
|
||||||
|
print_r($result);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 下载文件
|
||||||
|
|
||||||
|
- 使用 getObject 接口下载文件
|
||||||
|
- 使用 getObjectUrl 接口获取文件下载 URL
|
||||||
|
|
||||||
|
```php
|
||||||
|
# 下载文件
|
||||||
|
## getObject(下载文件)
|
||||||
|
### 下载到内存
|
||||||
|
//bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
|
||||||
|
try {
|
||||||
|
$result = $cosClient->getObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key));
|
||||||
|
echo($result['Body']);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
### 下载到本地
|
||||||
|
try {
|
||||||
|
$result = $cosClient->getObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'SaveAs' => $local_path));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
### 指定下载范围
|
||||||
|
/*
|
||||||
|
* Range 字段格式为 'bytes=a-b'
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
$result = $cosClient->getObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'Range' => 'bytes=0-10',
|
||||||
|
'SaveAs' => $local_path));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
### 设置返回header
|
||||||
|
try {
|
||||||
|
$result = $cosClient->getObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'ResponseCacheControl' => 'string',
|
||||||
|
'ResponseContentDisposition' => 'string',
|
||||||
|
'ResponseContentEncoding' => 'string',
|
||||||
|
'ResponseContentLanguage' => 'string',
|
||||||
|
'ResponseContentType' => 'string',
|
||||||
|
'ResponseExpires' => 'mixed type: string (date format)|int (unix timestamp)|\DateTime',
|
||||||
|
'SaveAs' => $local_path));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo "$e\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
## getObjectUrl(获取文件UrL)
|
||||||
|
try {
|
||||||
|
$signedUrl = $cosClient->getObjectUrl($bucket, $key, '+10 minutes');
|
||||||
|
echo $signedUrl;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
print_r($e);
|
||||||
|
}
|
||||||
|
```
|
||||||
91
core/api/Qcos/UPGRADING.md
Normal file
91
core/api/Qcos/UPGRADING.md
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
cos-php-sdk-v5 Upgrade Guide
|
||||||
|
====================
|
||||||
|
2.0.6 to 2.0.7
|
||||||
|
----------
|
||||||
|
- Fix presigned url when using tmpSecretId/tmpSecretKey/Token
|
||||||
|
|
||||||
|
2.0.6 to 2.0.7
|
||||||
|
----------
|
||||||
|
- Fix response of `ListParts`
|
||||||
|
|
||||||
|
2.0.5 to 2.0.6
|
||||||
|
----------
|
||||||
|
- Support Domain
|
||||||
|
- Add Select Object Content Interface
|
||||||
|
- Add Traffic Limit
|
||||||
|
- Fix bug of object endswith /
|
||||||
|
|
||||||
|
2.0.4 to 2.0.5
|
||||||
|
----------
|
||||||
|
- Fix bug when upload object with metadata
|
||||||
|
|
||||||
|
2.0.3 to 2.0.4
|
||||||
|
----------
|
||||||
|
- Fix bug when using ip-port
|
||||||
|
|
||||||
|
2.0.2 to 2.0.3
|
||||||
|
----------
|
||||||
|
- Fix path parse bug with /0/
|
||||||
|
|
||||||
|
2.0.1 to 2.0.2
|
||||||
|
----------
|
||||||
|
- Fix bug of `putObject` with `fopen`
|
||||||
|
- Add ut
|
||||||
|
|
||||||
|
|
||||||
|
2.0.0 to 2.0.1
|
||||||
|
----------
|
||||||
|
- Add interface of inventory/tagging/logging
|
||||||
|
- Fix bug of some interface with query string
|
||||||
|
|
||||||
|
|
||||||
|
1.3 to 2.0
|
||||||
|
----------
|
||||||
|
cos-php-sdk-v5 now uses [GuzzleHttp] for HTTP message.
|
||||||
|
Due to fact, it depending on PHP >= 5.6.
|
||||||
|
|
||||||
|
- Use the `Qcloud\Cos\Client\getPresignetUrl()` method instead of the `Qcloud\Cos\Command\createPresignedUrl()`
|
||||||
|
|
||||||
|
v2:
|
||||||
|
```php
|
||||||
|
$signedUrl = $cosClient->getPresignetUrl($method='putObject',
|
||||||
|
$args=['Bucket'=>'examplebucket-1250000000', 'Key'=>'exampleobject', 'Body'=>''],
|
||||||
|
$expires='+30 minutes');
|
||||||
|
```
|
||||||
|
|
||||||
|
v1:
|
||||||
|
```php
|
||||||
|
$command = $cosClient->getCommand('putObject', array(
|
||||||
|
'Bucket' => "examplebucket-1250000000",
|
||||||
|
'Key' => "exampleobject",
|
||||||
|
'Body' => '',
|
||||||
|
));
|
||||||
|
$signedUrl = $command->createPresignedUrl('+30 minutes');
|
||||||
|
```
|
||||||
|
|
||||||
|
- `$copSource` parameters of the `Qcloud\Cos\Client\Copy` interface are no longer compatible with older versions.
|
||||||
|
|
||||||
|
v2:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$result = $cosClient->copy(
|
||||||
|
$bucket = '<srcBucket>',
|
||||||
|
$Key = '<srcKey>',
|
||||||
|
$copySorce = array(
|
||||||
|
'Region' => '<sourceRegion>',
|
||||||
|
'Bucket' => '<sourceBucket>',
|
||||||
|
'Key' => '<sourceKey>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
v1:
|
||||||
|
```php
|
||||||
|
$result = $cosClient->Copy(
|
||||||
|
$bucket = '<srcBucket>',
|
||||||
|
$key = '<srcKey>',
|
||||||
|
$copysource = '<sourceBucket>.cos.<sourceRegion>.myqcloud.com/<sourceKey>'
|
||||||
|
);
|
||||||
|
```
|
||||||
|
- Now when uploading files with using `open()` to upload stream, if the local file does not exist, a 0 byte file will be uploaded without throwing an exception, only a warning.
|
||||||
|
|
||||||
28
core/api/Qcos/composer.json
Normal file
28
core/api/Qcos/composer.json
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"name": "qcloud/cos-sdk-v5",
|
||||||
|
"description": "PHP SDK for QCloud COS",
|
||||||
|
"keywords": [
|
||||||
|
"qcloud", "cos", "php"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "yaozongyou",
|
||||||
|
"email": "yaozongyou@vip.qq.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lewzylu",
|
||||||
|
"email": "327874225@qq.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"Qcloud\\Cos\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0",
|
||||||
|
"guzzlehttp/guzzle": "~6.3",
|
||||||
|
"guzzlehttp/guzzle-services": "~1.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
412
core/api/Qcos/composer.lock
generated
Normal file
412
core/api/Qcos/composer.lock
generated
Normal file
@@ -0,0 +1,412 @@
|
|||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "e5931de83ca09b7727a3285fbe93fa63",
|
||||||
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/command",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/command.git",
|
||||||
|
"reference": "2aaa2521a8f8269d6f5dfc13fe2af12c76921034"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/command/zipball/2aaa2521a8f8269d6f5dfc13fe2af12c76921034",
|
||||||
|
"reference": "2aaa2521a8f8269d6f5dfc13fe2af12c76921034",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"guzzlehttp/guzzle": "^6.2",
|
||||||
|
"guzzlehttp/promises": "~1.3",
|
||||||
|
"guzzlehttp/psr7": "~1.0",
|
||||||
|
"php": ">=5.5.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~4.0|~5.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "0.9-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Command\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jeremy Lindblom",
|
||||||
|
"email": "jeremeamia@gmail.com",
|
||||||
|
"homepage": "https://github.com/jeremeamia"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Provides the foundation for building command-based web service clients",
|
||||||
|
"time": "2016-11-24T13:34:15+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/guzzle",
|
||||||
|
"version": "6.5.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/guzzle.git",
|
||||||
|
"reference": "43ece0e75098b7ecd8d13918293029e555a50f82"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82",
|
||||||
|
"reference": "43ece0e75098b7ecd8d13918293029e555a50f82",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"guzzlehttp/promises": "^1.0",
|
||||||
|
"guzzlehttp/psr7": "^1.6.1",
|
||||||
|
"php": ">=5.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ext-curl": "*",
|
||||||
|
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
||||||
|
"psr/log": "^1.1"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
|
||||||
|
"psr/log": "Required for using the Log middleware"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "6.5-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\": "src/"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/functions_include.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Guzzle is a PHP HTTP client library",
|
||||||
|
"homepage": "http://guzzlephp.org/",
|
||||||
|
"keywords": [
|
||||||
|
"client",
|
||||||
|
"curl",
|
||||||
|
"framework",
|
||||||
|
"http",
|
||||||
|
"http client",
|
||||||
|
"rest",
|
||||||
|
"web service"
|
||||||
|
],
|
||||||
|
"time": "2019-12-23T11:57:10+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/guzzle-services",
|
||||||
|
"version": "1.1.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/guzzle-services.git",
|
||||||
|
"reference": "9e3abf20161cbf662d616cbb995f2811771759f7"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/guzzle-services/zipball/9e3abf20161cbf662d616cbb995f2811771759f7",
|
||||||
|
"reference": "9e3abf20161cbf662d616cbb995f2811771759f7",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"guzzlehttp/command": "~1.0",
|
||||||
|
"guzzlehttp/guzzle": "^6.2",
|
||||||
|
"php": ">=5.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~4.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"gimler/guzzle-description-loader": "^0.0.4"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Command\\Guzzle\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jeremy Lindblom",
|
||||||
|
"email": "jeremeamia@gmail.com",
|
||||||
|
"homepage": "https://github.com/jeremeamia"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stefano Kowalke",
|
||||||
|
"email": "blueduck@mail.org",
|
||||||
|
"homepage": "https://github.com/konafets"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.",
|
||||||
|
"time": "2017-10-06T14:32:02+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/promises",
|
||||||
|
"version": "v1.3.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/promises.git",
|
||||||
|
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
||||||
|
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.5.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.4-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Promise\\": "src/"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/functions_include.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Guzzle promises library",
|
||||||
|
"keywords": [
|
||||||
|
"promise"
|
||||||
|
],
|
||||||
|
"time": "2016-12-20T10:07:11+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/psr7",
|
||||||
|
"version": "1.6.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
|
"reference": "239400de7a173fe9901b9ac7c06497751f00727a"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a",
|
||||||
|
"reference": "239400de7a173fe9901b9ac7c06497751f00727a",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.4.0",
|
||||||
|
"psr/http-message": "~1.0",
|
||||||
|
"ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/http-message-implementation": "1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ext-zlib": "*",
|
||||||
|
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.6-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Psr7\\": "src/"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/functions_include.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Schultze",
|
||||||
|
"homepage": "https://github.com/Tobion"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PSR-7 message implementation that also provides common utility methods",
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"message",
|
||||||
|
"psr-7",
|
||||||
|
"request",
|
||||||
|
"response",
|
||||||
|
"stream",
|
||||||
|
"uri",
|
||||||
|
"url"
|
||||||
|
],
|
||||||
|
"time": "2019-07-01T23:21:34+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "psr/http-message",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-fig/http-message.git",
|
||||||
|
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||||
|
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Psr\\Http\\Message\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "PHP-FIG",
|
||||||
|
"homepage": "http://www.php-fig.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Common interface for HTTP messages",
|
||||||
|
"homepage": "https://github.com/php-fig/http-message",
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"http-message",
|
||||||
|
"psr",
|
||||||
|
"psr-7",
|
||||||
|
"request",
|
||||||
|
"response"
|
||||||
|
],
|
||||||
|
"time": "2016-08-06T14:39:51+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ralouphie/getallheaders",
|
||||||
|
"version": "3.0.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/ralouphie/getallheaders.git",
|
||||||
|
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
|
||||||
|
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.6"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"php-coveralls/php-coveralls": "^2.1",
|
||||||
|
"phpunit/phpunit": "^5 || ^6.5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/getallheaders.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Ralph Khattar",
|
||||||
|
"email": "ralph.khattar@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A polyfill for getallheaders.",
|
||||||
|
"time": "2019-03-08T08:55:37+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packages-dev": [],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"platform-dev": []
|
||||||
|
}
|
||||||
2
core/api/Qcos/index.php
Normal file
2
core/api/Qcos/index.php
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<?php
|
||||||
|
require dirname(__FILE__) . '/vendor/autoload.php';
|
||||||
15
core/api/Qcos/phpunit.xml
Normal file
15
core/api/Qcos/phpunit.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<phpunit bootstrap="vendor/autoload.php">
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="cos">
|
||||||
|
<directory>src/Qcloud/Cos/Tests</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
<filter>
|
||||||
|
<whitelist addUncoveredFilesFromWhitelist="true">
|
||||||
|
<directory suffix=".php">src/</directory>
|
||||||
|
</whitelist>
|
||||||
|
</filter>
|
||||||
|
<logging>
|
||||||
|
<log type="coverage-clover" target="clover.xml"/>
|
||||||
|
</logging>
|
||||||
|
</phpunit>
|
||||||
54
core/api/Qcos/sample/selectObjectContent.php
Normal file
54
core/api/Qcos/sample/selectObjectContent.php
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require dirname(__FILE__) . '/../vendor/autoload.php';
|
||||||
|
|
||||||
|
$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId";
|
||||||
|
$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey";
|
||||||
|
$region = "ap-beijing"; //设置一个默认的存储桶地域
|
||||||
|
$cosClient = new Qcloud\Cos\Client(array(
|
||||||
|
'region' => $region,
|
||||||
|
'schema' => 'https', //协议头部,默认为http
|
||||||
|
'credentials'=> array(
|
||||||
|
'secretId' => $secretId ,
|
||||||
|
'secretKey' => $secretKey
|
||||||
|
)
|
||||||
|
));
|
||||||
|
try {
|
||||||
|
$result = $cosClient->selectObjectContent(array(
|
||||||
|
'Bucket' => $bucket, //格式:BucketName-APPID
|
||||||
|
'Key' => $key,
|
||||||
|
'Expression' => 'Select * from COSObject s',
|
||||||
|
'ExpressionType' => 'SQL',
|
||||||
|
'InputSerialization' => array(
|
||||||
|
'CompressionType' => 'None',
|
||||||
|
'CSV' => array(
|
||||||
|
'FileHeaderInfo' => 'NONE',
|
||||||
|
'RecordDelimiter' => '\n',
|
||||||
|
'FieldDelimiter' => ',',
|
||||||
|
'QuoteEscapeCharacter' => '"',
|
||||||
|
'Comments' => '#',
|
||||||
|
'AllowQuotedRecordDelimiter' => 'FALSE'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'OutputSerialization' => array(
|
||||||
|
'CSV' => array(
|
||||||
|
'QuoteField' => 'ASNEEDED',
|
||||||
|
'RecordDelimiter' => '\n',
|
||||||
|
'FieldDelimiter' => ',',
|
||||||
|
'QuoteCharacter' => '"',
|
||||||
|
'QuoteEscapeCharacter' => '"'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'RequestProgress' => array(
|
||||||
|
'Enabled' => 'FALSE'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
// 请求成功
|
||||||
|
foreach ($result['Data'] as $data) {
|
||||||
|
// 迭代遍历select结果
|
||||||
|
print_r($data);
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// 请求失败
|
||||||
|
echo($e);
|
||||||
|
}
|
||||||
281
core/api/Qcos/src/Qcloud/Cos/Client.php
Normal file
281
core/api/Qcos/src/Qcloud/Cos/Client.php
Normal file
@@ -0,0 +1,281 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
include("Common.php");
|
||||||
|
|
||||||
|
use Qcloud\Cos\Signature;
|
||||||
|
use GuzzleHttp\Client as HttpClient;
|
||||||
|
use GuzzleHttp\HandlerStack;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use GuzzleHttp\Command\Guzzle\Description;
|
||||||
|
use GuzzleHttp\Command\Guzzle\GuzzleClient;
|
||||||
|
use GuzzleHttp\Command\Guzzle\Deserializer;
|
||||||
|
use GuzzleHttp\Command\CommandInterface;
|
||||||
|
use GuzzleHttp\Command\Exception\CommandException;
|
||||||
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Middleware;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use GuzzleHttp\Pool;
|
||||||
|
|
||||||
|
|
||||||
|
class Client extends GuzzleClient {
|
||||||
|
const VERSION = '2.0.8';
|
||||||
|
|
||||||
|
public $httpClient;
|
||||||
|
|
||||||
|
private $api;
|
||||||
|
private $desc;
|
||||||
|
private $action;
|
||||||
|
private $operation;
|
||||||
|
private $cosConfig;
|
||||||
|
private $signature;
|
||||||
|
private $rawCosConfig;
|
||||||
|
|
||||||
|
public function __construct($cosConfig) {
|
||||||
|
$this->rawCosConfig = $cosConfig;
|
||||||
|
$this->cosConfig['schema'] = isset($cosConfig['schema']) ? $cosConfig['schema'] : 'http';
|
||||||
|
$this->cosConfig['region'] = region_map($cosConfig['region']);
|
||||||
|
$this->cosConfig['appId'] = isset($cosConfig['credentials']['appId']) ? $cosConfig['credentials']['appId'] : null;
|
||||||
|
$this->cosConfig['secretId'] = isset($cosConfig['credentials']['secretId']) ? $cosConfig['credentials']['secretId'] : "";
|
||||||
|
$this->cosConfig['secretKey'] = isset($cosConfig['credentials']['secretKey']) ? $cosConfig['credentials']['secretKey'] : "";
|
||||||
|
$this->cosConfig['anonymous'] = isset($cosConfig['credentials']['anonymous']) ? $cosConfig['anonymous']['anonymous'] : false;
|
||||||
|
$this->cosConfig['token'] = isset($cosConfig['credentials']['token']) ? $cosConfig['credentials']['token'] : null;
|
||||||
|
$this->cosConfig['timeout'] = isset($cosConfig['timeout']) ? $cosConfig['timeout'] : 3600;
|
||||||
|
$this->cosConfig['connect_timeout'] = isset($cosConfig['connect_timeout']) ? $cosConfig['connect_timeout'] : 3600;
|
||||||
|
$this->cosConfig['ip'] = isset($cosConfig['ip']) ? $cosConfig['ip'] : null;
|
||||||
|
$this->cosConfig['port'] = isset($cosConfig['port']) ? $cosConfig['port'] : null;
|
||||||
|
$this->cosConfig['endpoint'] = isset($cosConfig['endpoint']) ? $cosConfig['endpoint'] : 'myqcloud.com';
|
||||||
|
$this->cosConfig['domain'] = isset($cosConfig['domain']) ? $cosConfig['domain'] : null;
|
||||||
|
$this->cosConfig['proxy'] = isset($cosConfig['proxy']) ? $cosConfig['proxy'] : null;
|
||||||
|
$this->cosConfig['userAgent'] = isset($cosConfig['userAgent']) ? $cosConfig['userAgent'] : 'cos-php-sdk-v5.'. Client::VERSION;
|
||||||
|
$this->cosConfig['pathStyle'] = isset($cosConfig['pathStyle']) ? $cosConfig['pathStyle'] : false;
|
||||||
|
|
||||||
|
|
||||||
|
$service = Service::getService();
|
||||||
|
$handler = HandlerStack::create();
|
||||||
|
$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
|
||||||
|
return $request->withHeader('User-Agent', $this->cosConfig['userAgent']);
|
||||||
|
}));
|
||||||
|
if ($this->cosConfig['anonymous'] != true) {
|
||||||
|
$handler->push($this::handleSignature($this->cosConfig['secretId'], $this->cosConfig['secretKey']));
|
||||||
|
}
|
||||||
|
if ($this->cosConfig['token'] != null) {
|
||||||
|
$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
|
||||||
|
return $request->withHeader('x-cos-security-token', $this->cosConfig['token']);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
$handler->push($this::handleErrors());
|
||||||
|
$this->signature = new Signature($this->cosConfig['secretId'], $this->cosConfig['secretKey'], $this->cosConfig['token']);
|
||||||
|
$this->httpClient = new HttpClient([
|
||||||
|
'base_uri' => $this->cosConfig['schema'].'://cos.' . $this->cosConfig['region'] . '.myqcloud.com/',
|
||||||
|
'timeout' => $this->cosConfig['timeout'],
|
||||||
|
'handler' => $handler,
|
||||||
|
'proxy' => $this->cosConfig['proxy'],
|
||||||
|
]);
|
||||||
|
$this->desc = new Description($service);
|
||||||
|
$this->api = (array)($this->desc->getOperations());
|
||||||
|
parent::__construct($this->httpClient, $this->desc, [$this,
|
||||||
|
'commandToRequestTransformer'], [$this, 'responseToResultTransformer'],
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function commandToRequestTransformer(CommandInterface $command)
|
||||||
|
{
|
||||||
|
$this->action = $command->GetName();
|
||||||
|
$this->operation = $this->api[$this->action];
|
||||||
|
$transformer = new CommandToRequestTransformer($this->cosConfig, $this->operation);
|
||||||
|
$seri = new Serializer($this->desc);
|
||||||
|
$request = $seri($command);
|
||||||
|
$request = $transformer->bucketStyleTransformer($command, $request);
|
||||||
|
$request = $transformer->uploadBodyTransformer($command, $request);
|
||||||
|
$request = $transformer->metadataTransformer($command, $request);
|
||||||
|
$request = $transformer->md5Transformer($command, $request);
|
||||||
|
$request = $transformer->specialParamTransformer($command, $request);
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function responseToResultTransformer(ResponseInterface $response, RequestInterface $request, CommandInterface $command)
|
||||||
|
{
|
||||||
|
$transformer = new ResultTransformer($this->cosConfig, $this->operation);
|
||||||
|
$transformer->writeDataToLocal($command, $request, $response);
|
||||||
|
$deseri = new Deserializer($this->desc, true);
|
||||||
|
$result = $deseri($response, $request, $command);
|
||||||
|
|
||||||
|
$result = $transformer->metaDataTransformer($command, $response, $result);
|
||||||
|
$result = $transformer->extraHeadersTransformer($command, $request, $result);
|
||||||
|
$result = $transformer->selectContentTransformer($command, $result);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __call($method, array $args) {
|
||||||
|
try {
|
||||||
|
return parent::__call(ucfirst($method), $args);
|
||||||
|
} catch (CommandException $e) {
|
||||||
|
$previous = $e->getPrevious();
|
||||||
|
if ($previous !== null) {
|
||||||
|
throw $previous;
|
||||||
|
} else {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getApi() {
|
||||||
|
return $this->api;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getCosConfig() {
|
||||||
|
return $this->cosConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function createPresignedUrl(RequestInterface $request, $expires) {
|
||||||
|
return $this->signature->createPresignedUrl($request, $expires);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getthumwaterUrl($method, $args=array(), $expires = null){
|
||||||
|
$command = $this->getCommand($method, $args);
|
||||||
|
$request = $this->commandToRequestTransformer($command);
|
||||||
|
return $this->createPresignedUrl($request, $expires);
|
||||||
|
}
|
||||||
|
public function getPresignetUrl($method, $args, $expires = null) {
|
||||||
|
$command = $this->getCommand($method, $args);
|
||||||
|
$request = $this->commandToRequestTransformer($command);
|
||||||
|
return $this->createPresignedUrl($request, $expires);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getObjectUrl($bucket, $key, $expires = null, array $args = array()) {
|
||||||
|
$command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key));
|
||||||
|
$request = $this->commandToRequestTransformer($command);
|
||||||
|
return $this->createPresignedUrl($request, $expires)->__toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function upload($bucket, $key, $body, $options = array()) {
|
||||||
|
$body = Psr7\stream_for($body);
|
||||||
|
$options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : MultipartUpload::MIN_PART_SIZE;
|
||||||
|
if ($body->getSize() < $options['PartSize']) {
|
||||||
|
$rt = $this->putObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'Body' => $body,
|
||||||
|
) + $options);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$multipartUpload = new MultipartUpload($this, $body, array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
) + $options);
|
||||||
|
|
||||||
|
$rt = $multipartUpload->performUploading();
|
||||||
|
}
|
||||||
|
return $rt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resumeUpload($bucket, $key, $body, $uploadId, $options = array()) {
|
||||||
|
$body = Psr7\stream_for($body);
|
||||||
|
$options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : MultipartUpload::DEFAULT_PART_SIZE;
|
||||||
|
$multipartUpload = new MultipartUpload($this, $body, array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'UploadId' => $uploadId,
|
||||||
|
) + $options);
|
||||||
|
|
||||||
|
$rt = $multipartUpload->resumeUploading();
|
||||||
|
return $rt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function copy($bucket, $key, $copySource, $options = array()) {
|
||||||
|
|
||||||
|
$options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : Copy::DEFAULT_PART_SIZE;
|
||||||
|
|
||||||
|
// set copysource client
|
||||||
|
$sourceConfig = $this->rawCosConfig;
|
||||||
|
$sourceConfig['region'] = $copySource['Region'];
|
||||||
|
$cosSourceClient = new Client($sourceConfig);
|
||||||
|
$copySource['VersionId'] = isset($copySource['VersionId']) ? $copySource['VersionId'] : "";
|
||||||
|
try {
|
||||||
|
$rt = $cosSourceClient->headObject(
|
||||||
|
array('Bucket'=>$copySource['Bucket'],
|
||||||
|
'Key'=>$copySource['Key'],
|
||||||
|
'VersionId'=>$copySource['VersionId'],
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
|
$contentLength =$rt['ContentLength'];
|
||||||
|
// sample copy
|
||||||
|
if ($contentLength < $options['PartSize']) {
|
||||||
|
$rt = $this->copyObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key,
|
||||||
|
'CopySource' => $copySource['Bucket']. '.cos.'. $copySource['Region'].
|
||||||
|
".myqcloud.com/". $copySource['Key']. "?versionId=". $copySource['VersionId'],
|
||||||
|
) + $options
|
||||||
|
);
|
||||||
|
return $rt;
|
||||||
|
}
|
||||||
|
// multi part copy
|
||||||
|
$copySource['ContentLength'] = $contentLength;
|
||||||
|
$copy = new Copy($this, $copySource, array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key
|
||||||
|
) + $options
|
||||||
|
);
|
||||||
|
return $copy->copy();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function doesBucketExist($bucket, array $options = array())
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->HeadBucket(array(
|
||||||
|
'Bucket' => $bucket));
|
||||||
|
return True;
|
||||||
|
} catch (\Exception $e){
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function doesObjectExist($bucket, $key, array $options = array())
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->HeadObject(array(
|
||||||
|
'Bucket' => $bucket,
|
||||||
|
'Key' => $key));
|
||||||
|
return True;
|
||||||
|
} catch (\Exception $e){
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function explodeKey($key) {
|
||||||
|
// Remove a leading slash if one is found
|
||||||
|
$split_key = explode('/', $key && $key[0] == '/' ? substr($key, 1) : $key);
|
||||||
|
// Remove empty element
|
||||||
|
$split_key = array_filter($split_key, function($var) {
|
||||||
|
return !($var == '' || $var == null);
|
||||||
|
});
|
||||||
|
$final_key = implode("/", $split_key);
|
||||||
|
if (substr($key, -1) == '/') {
|
||||||
|
$final_key = $final_key . '/';
|
||||||
|
}
|
||||||
|
return $final_key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function handleSignature($secretId, $secretKey) {
|
||||||
|
return function (callable $handler) use ($secretId, $secretKey) {
|
||||||
|
return new SignatureMiddleware($handler, $secretId, $secretKey);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function handleErrors() {
|
||||||
|
return function (callable $handler) {
|
||||||
|
return new ExceptionMiddleware($handler);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
162
core/api/Qcos/src/Qcloud/Cos/CommandToRequestTransformer.php
Normal file
162
core/api/Qcos/src/Qcloud/Cos/CommandToRequestTransformer.php
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use Guzzle\Service\Description\Parameter;
|
||||||
|
use Guzzle\Service\Description\ServiceDescription;
|
||||||
|
use GuzzleHttp\HandlerStack;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Qcloud\Cos\Signature;
|
||||||
|
use GuzzleHttp\Command\Guzzle\Description;
|
||||||
|
use GuzzleHttp\Command\Guzzle\GuzzleClient;
|
||||||
|
use GuzzleHttp\Command\CommandInterface;
|
||||||
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Middleware;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use GuzzleHttp\Psr7\Uri;
|
||||||
|
use InvalidArgumentException;
|
||||||
|
|
||||||
|
|
||||||
|
class CommandToRequestTransformer {
|
||||||
|
private $config;
|
||||||
|
private $operation;
|
||||||
|
|
||||||
|
public function __construct($config ,$operation) {
|
||||||
|
$this->config = $config;
|
||||||
|
$this->operation = $operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
// format bucket style
|
||||||
|
public function bucketStyleTransformer(CommandInterface $command, RequestInterface $request) {
|
||||||
|
$action = $command->getName();
|
||||||
|
if ($action == 'ListBuckets') {
|
||||||
|
return $request->withUri(new Uri($this->config['schema']."://service.cos.myqcloud.com/"));
|
||||||
|
}
|
||||||
|
$operation = $this->operation;
|
||||||
|
$bucketname = $command['Bucket'];
|
||||||
|
|
||||||
|
$appId = $this->config['appId'];
|
||||||
|
if ($appId != null && endWith($bucketname, '-'.$appId) == False)
|
||||||
|
{
|
||||||
|
$bucketname = $bucketname.'-'.$appId;
|
||||||
|
}
|
||||||
|
$command['Bucket'] = $bucketname;
|
||||||
|
$path = '';
|
||||||
|
$http_method = $operation['httpMethod'];
|
||||||
|
$uri = $operation['uri'];
|
||||||
|
|
||||||
|
// Hoststyle is used by default
|
||||||
|
// Pathstyle
|
||||||
|
if ($this->config['pathStyle'] != true) {
|
||||||
|
if (isset($operation['parameters']['Bucket']) && $command->hasParam('Bucket')) {
|
||||||
|
$uri = str_replace("{Bucket}", '', $uri);
|
||||||
|
}
|
||||||
|
if (isset($operation['parameters']['Key']) && $command->hasParam('Key')) {
|
||||||
|
$uri = str_replace("{/Key*}", encodeKey($command['Key']), $uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$origin_host = $bucketname. '.cos.' . $this->config['region'] . '.' . $this->config['endpoint'];
|
||||||
|
// domain
|
||||||
|
if ($this->config['domain'] != null) {
|
||||||
|
$origin_host = $this->config['domain'];
|
||||||
|
}
|
||||||
|
$host = $origin_host;
|
||||||
|
if ($this->config['ip'] != null) {
|
||||||
|
$host = $this->config['ip'];
|
||||||
|
if ($this->config['port'] != null) {
|
||||||
|
$host = $this->config['ip'] . ":" . $this->config['port'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$path = $this->config['schema'].'://'. $host . $uri;
|
||||||
|
$uri = new Uri($path);
|
||||||
|
$query = $request->getUri()->getQuery();
|
||||||
|
if ($uri->getQuery() != $query && $uri->getQuery() != "") {
|
||||||
|
$query = $uri->getQuery() . "&" . $request->getUri()->getQuery();
|
||||||
|
}
|
||||||
|
$uri = $uri->withQuery($query);
|
||||||
|
$request = $request->withUri($uri);
|
||||||
|
$request = $request->withHeader('Host', $origin_host);
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
// format upload body
|
||||||
|
public function uploadBodyTransformer(CommandInterface $command, $request, $bodyParameter = 'Body', $sourceParameter = 'SourceFile') {
|
||||||
|
|
||||||
|
$operation = $this->operation;
|
||||||
|
if (!isset($operation['parameters']['Body'])) {
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
$source = isset($command[$sourceParameter]) ? $command[$sourceParameter] : null;
|
||||||
|
$body = isset($command[$bodyParameter]) ? $command[$bodyParameter] : null;
|
||||||
|
// If a file path is passed in then get the file handle
|
||||||
|
if (is_string($source) && file_exists($source)) {
|
||||||
|
$body = fopen($source, 'rb');
|
||||||
|
}
|
||||||
|
// Prepare the body parameter and remove the source file parameter
|
||||||
|
if (null !== $body) {
|
||||||
|
return $request;
|
||||||
|
} else {
|
||||||
|
throw new InvalidArgumentException(
|
||||||
|
"You must specify a non-null value for the {$bodyParameter} or {$sourceParameter} parameters.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update md5
|
||||||
|
public function md5Transformer(CommandInterface $command, $request) {
|
||||||
|
$operation = $this->operation;
|
||||||
|
if (isset($operation['data']['contentMd5'])) {
|
||||||
|
$request = $this->addMd5($request);
|
||||||
|
}
|
||||||
|
if (isset($operation['parameters']['ContentMD5']) &&
|
||||||
|
isset($command['ContentMD5'])) {
|
||||||
|
$value = $command['ContentMD5'];
|
||||||
|
if ($value === true) {
|
||||||
|
$request = $this->addMd5($request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add meta
|
||||||
|
public function metadataTransformer(CommandInterface $command, $request) {
|
||||||
|
$operation = $this->operation;
|
||||||
|
if (isset($command['Metadata'])) {
|
||||||
|
$meta = $command['Metadata'];
|
||||||
|
foreach ($meta as $key => $value) {
|
||||||
|
$request = $request->withHeader('x-cos-meta-' . $key, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
// count md5
|
||||||
|
private function addMd5($request) {
|
||||||
|
$body = $request->getBody();
|
||||||
|
if ($body && $body->getSize() > 0) {
|
||||||
|
$md5 = base64_encode(md5($body, true));
|
||||||
|
return $request->withHeader('Content-MD5', $md5);
|
||||||
|
}
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
// inventoryId
|
||||||
|
public function specialParamTransformer(CommandInterface $command, $request) {
|
||||||
|
$action = $command->getName();
|
||||||
|
if ($action == 'PutBucketInventory') {
|
||||||
|
$id = $command['Id'];
|
||||||
|
$uri = $request->getUri();
|
||||||
|
$query = $uri->getQuery();
|
||||||
|
$uri = $uri->withQuery($query . "&Id=".$id);
|
||||||
|
return $request->withUri($uri);
|
||||||
|
}
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
35
core/api/Qcos/src/Qcloud/Cos/Common.php
Normal file
35
core/api/Qcos/src/Qcloud/Cos/Common.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
function region_map($region) {
|
||||||
|
$regionmap = array('cn-east'=>'ap-shanghai',
|
||||||
|
'cn-south'=>'ap-guangzhou',
|
||||||
|
'cn-north'=>'ap-beijing-1',
|
||||||
|
'cn-south-2'=>'ap-guangzhou-2',
|
||||||
|
'cn-southwest'=>'ap-chengdu',
|
||||||
|
'sg'=>'ap-singapore',
|
||||||
|
'tj'=>'ap-beijing-1',
|
||||||
|
'bj'=>'ap-beijing',
|
||||||
|
'sh'=>'ap-shanghai',
|
||||||
|
'gz'=>'ap-guangzhou',
|
||||||
|
'cd'=>'ap-chengdu',
|
||||||
|
'sgp'=>'ap-singapore');
|
||||||
|
if (array_key_exists($region, $regionmap)) {
|
||||||
|
return $regionmap[$region];
|
||||||
|
}
|
||||||
|
return $region;
|
||||||
|
}
|
||||||
|
|
||||||
|
function encodeKey($key) {
|
||||||
|
return str_replace('%2F', '/', rawurlencode($key));
|
||||||
|
}
|
||||||
|
|
||||||
|
function endWith($haystack, $needle) {
|
||||||
|
$length = strlen($needle);
|
||||||
|
if($length == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return (substr($haystack, -$length) === $needle);
|
||||||
|
}
|
||||||
144
core/api/Qcos/src/Qcloud/Cos/Copy.php
Normal file
144
core/api/Qcos/src/Qcloud/Cos/Copy.php
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use GuzzleHttp\Psr7\Request;
|
||||||
|
use GuzzleHttp\Pool;
|
||||||
|
|
||||||
|
class Copy {
|
||||||
|
/**
|
||||||
|
* const var: part size from 1MB to 5GB, and max parts of 10000 are allowed for each upload.
|
||||||
|
*/
|
||||||
|
const MIN_PART_SIZE = 1048576;
|
||||||
|
const MAX_PART_SIZE = 5368709120;
|
||||||
|
const DEFAULT_PART_SIZE = 52428800;
|
||||||
|
const MAX_PARTS = 10000;
|
||||||
|
|
||||||
|
private $client;
|
||||||
|
private $copySource;
|
||||||
|
private $options;
|
||||||
|
private $partSize;
|
||||||
|
private $parts;
|
||||||
|
private $size;
|
||||||
|
private $commandList = [];
|
||||||
|
private $requestList = [];
|
||||||
|
|
||||||
|
public function __construct($client, $source, $options = array()) {
|
||||||
|
$minPartSize = $options['PartSize'];
|
||||||
|
unset($options['PartSize']);
|
||||||
|
$this->client = $client;
|
||||||
|
$this->copySource = $source;
|
||||||
|
$this->options = $options;
|
||||||
|
$this->size = $source['ContentLength'];
|
||||||
|
unset($source['ContentLength']);
|
||||||
|
$this->partSize = $this->calculatePartSize($minPartSize);
|
||||||
|
$this->concurrency = isset($options['Concurrency']) ? $options['Concurrency'] : 10;
|
||||||
|
$this->retry = isset($options['Retry']) ? $options['Retry'] : 5;
|
||||||
|
}
|
||||||
|
public function copy() {
|
||||||
|
$uploadId= $this->initiateMultipartUpload();
|
||||||
|
for ($i = 0; $i < $this->retry; $i += 1) {
|
||||||
|
$rt = $this->uploadParts($uploadId);
|
||||||
|
if ($rt == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sleep(1 << $i);
|
||||||
|
}
|
||||||
|
foreach ( $this->parts as $key => $row ){
|
||||||
|
$num1[$key] = $row ['PartNumber'];
|
||||||
|
$num2[$key] = $row ['ETag'];
|
||||||
|
}
|
||||||
|
array_multisort($num1, SORT_ASC, $num2, SORT_ASC, $this->parts);
|
||||||
|
return $this->client->completeMultipartUpload(array(
|
||||||
|
'Bucket' => $this->options['Bucket'],
|
||||||
|
'Key' => $this->options['Key'],
|
||||||
|
'UploadId' => $uploadId,
|
||||||
|
'Parts' => $this->parts)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
public function uploadParts($uploadId) {
|
||||||
|
$copyRequests = function ($uploadId) {
|
||||||
|
$offset = 0;
|
||||||
|
$partNumber = 1;
|
||||||
|
$partSize = $this->partSize;
|
||||||
|
$finishedNum = 0;
|
||||||
|
$this->parts = array();
|
||||||
|
for ($index = 1; ; $index ++) {
|
||||||
|
if ($offset + $partSize >= $this->size)
|
||||||
|
{
|
||||||
|
$partSize = $this->size - $offset;
|
||||||
|
}
|
||||||
|
$copySourcePath = $this->copySource['Bucket']. '.cos.'. $this->copySource['Region'].
|
||||||
|
".myqcloud.com/". $this->copySource['Key']. "?versionId=". $this->copySource['VersionId'];
|
||||||
|
$params = array(
|
||||||
|
'Bucket' => $this->options['Bucket'],
|
||||||
|
'Key' => $this->options['Key'],
|
||||||
|
'UploadId' => $uploadId,
|
||||||
|
'PartNumber' => $partNumber,
|
||||||
|
'CopySource'=> $copySourcePath,
|
||||||
|
'CopySourceRange' => 'bytes='.((string)$offset).'-'.(string)($offset+$partSize - 1),
|
||||||
|
);
|
||||||
|
if(!isset($parts[$partNumber])) {
|
||||||
|
$command = $this->client->getCommand('uploadPartCopy', $params);
|
||||||
|
$request = $this->client->commandToRequestTransformer($command);
|
||||||
|
$this->commandList[$index] = $command;
|
||||||
|
$this->requestList[$index] = $request;
|
||||||
|
yield $request;
|
||||||
|
}
|
||||||
|
++$partNumber;
|
||||||
|
$offset += $partSize;
|
||||||
|
if ($this->size == $offset) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$pool = new Pool($this->client->httpClient, $copyRequests($uploadId), [
|
||||||
|
'concurrency' => $this->concurrency,
|
||||||
|
'fulfilled' => function ($response, $index) {
|
||||||
|
$index = $index + 1;
|
||||||
|
$response = $this->client->responseToResultTransformer($response, $this->requestList[$index], $this->commandList[$index]);
|
||||||
|
$part = array('PartNumber' => $index, 'ETag' => $response['ETag']);
|
||||||
|
$this->parts[$index] = $part;
|
||||||
|
},
|
||||||
|
|
||||||
|
'rejected' => function ($reason, $index) {
|
||||||
|
$retry = 2;
|
||||||
|
for ($i = 1; $i <= $retry; $i++) {
|
||||||
|
$index = $index += 1;
|
||||||
|
try {
|
||||||
|
$rt =$this->client->execute($commandList[$index]);
|
||||||
|
$part = array('PartNumber' => $index, 'ETag' => $rt['ETag']);
|
||||||
|
$this->parts[$index] = $part;
|
||||||
|
} catch(Exception $e) {
|
||||||
|
if ($i == $retry) {
|
||||||
|
throw($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Initiate the transfers and create a promise
|
||||||
|
$promise = $pool->promise();
|
||||||
|
|
||||||
|
// Force the pool of requests to complete.
|
||||||
|
$promise->wait();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function calculatePartSize($minPartSize)
|
||||||
|
{
|
||||||
|
$partSize = intval(ceil(($this->size / self::MAX_PARTS)));
|
||||||
|
$partSize = max($minPartSize, $partSize);
|
||||||
|
$partSize = min($partSize, self::MAX_PART_SIZE);
|
||||||
|
$partSize = max($partSize, self::MIN_PART_SIZE);
|
||||||
|
return $partSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function initiateMultipartUpload() {
|
||||||
|
$result = $this->client->createMultipartUpload($this->options);
|
||||||
|
return $result['UploadId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
162
core/api/Qcos/src/Qcloud/Cos/CosTransformer.php
Normal file
162
core/api/Qcos/src/Qcloud/Cos/CosTransformer.php
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use Guzzle\Service\Description\Parameter;
|
||||||
|
use Guzzle\Service\Description\ServiceDescription;
|
||||||
|
use GuzzleHttp\HandlerStack;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Qcloud\Cos\Signature;
|
||||||
|
use GuzzleHttp\Command\Guzzle\Description;
|
||||||
|
use GuzzleHttp\Command\Guzzle\GuzzleClient;
|
||||||
|
use GuzzleHttp\Command\CommandInterface;
|
||||||
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Middleware;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use GuzzleHttp\Psr7\Uri;
|
||||||
|
use InvalidArgumentException;
|
||||||
|
|
||||||
|
|
||||||
|
class CosTransformer {
|
||||||
|
private $config;
|
||||||
|
private $operation;
|
||||||
|
|
||||||
|
public function __construct($config ,$operation) {
|
||||||
|
$this->config = $config;
|
||||||
|
$this->operation = $operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
// format bucket style
|
||||||
|
public function bucketStyleTransformer(CommandInterface $command, RequestInterface $request) {
|
||||||
|
$action = $command->getName();
|
||||||
|
if ($action == 'ListBuckets') {
|
||||||
|
return $request->withUri(new Uri($this->config['schema']."://service.cos.myqcloud.com/"));
|
||||||
|
}
|
||||||
|
$operation = $this->operation;
|
||||||
|
$bucketname = $command['Bucket'];
|
||||||
|
|
||||||
|
$appId = $this->config['appId'];
|
||||||
|
if ($appId != null && endWith($bucketname, '-'.$appId) == False)
|
||||||
|
{
|
||||||
|
$bucketname = $bucketname.'-'.$appId;
|
||||||
|
}
|
||||||
|
$command['Bucket'] = $bucketname;
|
||||||
|
$path = '';
|
||||||
|
$http_method = $operation['httpMethod'];
|
||||||
|
$uri = $operation['uri'];
|
||||||
|
|
||||||
|
// Hoststyle is used by default
|
||||||
|
// Pathstyle
|
||||||
|
if ($this->config['pathStyle'] != true) {
|
||||||
|
if (isset($operation['parameters']['Bucket']) && $command->hasParam('Bucket')) {
|
||||||
|
$uri = str_replace("{Bucket}", '', $uri);
|
||||||
|
}
|
||||||
|
if (isset($operation['parameters']['Key']) && $command->hasParam('Key')) {
|
||||||
|
$uri = str_replace("{/Key*}", encodeKey($command['Key']), $uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$origin_host = $bucketname. '.cos.' . $this->config['region'] . '.' . $this->config['endpoint'];
|
||||||
|
// domain
|
||||||
|
if ($this->config['domain'] != null) {
|
||||||
|
$origin_host = $this->config['domain'];
|
||||||
|
}
|
||||||
|
$host = $origin_host;
|
||||||
|
if ($this->config['ip'] != null) {
|
||||||
|
$host = $this->config['ip'];
|
||||||
|
if ($this->config['port'] != null) {
|
||||||
|
$host = $this->config['ip'] . ":" . $this->config['port'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$path = $this->config['schema'].'://'. $host . $uri;
|
||||||
|
$uri = new Uri($path);
|
||||||
|
$query = $request->getUri()->getQuery();
|
||||||
|
if ($uri->getQuery() != $query && $uri->getQuery() != "") {
|
||||||
|
$query = $uri->getQuery() . "&" . $request->getUri()->getQuery();
|
||||||
|
}
|
||||||
|
$uri = $uri->withQuery($query);
|
||||||
|
$request = $request->withUri($uri);
|
||||||
|
$request = $request->withHeader('Host', $origin_host);
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
// format upload body
|
||||||
|
public function uploadBodyTransformer(CommandInterface $command, $request, $bodyParameter = 'Body', $sourceParameter = 'SourceFile') {
|
||||||
|
|
||||||
|
$operation = $this->operation;
|
||||||
|
if (!isset($operation['parameters']['Body'])) {
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
$source = isset($command[$sourceParameter]) ? $command[$sourceParameter] : null;
|
||||||
|
$body = isset($command[$bodyParameter]) ? $command[$bodyParameter] : null;
|
||||||
|
// If a file path is passed in then get the file handle
|
||||||
|
if (is_string($source) && file_exists($source)) {
|
||||||
|
$body = fopen($source, 'rb');
|
||||||
|
}
|
||||||
|
// Prepare the body parameter and remove the source file parameter
|
||||||
|
if (null !== $body) {
|
||||||
|
return $request;
|
||||||
|
} else {
|
||||||
|
throw new InvalidArgumentException(
|
||||||
|
"You must specify a non-null value for the {$bodyParameter} or {$sourceParameter} parameters.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update md5
|
||||||
|
public function md5Transformer(CommandInterface $command, $request) {
|
||||||
|
$operation = $this->operation;
|
||||||
|
if (isset($operation['data']['contentMd5'])) {
|
||||||
|
$request = $this->addMd5($request);
|
||||||
|
}
|
||||||
|
if (isset($operation['parameters']['ContentMD5']) &&
|
||||||
|
isset($command['ContentMD5'])) {
|
||||||
|
$value = $command['ContentMD5'];
|
||||||
|
if ($value === true) {
|
||||||
|
$request = $this->addMd5($request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add meta
|
||||||
|
public function metadataTransformer(CommandInterface $command, $request) {
|
||||||
|
$operation = $this->operation;
|
||||||
|
if (isset($command['Metadata'])) {
|
||||||
|
$meta = $command['Metadata'];
|
||||||
|
foreach ($meta as $key => $value) {
|
||||||
|
$request = $request->withHeader('x-cos-meta-' . $key, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
// count md5
|
||||||
|
private function addMd5($request) {
|
||||||
|
$body = $request->getBody();
|
||||||
|
if ($body && $body->getSize() > 0) {
|
||||||
|
$md5 = base64_encode(md5($body, true));
|
||||||
|
return $request->withHeader('Content-MD5', $md5);
|
||||||
|
}
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
// inventoryId
|
||||||
|
public function specialParamTransformer(CommandInterface $command, $request) {
|
||||||
|
$action = $command->getName();
|
||||||
|
if ($action == 'PutBucketInventory') {
|
||||||
|
$id = $command['Id'];
|
||||||
|
$uri = $request->getUri();
|
||||||
|
$query = $uri->getQuery();
|
||||||
|
$uri = $uri->withQuery($query . "&Id=".$id);
|
||||||
|
return $request->withUri($uri);
|
||||||
|
}
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
7
core/api/Qcos/src/Qcloud/Cos/Exception/CosException.php
Normal file
7
core/api/Qcos/src/Qcloud/Cos/Exception/CosException.php
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos\Exception;
|
||||||
|
|
||||||
|
use Qcloud\Cos\Exception\ServiceResponseException;
|
||||||
|
|
||||||
|
class CosException extends ServiceResponseException {}
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos\Exception;
|
||||||
|
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
class ServiceResponseException extends \RuntimeException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Response Response
|
||||||
|
*/
|
||||||
|
protected $response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var RequestInterface Request
|
||||||
|
*/
|
||||||
|
protected $request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Request ID
|
||||||
|
*/
|
||||||
|
protected $requestId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Exception type (client / server)
|
||||||
|
*/
|
||||||
|
protected $exceptionType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Exception code
|
||||||
|
*/
|
||||||
|
protected $exceptionCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the exception code
|
||||||
|
*
|
||||||
|
* @param string $code Exception code
|
||||||
|
*/
|
||||||
|
public function setExceptionCode($code) {
|
||||||
|
$this->exceptionCode = $code;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the exception code
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getExceptionCode() {
|
||||||
|
return $this->exceptionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the exception type
|
||||||
|
*
|
||||||
|
* @param string $type Exception type
|
||||||
|
*/
|
||||||
|
public function setExceptionType($type) {
|
||||||
|
$this->exceptionType = $type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the exception type (one of client or server)
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getExceptionType() {
|
||||||
|
return $this->exceptionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the request ID
|
||||||
|
*
|
||||||
|
* @param string $id Request ID
|
||||||
|
*/
|
||||||
|
public function setRequestId($id) {
|
||||||
|
$this->requestId = $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Request ID
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getRequestId() {
|
||||||
|
return $this->requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the associated response
|
||||||
|
*
|
||||||
|
* @param Response $response Response
|
||||||
|
*/
|
||||||
|
public function setResponse(ResponseInterface $response) {
|
||||||
|
$this->response = $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the associated response object
|
||||||
|
*
|
||||||
|
* @return Response|null
|
||||||
|
*/
|
||||||
|
public function getResponse() {
|
||||||
|
return $this->response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the associated request
|
||||||
|
*
|
||||||
|
* @param RequestInterface $request
|
||||||
|
*/
|
||||||
|
public function setRequest(RequestInterface $request) {
|
||||||
|
$this->request = $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the associated request object
|
||||||
|
*
|
||||||
|
* @return RequestInterface|null
|
||||||
|
*/
|
||||||
|
public function getRequest() {
|
||||||
|
return $this->request;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the status code of the response
|
||||||
|
*
|
||||||
|
* @return int|null
|
||||||
|
*/
|
||||||
|
public function getStatusCode() {
|
||||||
|
return $this->response ? $this->response->getStatusCode() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cast to a string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString() {
|
||||||
|
$message = get_class($this) . ': '
|
||||||
|
. 'Cos Error Code: ' . $this->getExceptionCode() . ', '
|
||||||
|
. 'Status Code: ' . $this->getStatusCode() . ', '
|
||||||
|
. 'Cos Request ID: ' . $this->getRequestId() . ', '
|
||||||
|
. 'Cos Error Type: ' . $this->getExceptionType() . ', '
|
||||||
|
. 'Cos Error Message: ' . $this->getMessage();
|
||||||
|
|
||||||
|
// Add the User-Agent if available
|
||||||
|
if ($this->request) {
|
||||||
|
$message .= ', ' . 'User-Agent: ' . $this->request->getHeader('User-Agent')[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the request ID of the error. This value is only present if a
|
||||||
|
* response was received, and is not present in the event of a networking
|
||||||
|
* error.
|
||||||
|
*
|
||||||
|
* Same as `getRequestId()` method, but matches the interface for SDKv3.
|
||||||
|
*
|
||||||
|
* @return string|null Returns null if no response was received
|
||||||
|
*/
|
||||||
|
public function getCosRequestId() {
|
||||||
|
return $this->requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Cos error type.
|
||||||
|
*
|
||||||
|
* Same as `getExceptionType()` method, but matches the interface for SDKv3.
|
||||||
|
*
|
||||||
|
* @return string|null Returns null if no response was received
|
||||||
|
*/
|
||||||
|
public function getCosErrorType() {
|
||||||
|
return $this->exceptionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Cos error code.
|
||||||
|
*
|
||||||
|
* Same as `getExceptionCode()` method, but matches the interface for SDKv3.
|
||||||
|
*
|
||||||
|
* @return string|null Returns null if no response was received
|
||||||
|
*/
|
||||||
|
public function getCosErrorCode() {
|
||||||
|
return $this->exceptionCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
72
core/api/Qcos/src/Qcloud/Cos/ExceptionMiddleware.php
Normal file
72
core/api/Qcos/src/Qcloud/Cos/ExceptionMiddleware.php
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use Qcloud\Cos\Exception\ServiceResponseException;
|
||||||
|
use GuzzleHttp\Promise\PromiseInterface;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
|
||||||
|
class ExceptionMiddleware {
|
||||||
|
private $nextHandler;
|
||||||
|
protected $parser;
|
||||||
|
protected $defaultException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param callable $nextHandler Next handler to invoke.
|
||||||
|
*/
|
||||||
|
public function __construct(callable $nextHandler) {
|
||||||
|
$this->nextHandler = $nextHandler;
|
||||||
|
$this->parser = new ExceptionParser();
|
||||||
|
$this->defaultException = 'Qcloud\Cos\Exception\ServiceResponseException';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param RequestInterface $request
|
||||||
|
* @param array $options
|
||||||
|
*
|
||||||
|
* @return PromiseInterface
|
||||||
|
*/
|
||||||
|
public function __invoke(RequestInterface $request, array $options) {
|
||||||
|
$fn = $this->nextHandler;
|
||||||
|
return $fn($request, $options)->then(
|
||||||
|
function (ResponseInterface $response) use ($request) {
|
||||||
|
return $this->handle($request, $response);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(RequestInterface $request, ResponseInterface $response) {
|
||||||
|
$code = $response->getStatusCode();
|
||||||
|
if ($code < 400) {
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
//throw RequestException::create($request, $response);
|
||||||
|
$parts = $this->parser->parse($request, $response);
|
||||||
|
|
||||||
|
$className = 'Qcloud\\Cos\\Exception\\' . $parts['code'];
|
||||||
|
if (substr($className, -9) !== 'Exception') {
|
||||||
|
$className .= 'Exception';
|
||||||
|
}
|
||||||
|
|
||||||
|
$className = class_exists($className) ? $className : $this->defaultException;
|
||||||
|
|
||||||
|
throw $this->createException($className, $request, $response, $parts);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function createException($className, RequestInterface $request, ResponseInterface $response, array $parts) {
|
||||||
|
$class = new $className($parts['message']);
|
||||||
|
|
||||||
|
if ($class instanceof ServiceResponseException) {
|
||||||
|
$class->setExceptionCode($parts['code']);
|
||||||
|
$class->setExceptionType($parts['type']);
|
||||||
|
$class->setResponse($response);
|
||||||
|
$class->setRequest($request);
|
||||||
|
$class->setRequestId($parts['request_id']);
|
||||||
|
}
|
||||||
|
return $class;
|
||||||
|
}
|
||||||
|
}
|
||||||
112
core/api/Qcos/src/Qcloud/Cos/ExceptionParser.php
Normal file
112
core/api/Qcos/src/Qcloud/Cos/ExceptionParser.php
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses default XML exception responses
|
||||||
|
*/
|
||||||
|
class ExceptionParser {
|
||||||
|
|
||||||
|
public function parse(RequestInterface $request, ResponseInterface $response) {
|
||||||
|
$data = array(
|
||||||
|
'code' => null,
|
||||||
|
'message' => null,
|
||||||
|
//'type' => $response->isClientError() ? 'client' : 'server',
|
||||||
|
'type' => 'client',
|
||||||
|
'request_id' => null,
|
||||||
|
'parsed' => null
|
||||||
|
);
|
||||||
|
|
||||||
|
$body = strval($response->getBody());
|
||||||
|
|
||||||
|
if (empty($body)) {
|
||||||
|
$this->parseHeaders($request, $response, $data);
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$xml = new \SimpleXMLElement(utf8_encode($body));
|
||||||
|
$this->parseBody($xml, $data);
|
||||||
|
return $data;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$data['code'] = 'PhpInternalXmlParseError';
|
||||||
|
$data['message'] = 'A non-XML response was received';
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses additional exception information from the response headers
|
||||||
|
*
|
||||||
|
* @param RequestInterface $request Request that was issued
|
||||||
|
* @param Response $response The response from the request
|
||||||
|
* @param array $data The current set of exception data
|
||||||
|
*/
|
||||||
|
protected function parseHeaders(RequestInterface $request, ResponseInterface $response, array &$data) {
|
||||||
|
$data['message'] = $response->getStatusCode() . ' ' . $response->getReasonPhrase();
|
||||||
|
$requestId = $response->getHeader('x-cos-request-id');
|
||||||
|
if (isset($requestId[0])) {
|
||||||
|
$requestId = $requestId[0];
|
||||||
|
$data['request_id'] = $requestId;
|
||||||
|
$data['message'] .= " (Request-ID: $requestId)";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the request
|
||||||
|
$status = $response->getStatusCode();
|
||||||
|
$method = $request->getMethod();
|
||||||
|
|
||||||
|
// Attempt to determine code for 403s and 404s
|
||||||
|
if ($status === 403) {
|
||||||
|
$data['code'] = 'AccessDenied';
|
||||||
|
} elseif ($method === 'HEAD' && $status === 404) {
|
||||||
|
$path = explode('/', trim($request->getUri()->getPath(), '/'));
|
||||||
|
$host = explode('.', $request->getUri()->getHost());
|
||||||
|
$bucket = (count($host) >= 4) ? $host[0] : array_shift($path);
|
||||||
|
$object = array_shift($path);
|
||||||
|
|
||||||
|
if ($bucket && $object) {
|
||||||
|
$data['code'] = 'NoSuchKey';
|
||||||
|
} elseif ($bucket) {
|
||||||
|
$data['code'] = 'NoSuchBucket';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses additional exception information from the response body
|
||||||
|
*
|
||||||
|
* @param \SimpleXMLElement $body The response body as XML
|
||||||
|
* @param array $data The current set of exception data
|
||||||
|
*/
|
||||||
|
protected function parseBody(\SimpleXMLElement $body, array &$data) {
|
||||||
|
$data['parsed'] = $body;
|
||||||
|
|
||||||
|
$namespaces = $body->getDocNamespaces();
|
||||||
|
if (isset($namespaces[''])) {
|
||||||
|
// Account for the default namespace being defined and PHP not being able to handle it :(
|
||||||
|
$body->registerXPathNamespace('ns', $namespaces['']);
|
||||||
|
$prefix = 'ns:';
|
||||||
|
} else {
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tempXml = $body->xpath("//{$prefix}Code[1]")) {
|
||||||
|
$data['code'] = (string) $tempXml[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tempXml = $body->xpath("//{$prefix}Message[1]")) {
|
||||||
|
$data['message'] = (string) $tempXml[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
$tempXml = $body->xpath("//{$prefix}RequestId[1]");
|
||||||
|
if (empty($tempXml)) {
|
||||||
|
$tempXml = $body->xpath("//{$prefix}RequestID[1]");
|
||||||
|
}
|
||||||
|
if (isset($tempXml[0])) {
|
||||||
|
$data['request_id'] = (string) $tempXml[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
126
core/api/Qcos/src/Qcloud/Cos/MultipartUpload.php
Normal file
126
core/api/Qcos/src/Qcloud/Cos/MultipartUpload.php
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use Qcloud\Cos\Exception\CosException;
|
||||||
|
|
||||||
|
class MultipartUpload {
|
||||||
|
/**
|
||||||
|
* const var: part size from 1MB to 5GB, and max parts of 10000 are allowed for each upload.
|
||||||
|
*/
|
||||||
|
const MIN_PART_SIZE = 1048576;
|
||||||
|
const MAX_PART_SIZE = 5368709120;
|
||||||
|
const DEFAULT_PART_SIZE = 52428800;
|
||||||
|
const MAX_PARTS = 10000;
|
||||||
|
|
||||||
|
private $client;
|
||||||
|
private $body;
|
||||||
|
private $options;
|
||||||
|
private $partSize;
|
||||||
|
|
||||||
|
public function __construct($client, $body, $options = array()) {
|
||||||
|
$this->client = $client;
|
||||||
|
$this->body = $body;
|
||||||
|
$this->options = $options;
|
||||||
|
$this->partSize = $this->calculatePartSize($options['PartSize']);
|
||||||
|
unset($options['PartSize']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function performUploading() {
|
||||||
|
$rt = $this->initiateMultipartUpload();
|
||||||
|
$uploadId = $rt['UploadId'];
|
||||||
|
$partNumber = 1;
|
||||||
|
$parts = array();
|
||||||
|
for (;;) {
|
||||||
|
if ($this->body->eof()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$body = $this->body->read($this->partSize);
|
||||||
|
if (empty($body)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$result = $this->client->uploadPart(array(
|
||||||
|
'Bucket' => $this->options['Bucket'],
|
||||||
|
'Key' => $this->options['Key'],
|
||||||
|
'Body' => $body,
|
||||||
|
'UploadId' => $uploadId,
|
||||||
|
'PartNumber' => $partNumber));
|
||||||
|
if (md5($body) != substr($result['ETag'], 1, -1)){
|
||||||
|
throw new CosException("ETag check inconsistency");
|
||||||
|
}
|
||||||
|
$part = array('PartNumber' => $partNumber, 'ETag' => $result['ETag']);
|
||||||
|
array_push($parts, $part);
|
||||||
|
++$partNumber;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
$rt = $this->client->completeMultipartUpload(array(
|
||||||
|
'Bucket' => $this->options['Bucket'],
|
||||||
|
'Key' => $this->options['Key'],
|
||||||
|
'UploadId' => $uploadId,
|
||||||
|
'Parts' => $parts));
|
||||||
|
} catch(\Exception $e){
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
return $rt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resumeUploading() {
|
||||||
|
$uploadId = $this->options['UploadId'];
|
||||||
|
$rt = $this->client->ListParts(
|
||||||
|
array('UploadId' => $uploadId,
|
||||||
|
'Bucket'=>$this->options['Bucket'],
|
||||||
|
'Key'=>$this->options['Key']));
|
||||||
|
$parts = array();
|
||||||
|
if (count($rt['Parts']) > 0) {
|
||||||
|
foreach ($rt['Parts'] as $part) {
|
||||||
|
$parts[$part['PartNumber'] - 1] = array('PartNumber' => $part['PartNumber'], 'ETag' => $part['ETag']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for ($partNumber = 1;;++$partNumber) {
|
||||||
|
if ($this->body->eof()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$body = $this->body->read($this->partSize);
|
||||||
|
|
||||||
|
if (array_key_exists($partNumber-1, $parts)){
|
||||||
|
|
||||||
|
if (md5($body) != substr($parts[$partNumber-1]['ETag'], 1, -1)){
|
||||||
|
throw new CosException("ETag check inconsistency");
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->client->uploadPart(array(
|
||||||
|
'Bucket' => $this->options['Bucket'],
|
||||||
|
'Key' => $this->options['Key'],
|
||||||
|
'Body' => $body,
|
||||||
|
'UploadId' => $uploadId,
|
||||||
|
'PartNumber' => $partNumber));
|
||||||
|
if (md5($body) != substr($result['ETag'], 1, -1)){
|
||||||
|
throw new CosException("ETag check inconsistency");
|
||||||
|
}
|
||||||
|
$parts[$partNumber-1] = array('PartNumber' => $partNumber, 'ETag' => $result['ETag']);
|
||||||
|
|
||||||
|
}
|
||||||
|
$rt = $this->client->completeMultipartUpload(array(
|
||||||
|
'Bucket' => $this->options['Bucket'],
|
||||||
|
'Key' => $this->options['Key'],
|
||||||
|
'UploadId' => $uploadId,
|
||||||
|
'Parts' => $parts));
|
||||||
|
return $rt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function calculatePartSize($minPartSize) {
|
||||||
|
$partSize = intval(ceil(($this->body->getSize() / self::MAX_PARTS)));
|
||||||
|
$partSize = max($minPartSize, $partSize);
|
||||||
|
$partSize = min($partSize, self::MAX_PART_SIZE);
|
||||||
|
$partSize = max($partSize, self::MIN_PART_SIZE);
|
||||||
|
|
||||||
|
return $partSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function initiateMultipartUpload() {
|
||||||
|
$result = $this->client->createMultipartUpload($this->options);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
49
core/api/Qcos/src/Qcloud/Cos/Request/BodyLocation.php
Normal file
49
core/api/Qcos/src/Qcloud/Cos/Request/BodyLocation.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos\Request;
|
||||||
|
|
||||||
|
use GuzzleHttp\Command\Guzzle\RequestLocation\AbstractLocation;
|
||||||
|
use GuzzleHttp\Command\CommandInterface;
|
||||||
|
use GuzzleHttp\Command\Guzzle\Parameter;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use Psr\Http\Message\MessageInterface;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a raw/binary body to a request.
|
||||||
|
* This is here because: https://github.com/guzzle/guzzle-services/issues/160
|
||||||
|
*/
|
||||||
|
class BodyLocation extends AbstractLocation
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the name of the location
|
||||||
|
*
|
||||||
|
* @param string $locationName
|
||||||
|
*/
|
||||||
|
public function __construct($locationName = 'body')
|
||||||
|
{
|
||||||
|
parent::__construct($locationName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param CommandInterface $command
|
||||||
|
* @param RequestInterface $request
|
||||||
|
* @param Parameter $param
|
||||||
|
*
|
||||||
|
* @return MessageInterface
|
||||||
|
*/
|
||||||
|
public function visit(
|
||||||
|
CommandInterface $command,
|
||||||
|
RequestInterface $request,
|
||||||
|
Parameter $param
|
||||||
|
) {
|
||||||
|
$value = $request->getBody()->getContents();
|
||||||
|
if ('' !== $value) {
|
||||||
|
throw new \RuntimeException('Only one "body" location may exist per operation');
|
||||||
|
}
|
||||||
|
// binary string data from bound parameter
|
||||||
|
$value = $command[$param->getName()];
|
||||||
|
return $request->withBody(Psr7\stream_for($value));
|
||||||
|
}
|
||||||
|
}
|
||||||
119
core/api/Qcos/src/Qcloud/Cos/ResultTransformer.php
Normal file
119
core/api/Qcos/src/Qcloud/Cos/ResultTransformer.php
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use Guzzle\Service\Description\Parameter;
|
||||||
|
use Guzzle\Service\Description\ServiceDescription;
|
||||||
|
use GuzzleHttp\HandlerStack;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Qcloud\Cos\Signature;
|
||||||
|
use GuzzleHttp\Command\Guzzle\Description;
|
||||||
|
use GuzzleHttp\Command\Guzzle\GuzzleClient;
|
||||||
|
use GuzzleHttp\Command\CommandInterface;
|
||||||
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Middleware;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use GuzzleHttp\Psr7\Uri;
|
||||||
|
use GuzzleHttp\Command\Result;
|
||||||
|
use InvalidArgumentException;
|
||||||
|
|
||||||
|
|
||||||
|
class ResultTransformer {
|
||||||
|
private $config;
|
||||||
|
private $operation;
|
||||||
|
|
||||||
|
public function __construct($config, $operation) {
|
||||||
|
$this->config = $config;
|
||||||
|
$this->operation = $operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function writeDataToLocal(CommandInterface $command, RequestInterface $request, ResponseInterface $response) {
|
||||||
|
$action = $command->getName();
|
||||||
|
if ($action == "GetObject") {
|
||||||
|
if (isset($command['SaveAs'])) {
|
||||||
|
$fp = fopen($command['SaveAs'], "wb");
|
||||||
|
fwrite($fp, $response->getBody());
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function metaDataTransformer(CommandInterface $command, ResponseInterface $response, Result $result) {
|
||||||
|
$headers = $response->getHeaders();
|
||||||
|
$metadata = array();
|
||||||
|
foreach ($headers as $key => $value) {
|
||||||
|
if (strpos($key, "x-cos-meta-") === 0) {
|
||||||
|
$metadata[substr($key, 11)] = $value[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($metadata)) {
|
||||||
|
$result['Metadata'] = $metadata;
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function extraHeadersTransformer(CommandInterface $command, RequestInterface $request, Result $result) {
|
||||||
|
if ($command['Key'] != null && $result['Key'] == null) {
|
||||||
|
$result['Key'] = $command['Key'];
|
||||||
|
}
|
||||||
|
if ($command['Bucket'] != null && $result['Bucket'] == null) {
|
||||||
|
$result['Bucket'] = $command['Bucket'];
|
||||||
|
}
|
||||||
|
$result['Location'] = $request->getHeader("Host")[0] . $request->getUri()->getPath();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function selectContentTransformer(CommandInterface $command, Result $result) {
|
||||||
|
$action = $command->getName();
|
||||||
|
if ($action == "SelectObjectContent") {
|
||||||
|
$result['Data'] = $this->getSelectContents($result);
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSelectContents($result) {
|
||||||
|
$f = $result['RawData'];
|
||||||
|
while (!$f->eof()) {
|
||||||
|
$data = array();
|
||||||
|
$tmp = $f->read(4);
|
||||||
|
if (empty($tmp)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$totol_length = (int)(unpack("N", $tmp)[1]);
|
||||||
|
$headers_length = (int)(unpack("N", $f->read(4))[1]);
|
||||||
|
$body_length = $totol_length - $headers_length - 16;
|
||||||
|
$predule_crc = (int)(unpack("N", $f->read(4))[1]);
|
||||||
|
$headers = array();
|
||||||
|
for ($offset = 0; $offset < $headers_length;) {
|
||||||
|
$key_length = (int)(unpack("C", $f->read(1))[1]);
|
||||||
|
$key = $f->read($key_length);
|
||||||
|
|
||||||
|
$head_value_type = (int)(unpack("C", $f->read(1))[1]);
|
||||||
|
|
||||||
|
$value_length = (int)(unpack("n", $f->read(2))[1]);
|
||||||
|
$value = $f->read($value_length);
|
||||||
|
$offset += 4 + $key_length + $value_length;
|
||||||
|
if ($key == ":message-type") {
|
||||||
|
$data['MessageType'] = $value;
|
||||||
|
}
|
||||||
|
if ($key == ":event-type") {
|
||||||
|
$data['EventType'] = $value;
|
||||||
|
}
|
||||||
|
if ($key == ":error-code") {
|
||||||
|
$data['ErrorCode'] = $value;
|
||||||
|
}
|
||||||
|
if ($key == ":error-message") {
|
||||||
|
$data['ErrorMessage'] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$body = $f->read($body_length);
|
||||||
|
$message_crc = (int)(unpack("N", $f->read(4))[1]);
|
||||||
|
$data['Body'] = $body;
|
||||||
|
yield $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function __destruct() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
79
core/api/Qcos/src/Qcloud/Cos/Serializer.php
Normal file
79
core/api/Qcos/src/Qcloud/Cos/Serializer.php
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<?php
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
use GuzzleHttp\Command\CommandInterface;
|
||||||
|
use GuzzleHttp\Command\Guzzle\SchemaValidator;
|
||||||
|
use GuzzleHttp\Command\Guzzle\DescriptionInterface;
|
||||||
|
use GuzzleHttp\Command\Guzzle\Serializer as DefaultSerializer;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
/**
|
||||||
|
* Override Request serializer to modify authentication mechanism
|
||||||
|
*/
|
||||||
|
class Serializer extends DefaultSerializer
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
DescriptionInterface $description,
|
||||||
|
array $requestLocations = []
|
||||||
|
) {
|
||||||
|
// Override Guzzle's body location as it isn't raw binary data
|
||||||
|
$requestLocations['body'] = new Request\BodyLocation;
|
||||||
|
parent::__construct($description, $requestLocations);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Authorization header is Loco's preferred authorization method.
|
||||||
|
* Add Authorization header to request if API key is set, unless query is explicitly configured as auth method.
|
||||||
|
* Unset key from command to avoid sending it as a query param.
|
||||||
|
*
|
||||||
|
* @override
|
||||||
|
*
|
||||||
|
* @param CommandInterface $command
|
||||||
|
* @param RequestInterface $request
|
||||||
|
*
|
||||||
|
* @return RequestInterface
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*/
|
||||||
|
protected function prepareRequest(
|
||||||
|
CommandInterface $command,
|
||||||
|
RequestInterface $request
|
||||||
|
) {
|
||||||
|
/*
|
||||||
|
if ($command->offsetExists('key') === true) {
|
||||||
|
$mode = empty($command->offsetGet('auth')) === false
|
||||||
|
? $command->offsetGet('auth')
|
||||||
|
: 'loco';
|
||||||
|
if ($mode !== 'query') {
|
||||||
|
// else use Authorization header of various types
|
||||||
|
if ($mode === 'loco') {
|
||||||
|
$value = 'Loco '.$command->offsetGet('key');
|
||||||
|
$request = $request->withHeader('Authorization', $value);
|
||||||
|
} elseif ($mode === 'basic') {
|
||||||
|
$value = 'Basic '.base64_encode($command->offsetGet('key').':');
|
||||||
|
$request = $request->withHeader('Authorization', $value);
|
||||||
|
} else {
|
||||||
|
throw new \InvalidArgumentException("Invalid auth type: {$mode}");
|
||||||
|
}
|
||||||
|
// avoid request sending key parameter in query string
|
||||||
|
$command->offsetUnset('key');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Remap legacy parameters to common `data` binding on request body
|
||||||
|
static $remap = [
|
||||||
|
'import' => ['src'=>'data'],
|
||||||
|
'translate' => ['translation'=>'data'],
|
||||||
|
];
|
||||||
|
$name = $command->getName();
|
||||||
|
if (isset($remap[$name])) {
|
||||||
|
foreach ($remap[$name] as $old => $new) {
|
||||||
|
if ($command->offsetExists($old)) {
|
||||||
|
$command->offsetSet($new, $command->offsetGet($old));
|
||||||
|
$command->offsetUnset($old);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return parent::prepareRequest($command, $request);
|
||||||
|
}
|
||||||
|
}
|
||||||
4840
core/api/Qcos/src/Qcloud/Cos/Service.php
Normal file
4840
core/api/Qcos/src/Qcloud/Cos/Service.php
Normal file
File diff suppressed because it is too large
Load Diff
80
core/api/Qcos/src/Qcloud/Cos/Signature.php
Normal file
80
core/api/Qcos/src/Qcloud/Cos/Signature.php
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
|
||||||
|
class Signature
|
||||||
|
{
|
||||||
|
private $accessKey; // string: access key.
|
||||||
|
private $secretKey; // string: secret key.
|
||||||
|
|
||||||
|
public function __construct($accessKey, $secretKey, $token = null)
|
||||||
|
{
|
||||||
|
$this->accessKey = $accessKey;
|
||||||
|
$this->secretKey = $secretKey;
|
||||||
|
$this->token = $token;
|
||||||
|
date_default_timezone_set("PRC");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function signRequest(RequestInterface $request)
|
||||||
|
{
|
||||||
|
$authorization = $this->createAuthorization($request);
|
||||||
|
return $request->withHeader('Authorization', $authorization);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createAuthorization(RequestInterface $request, $expires = "+30 minutes")
|
||||||
|
{
|
||||||
|
$signTime = (string)(time() - 60) . ';' . (string)(strtotime($expires));
|
||||||
|
$httpString = strtolower($request->getMethod()) . "\n" . urldecode($request->getUri()->getPath()) .
|
||||||
|
"\n\nhost=" . $request->getHeader("Host")[0] . "\n";
|
||||||
|
$sha1edHttpString = sha1($httpString);
|
||||||
|
$stringToSign = "sha1\n$signTime\n$sha1edHttpString\n";
|
||||||
|
$signKey = hash_hmac('sha1', $signTime, $this->secretKey);
|
||||||
|
$signature = hash_hmac('sha1', $stringToSign, $signKey);
|
||||||
|
$authorization = 'q-sign-algorithm=sha1&q-ak=' . $this->accessKey .
|
||||||
|
"&q-sign-time=$signTime&q-key-time=$signTime&q-header-list=host&q-url-param-list=&" .
|
||||||
|
"q-signature=$signature";
|
||||||
|
return $authorization;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createPresignedUrl(RequestInterface $request, $expires = "+30 minutes")
|
||||||
|
{
|
||||||
|
$authorization = $this->createAuthorization($request, $expires);
|
||||||
|
$uri = $request->getUri();
|
||||||
|
$query = "sign=" . urlencode($authorization);
|
||||||
|
if ($this->token != null) {
|
||||||
|
$query = $query . "&x-cos-security-token=" . $this->token;
|
||||||
|
}
|
||||||
|
$uri = $uri->withQuery($query);
|
||||||
|
return $uri;
|
||||||
|
}
|
||||||
|
public function createThumbWaterAuthorization($request, $expires){
|
||||||
|
$signTime = (string)(time() - 60) . ';' . (string)(strtotime($expires));
|
||||||
|
$httpString = $request->geturi()->getQuery()."\n".strtolower($request->getMethod()) . "\n" . urldecode($request->getUri()->getPath()) .
|
||||||
|
"\n\nhost=" . $request->getHeader("Host")[0] . "\n";
|
||||||
|
$sha1edHttpString = sha1($httpString);
|
||||||
|
$stringToSign = "sha1\n$signTime\n$sha1edHttpString\n";
|
||||||
|
$signKey = hash_hmac('sha1', $signTime, $this->secretKey);
|
||||||
|
$signature = hash_hmac('sha1', $stringToSign, $signKey);
|
||||||
|
$authorization = 'q-sign-algorithm=sha1&q-ak=' . $this->accessKey .
|
||||||
|
"&q-sign-time=$signTime&q-key-time=$signTime&q-header-list=host&q-url-param-list=&" .
|
||||||
|
"q-signature=$signature";
|
||||||
|
return $authorization;
|
||||||
|
}
|
||||||
|
public function createThumbWatersignedUrl(RequestInterface $request, $expires = "+30 minutes")
|
||||||
|
{
|
||||||
|
$authorization = $this->createThumbWaterAuthorization($request, $expires);
|
||||||
|
$uri = $request->getUri();
|
||||||
|
$query = "sign=" . urlencode($authorization);
|
||||||
|
if ($this->token != null) {
|
||||||
|
$query = $query . "&x-cos-security-token=" . $this->token;
|
||||||
|
}
|
||||||
|
$uri = $uri->withQuery($query);
|
||||||
|
return $uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
28
core/api/Qcos/src/Qcloud/Cos/SignatureMiddleware.php
Normal file
28
core/api/Qcos/src/Qcloud/Cos/SignatureMiddleware.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos;
|
||||||
|
|
||||||
|
use Qcloud\Cos\Exception\ServiceResponseException;
|
||||||
|
use GuzzleHttp\Promise\PromiseInterface;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
|
||||||
|
class SignatureMiddleware {
|
||||||
|
private $nextHandler;
|
||||||
|
protected $signature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param callable $nextHandler Next handler to invoke.
|
||||||
|
*/
|
||||||
|
public function __construct(callable $nextHandler, $accessKey, $secretKey) {
|
||||||
|
$this->nextHandler = $nextHandler;
|
||||||
|
$this->signature = new Signature($accessKey, $secretKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(RequestInterface $request, array $options) {
|
||||||
|
$fn = $this->nextHandler;
|
||||||
|
return $fn($this->signature->signRequest($request), $options);
|
||||||
|
}
|
||||||
|
}
|
||||||
1683
core/api/Qcos/src/Qcloud/Cos/Tests/Test.php
Normal file
1683
core/api/Qcos/src/Qcloud/Cos/Tests/Test.php
Normal file
File diff suppressed because it is too large
Load Diff
45
core/api/Qcos/src/Qcloud/Cos/Tests/TestHelper.php
Normal file
45
core/api/Qcos/src/Qcloud/Cos/Tests/TestHelper.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Qcloud\Cos\Tests;
|
||||||
|
|
||||||
|
use Qcloud\Cos\Client;
|
||||||
|
|
||||||
|
class TestHelper {
|
||||||
|
|
||||||
|
public static function nuke($bucket) {
|
||||||
|
try {
|
||||||
|
$cosClient = new Client(array('region' => getenv('COS_REGION'),
|
||||||
|
'credentials'=> array(
|
||||||
|
'appId' => getenv('COS_APPID'),
|
||||||
|
'secretId' => getenv('COS_KEY'),
|
||||||
|
'secretKey' => getenv('COS_SECRET'))));
|
||||||
|
$result = $cosClient->listObjects(array('Bucket' => $bucket));
|
||||||
|
if (isset($result['Contents'])) {
|
||||||
|
foreach ($result['Contents'] as $content) {
|
||||||
|
$cosClient->deleteObject(array('Bucket' => $bucket, 'Key' => $content['Key']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while(True){
|
||||||
|
$result = $cosClient->ListMultipartUploads(
|
||||||
|
array('Bucket' => $bucket));
|
||||||
|
if (count($result['Uploads']) == 0){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
foreach ($result['Uploads'] as $upload) {
|
||||||
|
try {
|
||||||
|
$rt = $cosClient->AbortMultipartUpload(
|
||||||
|
array('Bucket' => $bucket,
|
||||||
|
'Key' => $upload['Key'],
|
||||||
|
'UploadId' => $upload['UploadId']));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
print_r($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$cosClient->deleteBucket(array('Bucket' => $bucket));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// echo "$e\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
core/api/Qcos/vendor/autoload.php
vendored
Normal file
7
core/api/Qcos/vendor/autoload.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload.php @generated by Composer
|
||||||
|
|
||||||
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
|
return ComposerAutoloaderInit6790e31be3eb151cb678c9fe759a5905::getLoader();
|
||||||
445
core/api/Qcos/vendor/composer/ClassLoader.php
vendored
Normal file
445
core/api/Qcos/vendor/composer/ClassLoader.php
vendored
Normal file
@@ -0,0 +1,445 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Composer.
|
||||||
|
*
|
||||||
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
|
* Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||||
|
*
|
||||||
|
* $loader = new \Composer\Autoload\ClassLoader();
|
||||||
|
*
|
||||||
|
* // register classes with namespaces
|
||||||
|
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||||
|
* $loader->add('Symfony', __DIR__.'/framework');
|
||||||
|
*
|
||||||
|
* // activate the autoloader
|
||||||
|
* $loader->register();
|
||||||
|
*
|
||||||
|
* // to enable searching the include path (eg. for PEAR packages)
|
||||||
|
* $loader->setUseIncludePath(true);
|
||||||
|
*
|
||||||
|
* In this example, if you try to use a class in the Symfony\Component
|
||||||
|
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||||
|
* the autoloader will first look for the class under the component/
|
||||||
|
* directory, and it will then fallback to the framework/ directory if not
|
||||||
|
* found before giving up.
|
||||||
|
*
|
||||||
|
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
* @see http://www.php-fig.org/psr/psr-0/
|
||||||
|
* @see http://www.php-fig.org/psr/psr-4/
|
||||||
|
*/
|
||||||
|
class ClassLoader
|
||||||
|
{
|
||||||
|
// PSR-4
|
||||||
|
private $prefixLengthsPsr4 = array();
|
||||||
|
private $prefixDirsPsr4 = array();
|
||||||
|
private $fallbackDirsPsr4 = array();
|
||||||
|
|
||||||
|
// PSR-0
|
||||||
|
private $prefixesPsr0 = array();
|
||||||
|
private $fallbackDirsPsr0 = array();
|
||||||
|
|
||||||
|
private $useIncludePath = false;
|
||||||
|
private $classMap = array();
|
||||||
|
private $classMapAuthoritative = false;
|
||||||
|
private $missingClasses = array();
|
||||||
|
private $apcuPrefix;
|
||||||
|
|
||||||
|
public function getPrefixes()
|
||||||
|
{
|
||||||
|
if (!empty($this->prefixesPsr0)) {
|
||||||
|
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPrefixesPsr4()
|
||||||
|
{
|
||||||
|
return $this->prefixDirsPsr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFallbackDirs()
|
||||||
|
{
|
||||||
|
return $this->fallbackDirsPsr0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFallbackDirsPsr4()
|
||||||
|
{
|
||||||
|
return $this->fallbackDirsPsr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getClassMap()
|
||||||
|
{
|
||||||
|
return $this->classMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $classMap Class to filename map
|
||||||
|
*/
|
||||||
|
public function addClassMap(array $classMap)
|
||||||
|
{
|
||||||
|
if ($this->classMap) {
|
||||||
|
$this->classMap = array_merge($this->classMap, $classMap);
|
||||||
|
} else {
|
||||||
|
$this->classMap = $classMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-0 directories for a given prefix, either
|
||||||
|
* appending or prepending to the ones previously set for this prefix.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix
|
||||||
|
* @param array|string $paths The PSR-0 root directories
|
||||||
|
* @param bool $prepend Whether to prepend the directories
|
||||||
|
*/
|
||||||
|
public function add($prefix, $paths, $prepend = false)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
if ($prepend) {
|
||||||
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->fallbackDirsPsr0
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
|
$this->fallbackDirsPsr0,
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$first = $prefix[0];
|
||||||
|
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($prepend) {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->prefixesPsr0[$first][$prefix]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
|
$this->prefixesPsr0[$first][$prefix],
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-4 directories for a given namespace, either
|
||||||
|
* appending or prepending to the ones previously set for this namespace.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
|
* @param array|string $paths The PSR-4 base directories
|
||||||
|
* @param bool $prepend Whether to prepend the directories
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*/
|
||||||
|
public function addPsr4($prefix, $paths, $prepend = false)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
// Register directories for the root namespace.
|
||||||
|
if ($prepend) {
|
||||||
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->fallbackDirsPsr4
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
|
$this->fallbackDirsPsr4,
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||||
|
// Register directories for a new namespace.
|
||||||
|
$length = strlen($prefix);
|
||||||
|
if ('\\' !== $prefix[$length - 1]) {
|
||||||
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
|
}
|
||||||
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
|
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||||
|
} elseif ($prepend) {
|
||||||
|
// Prepend directories for an already registered namespace.
|
||||||
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->prefixDirsPsr4[$prefix]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Append directories for an already registered namespace.
|
||||||
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
|
$this->prefixDirsPsr4[$prefix],
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-0 directories for a given prefix,
|
||||||
|
* replacing any others previously set for this prefix.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix
|
||||||
|
* @param array|string $paths The PSR-0 base directories
|
||||||
|
*/
|
||||||
|
public function set($prefix, $paths)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
$this->fallbackDirsPsr0 = (array) $paths;
|
||||||
|
} else {
|
||||||
|
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-4 directories for a given namespace,
|
||||||
|
* replacing any others previously set for this namespace.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
|
* @param array|string $paths The PSR-4 base directories
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*/
|
||||||
|
public function setPsr4($prefix, $paths)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
$this->fallbackDirsPsr4 = (array) $paths;
|
||||||
|
} else {
|
||||||
|
$length = strlen($prefix);
|
||||||
|
if ('\\' !== $prefix[$length - 1]) {
|
||||||
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
|
}
|
||||||
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
|
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns on searching the include path for class files.
|
||||||
|
*
|
||||||
|
* @param bool $useIncludePath
|
||||||
|
*/
|
||||||
|
public function setUseIncludePath($useIncludePath)
|
||||||
|
{
|
||||||
|
$this->useIncludePath = $useIncludePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can be used to check if the autoloader uses the include path to check
|
||||||
|
* for classes.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getUseIncludePath()
|
||||||
|
{
|
||||||
|
return $this->useIncludePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns off searching the prefix and fallback directories for classes
|
||||||
|
* that have not been registered with the class map.
|
||||||
|
*
|
||||||
|
* @param bool $classMapAuthoritative
|
||||||
|
*/
|
||||||
|
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||||
|
{
|
||||||
|
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should class lookup fail if not found in the current class map?
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isClassMapAuthoritative()
|
||||||
|
{
|
||||||
|
return $this->classMapAuthoritative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||||
|
*
|
||||||
|
* @param string|null $apcuPrefix
|
||||||
|
*/
|
||||||
|
public function setApcuPrefix($apcuPrefix)
|
||||||
|
{
|
||||||
|
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getApcuPrefix()
|
||||||
|
{
|
||||||
|
return $this->apcuPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers this instance as an autoloader.
|
||||||
|
*
|
||||||
|
* @param bool $prepend Whether to prepend the autoloader or not
|
||||||
|
*/
|
||||||
|
public function register($prepend = false)
|
||||||
|
{
|
||||||
|
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unregisters this instance as an autoloader.
|
||||||
|
*/
|
||||||
|
public function unregister()
|
||||||
|
{
|
||||||
|
spl_autoload_unregister(array($this, 'loadClass'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the given class or interface.
|
||||||
|
*
|
||||||
|
* @param string $class The name of the class
|
||||||
|
* @return bool|null True if loaded, null otherwise
|
||||||
|
*/
|
||||||
|
public function loadClass($class)
|
||||||
|
{
|
||||||
|
if ($file = $this->findFile($class)) {
|
||||||
|
includeFile($file);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the path to the file where the class is defined.
|
||||||
|
*
|
||||||
|
* @param string $class The name of the class
|
||||||
|
*
|
||||||
|
* @return string|false The path if found, false otherwise
|
||||||
|
*/
|
||||||
|
public function findFile($class)
|
||||||
|
{
|
||||||
|
// class map lookup
|
||||||
|
if (isset($this->classMap[$class])) {
|
||||||
|
return $this->classMap[$class];
|
||||||
|
}
|
||||||
|
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (null !== $this->apcuPrefix) {
|
||||||
|
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||||
|
if ($hit) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$file = $this->findFileWithExtension($class, '.php');
|
||||||
|
|
||||||
|
// Search for Hack files if we are running on HHVM
|
||||||
|
if (false === $file && defined('HHVM_VERSION')) {
|
||||||
|
$file = $this->findFileWithExtension($class, '.hh');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $this->apcuPrefix) {
|
||||||
|
apcu_add($this->apcuPrefix.$class, $file);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false === $file) {
|
||||||
|
// Remember that this class does not exist.
|
||||||
|
$this->missingClasses[$class] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function findFileWithExtension($class, $ext)
|
||||||
|
{
|
||||||
|
// PSR-4 lookup
|
||||||
|
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||||
|
|
||||||
|
$first = $class[0];
|
||||||
|
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||||
|
$subPath = $class;
|
||||||
|
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||||
|
$subPath = substr($subPath, 0, $lastPos);
|
||||||
|
$search = $subPath . '\\';
|
||||||
|
if (isset($this->prefixDirsPsr4[$search])) {
|
||||||
|
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||||
|
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||||
|
if (file_exists($file = $dir . $pathEnd)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-4 fallback dirs
|
||||||
|
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 lookup
|
||||||
|
if (false !== $pos = strrpos($class, '\\')) {
|
||||||
|
// namespaced class name
|
||||||
|
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||||
|
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||||
|
} else {
|
||||||
|
// PEAR-like class name
|
||||||
|
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->prefixesPsr0[$first])) {
|
||||||
|
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||||
|
if (0 === strpos($class, $prefix)) {
|
||||||
|
foreach ($dirs as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 fallback dirs
|
||||||
|
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 include paths.
|
||||||
|
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope isolated include.
|
||||||
|
*
|
||||||
|
* Prevents access to $this/self from included files.
|
||||||
|
*/
|
||||||
|
function includeFile($file)
|
||||||
|
{
|
||||||
|
include $file;
|
||||||
|
}
|
||||||
21
core/api/Qcos/vendor/composer/LICENSE
vendored
Normal file
21
core/api/Qcos/vendor/composer/LICENSE
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
9
core/api/Qcos/vendor/composer/autoload_classmap.php
vendored
Normal file
9
core/api/Qcos/vendor/composer/autoload_classmap.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_classmap.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
);
|
||||||
13
core/api/Qcos/vendor/composer/autoload_files.php
vendored
Normal file
13
core/api/Qcos/vendor/composer/autoload_files.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_files.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||||
|
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
|
||||||
|
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
|
||||||
|
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||||
|
);
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user