當前位置: 首頁>>代碼示例>>PHP>>正文


PHP resource::put方法代碼示例

本文整理匯總了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;
 }
開發者ID:bonan,項目名稱:neotor,代碼行數:36,代碼來源:irc.php

示例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;
 }
開發者ID:uda,項目名稱:jaws,代碼行數:18,代碼來源:FTP.php

示例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;
 }
開發者ID:giovdk21,項目名稱:deployii,代碼行數:21,代碼來源:SftpHelper.php

示例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}()");
     }
 }
開發者ID:baoweber,項目名稱:PHPloy,代碼行數:23,代碼來源:PHPloy.php


注:本文中的resource::put方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。