本文整理汇总了PHP中resource::put方法的典型用法代码示例。如果您正苦于以下问题:PHP resource::put方法的具体用法?PHP resource::put怎么用?PHP resource::put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resource
的用法示例。
在下文中一共展示了resource::put方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: raw
/**
* 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;
}
示例2: put
/**
* 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;
}
示例3: put
/**
* @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;
}
示例4: setRevision
/**
* 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}()");
}
}