コード例 #1
0
 public function bukaPintu()
 {
     try {
         $dbAuth = new ModelAuth();
         $id_auth = $dbAuth->getIdAuthByToken($this->app->request()->headers->get('API-Token'));
         $this->sendTrigger($id_auth, 1);
         sleep(5);
         $this->sendTrigger($id_auth, 0);
     } catch (\Exception $ex) {
         $this->writeToJSON(['errmsg' => 'service unavailable'], 503);
     }
 }