f ?: '/home/prod_xxx/h5.zip'; if (!file_exists($f)) { echo '文件不存在' . PHP_EOL; exit; } $tmpDir = UpgradeService::getH5TmpDir(); UpgradeService::unzip($f, $tmpDir); // 如果解压后是有多一层h5,则将里面的东西移到上一层 $h5Dir = $tmpDir . 'h5'; if (is_dir($h5Dir)) { exec("mv $h5Dir/* $tmpDir/"); exec("rm -rf $h5Dir"); } UpgradeService::handleH5(); $workDir = UpgradeService::getWorkDir(); exec(sprintf("chown nobody:nobody %sh5", $workDir)); exec(sprintf("rm -rf %sh5_tmp", $workDir)); $this->r && @unlink($f); } }