/** * Sends a raw command to the irc server * * @param string $data String to send * @param integer $silent Not implemented yet * @param integer $priority Not implemented yet * * @return void */ public function raw($data, $silent = 0, $priority = 3) { if (SERVICE) { $extra = $this->parseCommand($data); if (in_array($extra['func'], array('JOIN', 'PART', 'QUIT', 'NICK', 'MODE', 'SERVER'))) { $str = ''; foreach ($extra as $k => $v) { if (is_array($v)) { $str .= "[{$k}:{ "; foreach ($v as $kk => $vv) { $str .= "[{$kk}:{$vv}] "; } $str .= "}] "; } else { if (!empty($v)) { $str .= "[{$k}:{$v}] "; } } } logWrite(L_DEBUG, '[DEBUG:REPLAY] ' . $str); $this->users->ircraw($this, $data, $extra); } } $this->socket->put($data . "\r\n"); logWrite(L_DEBUG, '>> ' . $data); return true; }
/** * This function will upload a file to the ftp-server. * * @access public * @param string $local_file The local file to upload * @param string $remote_file The absolute or relative path to the file to upload to * @param bool $overwrite (optional) Whether to overwrite existing file * @param int $mode (optional) Either FTP_ASCII or FTP_BINARY * @return mixed True on success, otherwise Jaws_Error */ function put($local_file, $remote_file, $overwrite = false, $mode = null) { $res = $this->_ftp->put($local_file, $remote_file, $overwrite, $mode); if (PEAR::isError($res)) { return new Jaws_Error($res->getMessage(), __FUNCTION__); } return true; }
/** * @param string $remoteFile * @param string $localFile * @param int $startPos * * @return bool */ public function put($remoteFile, $localFile, $startPos = -1) { switch ($this->_connType) { case SftpHelper::TYPE_SFTP: default: $res = $this->_connection->put($remoteFile, $localFile, NET_SFTP_LOCAL_FILE, $startPos); break; case SftpHelper::TYPE_FTP: $startPos = $startPos === -1 ? 0 : $startPos; $res = @ftp_put($this->_connection, $remoteFile, $localFile, FTP_BINARY, $startPos); break; } return $res; }
/** * Sets version hash on the server. */ public function setRevision() { // By default we update the revision file to the local revision, // unless the sync command was called with a specific revision $localRevision = $this->currentRevision(); if ($this->sync && $this->sync != 'sync') { $localRevision = $this->sync; } $consoleMessage = "Updating remote revision file to " . $localRevision; if ($this->sync) { $this->output("\r\n<yellow>SYNC: {$consoleMessage}"); } else { $this->debug($consoleMessage); } try { $this->connection->put($localRevision, $this->dotRevision); } catch (\Exception $e) { throw new \Exception("Could not update the revision file on server: {$e->getMessage}()"); } }