/** * @see WOTAPIAction::readParameters() */ public function readParameters() { parent::readParameters(); $this->userID = intval($this->data['userid']); $this->username = WOTAPIUtil::escape($this->data['username']); $this->email = WOTAPIUtil::escape($this->data['username']); }
/** * Sends the output and closes the connection. * * @param string message * @param int state * @param array data */ public function send($message = 'OK', $state = 100, $data = array()) { $output = ""; $output .= $this->crypter->encryptToText("STATE: " . WOTAPIUtil::escape($state)) . "\n"; $output .= $this->crypter->encryptToText("MESSAGE: " . WOTAPIUtil::escape($message)) . "\n"; foreach ($data as $name => $date) { $output .= $this->crypter->encryptToText("DATA_" . StringUtil::toUpperCase($name) . ":" . WOTAPIUtil::escape($date)) . "\n"; echo $this->crypter->encryptToText("DATA_" . StringUtil::toUpperCase($name) . ":" . WOTAPIUtil::escape($date)) . "\n"; } $output .= "\n"; $this->write($output); echo $output; //echo $this->read_buffer; flush(); if ($this->connection == 'Close') { // write() will close for us echo 'closed'; } }
/** * Sends the output and closes the connection. * * @param string message * @param int state * @param array data */ public function send($message = 'OK', $state = 100, $data = array()) { $output = ""; foreach ($data as $name => $date) { $output .= "DATA_" . StringUtil::toUpperCase($name) . ":" . WOTAPIUtil::escape($date) . "\n"; } $output .= "STATE: " . WOTAPIUtil::escape($state) . "\n"; $output .= "MESSAGE: " . WOTAPIUtil::escape($message) . "\n"; $output .= "\n"; $this->write($output); echo $output; //echo $this->read_buffer; flush(); if ($this->connection == 'Close') { // close connection /*$this->close(); $this->disconnected = true; $this->socket = intval($this->socket); // execute event handler $this->onDisconnect();*/ echo 'closed'; } }
/** * @see WOTAPIAction::readParameters() */ public function readParameters() { parent::readParameters(); $this->userIDsStr = WOTAPIUtil::escape($this->data['useridsstr']); }