Ejemplo n.º 1
0
 /**
  * (Web service method) Notify WordPress that the bot is online.
  * @param  mixed[] $args an empty array
  * @return mixed[] status; error_message
  */
 private function web_checkin($args)
 {
     $state = State::get_instance();
     $state->last_checkin_utc = gmmktime();
     $state->save();
     return array('status' => 'ok', 'error_message' => '');
 }
Ejemplo n.º 2
0
 /**
  * Check schema version and upgrade if necessary
  */
 public function __construct()
 {
     $state = State::get_instance();
     if ($state->db_version == '' || $state->db_version < DB_VERSION) {
         self::update_schema();
         $state->db_version = DB_VERSION;
         $state->save();
     }
 }