/** * undocumented function * * @return void * @author **/ public static function initsequence() { $date = date("Y-m-d H:i:s"); $server = new Server(); $id = $server->cron($date); $load = new Load(); $load->cron($id, Sensor::restLoad(), $date); $load->stor($id, Sensor::restLoad(), $date, 'stor_load'); }
public function cron($date) { $ip = $_SERVER['SERVER_ADDR']; $name = $_SERVER['SERVER_NAME']; $server = Server::where('server_ip', '=', $ip)->first(array('server_id')); if (empty($server)) { $server = new Server(); $server->server_name = $name; $server->server_ip = $ip; $server->server_date = $date; $server->save(); } else { $server = $server->server_id; } return $server; }