-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscraper.php
More file actions
executable file
·30 lines (30 loc) · 892 Bytes
/
scraper.php
File metadata and controls
executable file
·30 lines (30 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
if (PHP_SAPI !== 'cli') { die(); }
set_time_limit(0);
ini_set('memory_limit', '1024M');
require_once('config.php');
require_once('fontFile.php');
function LogStr(string $message, int $status = 0) {
$logType = ($status === -1 ? '错误' : '信息');
$date = date('Y-m-d');
$time = date('H:i:s');
$logStr = "[{$date} {$time}][{$logType}] {$message}.\n";
echo $logStr;
}
if (!is_dir('font_import')) {
LogStr('找不到 font_import 目录', -1);
die();
}
$fontfiles = GetAllFontsFilename('font_import');
foreach ($fontfiles as $fontfile) {
gc_collect_cycles();
$fontPath = $fontfile->getPathname();
list($addFontErr, $addFontMsg, $addFontAdditionMsgList) = AddFontFile($fontPath, true);
foreach ($addFontAdditionMsgList as $addFontAdditionMsg) {
LogStr($addFontAdditionMsg[1], $addFontAdditionMsg[0]);
}
if (!empty($addFontMsg)) {
LogStr($addFontMsg, $addFontErr);
}
}
?>