-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtool.php
More file actions
25 lines (23 loc) · 929 Bytes
/
tool.php
File metadata and controls
25 lines (23 loc) · 929 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
<?php
// +----------------------------------------------------------------------
// | Constructed by Jokin [ Think & Do & To Be Better ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2019 Jokin All rights reserved.
// +----------------------------------------------------------------------
// | Author: Jokin <Jokin@twocola.com>
// +----------------------------------------------------------------------
// Initialize
define('TPL_SUFFIX', '.tpl');
define('PAGE_SUFFIX', '.html');
date_default_timezone_set('Asia/Shanghai');
$index_path = './tpl/index' . TPL_SUFFIX;
generate($index_path);
// Generate Page
function generate($path) {
$file = file_get_contents($path);
$update_time = date('Y-m-d H:i');
$file = str_replace('__UPDATE_TIME__', $update_time, $file);
$filename = basename($path, TPL_SUFFIX) . PAGE_SUFFIX;
file_put_contents('./'.$filename, $file);
}
?>