original_string: private function create_token($token) {
          global $CFG;
  
          if (!$this->is_system_configured()) {
              return false;
          }
  
          require_once($CFG->libdir . '/filelib.php');
  
          $serverurl = $CFG->airnotifierurl . ':' . $CFG->airnotifierport . '/tokens/' . $token;
          $header = array('Accept: application/json', 'X-AN-APP-NAME: ' . $CFG->airnotifierappname,
              'X-AN-APP-KEY: ' . $CFG->airnotifieraccesskey);
          $curl = new curl;
          $curl->setHeader($header);
          $params = array();
          $resp = $curl->post($serverurl, $params);
  
          if ($token = json_decode($resp, true)) {
              if (!empty($token['status'])) {
                  return $token['status'] == 'ok' || $token['status'] == 'token exists';
              }
          }
          debugging("Unexpected response from the Airnotifier server: $resp");
          return false;
      }
code: private function create_token($token) {
          global $CFG;
  
          if (!$this->is_system_configured()) {
              return false;
          }
  
          require_once($CFG->libdir . '/filelib.php');
  
          $serverurl = $CFG->airnotifierurl . ':' . $CFG->airnotifierport . '/tokens/' . $token;
          $header = array('Accept: application/json', 'X-AN-APP-NAME: ' . $CFG->airnotifierappname,
              'X-AN-APP-KEY: ' . $CFG->airnotifieraccesskey);
          $curl = new curl;
          $curl->setHeader($header);
          $params = array();
          $resp = $curl->post($serverurl, $params);
  
          if ($token = json_decode($resp, true)) {
              if (!empty($token['status'])) {
                  return $token['status'] == 'ok' || $token['status'] == 'token exists';
              }
          }
          debugging("Unexpected response from the Airnotifier server: $resp");
          return false;
      }
code_tokens: private function create_token ( $ token ) { global $ CFG ; if ( ! $ this -> is_system_configured ( ) ) { return false ; } require_once ( $ CFG -> libdir . '/filelib.php' ) ; $ serverurl = $ CFG -> airnotifierurl . ':' . $ CFG -> airnotifierport . '/tokens/' . $ token ; $ header = array ( 'Accept: application/json' , 'X-AN-APP-NAME: ' . $ CFG -> airnotifierappname , 'X-AN-APP-KEY: ' . $ CFG -> airnotifieraccesskey ) ; $ curl = new curl ; $ curl -> setHeader ( $ header ) ; $ params = array ( ) ; $ resp = $ curl -> post ( $ serverurl , $ params ) ; if ( $ token = json_decode ( $ resp , true ) ) { if ( ! empty ( $ token [ 'status' ] ) ) { return $ token [ 'status' ] == 'ok' || $ token [ 'status' ] == 'token exists' ; } } debugging ( "Unexpected response from the Airnotifier server: $resp" ) ; return false ; }
docstring: Create a device token in the Airnotifier instance
  @param string $token The token to be created
  @return bool True if all was right
docstring_tokens: Create a device token in the Airnotifier instance