Browse Source

生成系统文件列表

tags/6.2.12
tianya 10 months ago
parent
commit
a8fd41dca7
2 changed files with 21 additions and 0 deletions
  1. +20
    -0
      dedebiz
  2. +1
    -0
      src/data/admin/files.txt

+ 20
- 0
dedebiz View File

@@ -505,6 +505,26 @@ if (count($argv) > 1 && ($argv[1] == "serv" || $argv[1] == "s")) {
$query = "UPDATE `#@__member` SET $pwdm WHERE mid='$id'";
$dsql->ExecuteNoneQuery($query);
DedeCli::write("成功修改密码");
} else if(count($argv) > 1 && ($argv[1] =="make_filehash")){
$gitFiles = shell_exec('git ls-files');
// 将输出的字符串按行拆分成数组
$fileList = explode("\n", trim($gitFiles));
// 输出文件列表
$hashs = array();
foreach ($fileList as $file) {
if (!file_exists($file)) {
continue;
}
$name = $file;
$size = filesize($file);
$hash = md5_file($file);
$f = array(
"filename" => $name,
);
$hashs[] = $f;
}
file_put_contents(DEDEDATA.'/admin/files.txt',json_encode($hashs));
DedeCli::write("成功生成文件哈希");
} else {
DedeCli::write($helpStr);
}

+ 1
- 0
src/data/admin/files.txt
File diff suppressed because it is too large
View File


Loading…
Cancel
Save