mirror of
https://gh.wpcy.net/https://github.com/netcccyun/easypanel.git
synced 2026-04-23 03:52:25 +08:00
31 lines
No EOL
571 B
PHP
31 lines
No EOL
571 B
PHP
<?php
|
|
class CrontabAPI extends API
|
|
{
|
|
/**
|
|
* 每日运行
|
|
*/
|
|
public function runDay()
|
|
{
|
|
daocall('vhost', 'expireUser');
|
|
$nodes = daocall('nodes', 'listNodes');
|
|
$i = 0;
|
|
|
|
while ($i < count($nodes)) {
|
|
$this->reloadNode($nodes[$i]);
|
|
++$i;
|
|
}
|
|
}
|
|
|
|
public function runHour()
|
|
{
|
|
}
|
|
|
|
private function reloadNode($node)
|
|
{
|
|
$whm = apicall('nodes', 'makeWhm2', array($node['host'], $node['port'], $node['user'], $node['passwd']));
|
|
$whmCall = new WhmCall('core.whm', 'reload_all_vh');
|
|
return $whm->call($whmCall, 10);
|
|
}
|
|
}
|
|
|
|
?>
|