Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwsswl
OneManager-php
提交
1bee94cf
O
OneManager-php
项目概览
lwsswl
/
OneManager-php
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OneManager-php
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
1bee94cf
编写于
8月 21, 2020
作者:
Q
qkqpttgf
提交者:
GitHub
8月 21, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
define error message
上级
f57ddf02
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
9 deletion
+17
-9
platform/Normal.php
platform/Normal.php
+17
-9
未找到文件。
platform/Normal.php
浏览文件 @
1bee94cf
...
...
@@ -112,7 +112,9 @@ function setConfig($arr, $disktag = '')
//echo '<pre>'. json_encode($envs, JSON_PRETTY_PRINT).'</pre>';
$prestr
=
'<?php $configs = \''
.
PHP_EOL
;
$aftstr
=
PHP_EOL
.
'\';'
;
return
file_put_contents
(
'config.php'
,
$prestr
.
json_encode
(
$envs
,
JSON_PRETTY_PRINT
)
.
$aftstr
);
$response
=
file_put_contents
(
'config.php'
,
$prestr
.
json_encode
(
$envs
,
JSON_PRETTY_PRINT
)
.
$aftstr
);
if
(
$response
>
0
)
return
json_encode
(
[
'response'
=>
'success'
]
);
return
json_encode
(
[
'message'
=>
'Failed to write config.'
,
'code'
=>
'failed'
]
);
}
function
install
()
...
...
@@ -123,7 +125,7 @@ function install()
$tmp
[
'admin'
]
=
$_POST
[
'admin'
];
//$tmp['language'] = $_COOKIE['language'];
$tmp
[
'timezone'
]
=
$_COOKIE
[
'timezone'
];
$response
=
setConfig
(
$tmp
);
$response
=
setConfig
Response
(
setConfig
(
$tmp
)
);
if
(
api_error
(
$response
))
{
$html
=
api_error_msg
(
$response
);
$title
=
'Error'
;
...
...
@@ -253,19 +255,19 @@ function RewriteEngineOn()
function
api_error
(
$response
)
{
return
!
$response
;
return
isset
(
$response
[
'message'
])
;
}
function
api_error_msg
(
$response
)
{
return
$response
.
'<br>
Can not write config to file.
<br>
return
$response
[
'code'
]
.
'<br>
'
.
$response
[
'message'
]
.
'
<br>
<button onclick="location.href = location.href;">'
.
getconstStr
(
'Refresh'
)
.
'</button>'
;
}
function
setConfigResponse
(
$response
)
{
return
$response
;
return
json_decode
(
$response
,
true
)
;
}
function
OnekeyUpate
(
$auth
=
'qkqpttgf'
,
$project
=
'OneManager-php'
,
$branch
=
'master'
)
...
...
@@ -318,15 +320,21 @@ function moveFolder($from, $to)
$fromfile
=
$from
.
'/'
.
$filename
;
$tofile
=
$to
.
'/'
.
$filename
;
if
(
is_dir
(
$fromfile
)){
// 如果读取的某个对象是文件夹,则递归
moveFolder
(
$fromfile
,
$tofile
);
$response
=
moveFolder
(
$fromfile
,
$tofile
);
if
(
api_error
(
setConfigResponse
(
$response
)))
return
$response
;
}
else
{
//if (file_exists($tofile)) unlink($tofile);
rename
(
$fromfile
,
$tofile
);
$response
=
rename
(
$fromfile
,
$tofile
);
if
(
!
$response
)
{
$tmp
[
'code'
]
=
"Move Failed"
;
$tmp
[
'message'
]
=
"Can not move "
.
$fromfile
.
" to "
.
$tofile
;
return
json_encode
(
$tmp
);
}
if
(
file_exists
(
$fromfile
))
unlink
(
$fromfile
);
}
}
}
closedir
(
$handler
);
rmdir
(
$from
);
return
1
;
return
json_encode
(
[
'response'
=>
'success'
]
)
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录