代码拉取完成,页面将自动刷新
同步操作将从 baobeihuaidan/ecshop大商创商城 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
//源码由旺旺:ecshop2012所有 未经允许禁止倒卖 一经发现停止任何服务
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
require dirname(__FILE__) . '/plugins/aliyunoss/autoload.php';
include 'includes/cls_json.php';
$json = new JSON();
$res = array('err_msg' => '', 'err_no' => 0, 'result' => '');
$rootPath = ROOT_PATH;
$act = (isset($_REQUEST['act']) ? addslashes_deep($_REQUEST['act']) : 'upload');
$bucket = (isset($_REQUEST['bucket']) ? addslashes_deep($_REQUEST['bucket']) : '');
$keyid = (isset($_REQUEST['keyid']) ? addslashes_deep($_REQUEST['keyid']) : '');
$keysecret = (isset($_REQUEST['keysecret']) ? addslashes_deep($_REQUEST['keysecret']) : '');
$endpoint = (isset($_REQUEST['endpoint']) ? addslashes_deep($_REQUEST['endpoint']) : '');
$is_cname = (isset($_REQUEST['is_cname']) ? intval($_REQUEST['is_cname']) : 1);
$object = (isset($_REQUEST['object']) ? $_REQUEST['object'] : array());
$file = '';
$type = (isset($_REQUEST['type']) && !empty($_REQUEST['type']) ? intval($_REQUEST['type']) : 0);
if ($is_cname == 1) {
$is_cname = true;
}
else {
$is_cname = false;
}
$ossClient = new \OSS\OssClient($keyid, $keysecret, $endpoint, $is_cname);
if ($act == 'upload') {
if (is_array($object)) {
foreach ($object as $row) {
if ($row) {
$file = $rootPath . $row;
$objects = $row;
$ossClient->putObject($bucket, $objects, '{$row}');
$res_oss = $ossClient->uploadFile($bucket, $objects, $file);
if ($res_oss['is_ok'] && $type) {
dsc_unlink($file);
}
}
}
}
else {
$file = $rootPath . $object;
$ossClient->putObject($bucket, $object, '{$object}');
$res_oss = $ossClient->uploadFile($bucket, $object, $file);
if ($res_oss['is_ok'] && $type) {
dsc_unlink($file);
}
}
}
else if ($act == 'del_file') {
$ossClient->deleteObjects($bucket, $object);
}
else if ($act == 'list_file') {
$ossClient = new \OSS\OssClient($keyid, $keysecret, $endpoint, $is_cname);
$list = $ossClient->listObjects($bucket, $object);
$list = object_array($list);
$arr = array();
foreach ($list as $key => $row) {
if (is_array($row)) {
$key = str_replace(array('OSS\\Model\\ObjectListInfo', 'List'), '', $key);
foreach ($row as $kr => $krow) {
$row[$kr] = array_values($krow);
}
$arr[$key] = $row;
}
}
$res['list'] = $arr;
}
$res['object'] = $object;
$res['type'] = $type;
exit($json->encode($res));
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。