mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
add cli force
This commit is contained in:
@@ -15,8 +15,13 @@ register_shutdown_function(function () use ($fd) {
|
|||||||
fclose($fd);
|
fclose($fd);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$force = 0;
|
||||||
|
if (isset($_SERVER['argv'][1])) {
|
||||||
|
$force = $_SERVER['argv'][1] ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = autoclean();
|
$result = autoclean($force, true);
|
||||||
do_log("[CLEANUP_CLI DONE!] $result");
|
do_log("[CLEANUP_CLI DONE!] $result");
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
do_log("ERROR: " . $exception->getMessage());
|
do_log("ERROR: " . $exception->getMessage());
|
||||||
|
|||||||
@@ -1898,7 +1898,7 @@ function userlogin() {
|
|||||||
return $loginResult = true;
|
return $loginResult = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoclean() {
|
function autoclean($forceAll = 0, $printProgress = false) {
|
||||||
global $autoclean_interval_one, $rootpath;
|
global $autoclean_interval_one, $rootpath;
|
||||||
$now = TIMENOW;
|
$now = TIMENOW;
|
||||||
$res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime'");
|
$res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime'");
|
||||||
@@ -1919,7 +1919,7 @@ function autoclean() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
require_once($rootpath . 'include/cleanup.php');
|
require_once($rootpath . 'include/cleanup.php');
|
||||||
return docleanup();
|
return docleanup($forceAll, $printProgress);
|
||||||
}
|
}
|
||||||
|
|
||||||
function unesc($x) {
|
function unesc($x) {
|
||||||
|
|||||||
Reference in New Issue
Block a user