style(web/app/controllers): subfolder move command as a single line

8 lines are too much. Why not make it into one line?
This commit is contained in:
Masco Skray 2019-07-10 10:58:15 +08:00
parent a522d58f1d
commit 50f26075ac

View File

@ -58,14 +58,7 @@
if ($zip->open($up_filename) === TRUE){ if ($zip->open($up_filename) === TRUE){
$zip->extractTo("/var/uoj_data/upload/{$problem['id']}"); $zip->extractTo("/var/uoj_data/upload/{$problem['id']}");
$zip->close(); $zip->close();
exec( exec("cd /var/uoj_data/upload/{$problem['id']}; for sub_dir in `find -maxdepth 1 -type d ! -name .`; do mv -f \$sub_dir/* . && rm -rf \$sub_dir; done");
<<<EOD
cd /var/uoj_data/upload/$problem['id']
for sub_dir in `find -maxdepth 1 -type d ! -name .`; do
mv -f \$sub_dir/* . && rm -rf \$sub_dir
done
EOD
);
echo "<script>alert('上传成功!')</script>"; echo "<script>alert('上传成功!')</script>";
}else{ }else{
$errmsg = "解压失败!"; $errmsg = "解压失败!";