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


PHP resource::send方法代碼示例

本文整理匯總了PHP中resource::send方法的典型用法代碼示例。如果您正苦於以下問題:PHP resource::send方法的具體用法?PHP resource::send怎麽用?PHP resource::send使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在resource的用法示例。


在下文中一共展示了resource::send方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: exec

 /**
  * Execute command
  * 
  * @return \LWMail\Protocol (this)
  */
 protected final function exec()
 {
     $this->data = array();
     $this->raw_data = array();
     $this->has_error = false;
     foreach ($this->command_stack as $name => $data) {
         $result = "";
         $response = "";
         $commands = $data['commands'];
         $eof = $data['eof'];
         if (!is_array($commands) || empty($commands)) {
             continue;
         }
         $eol = $this->getOption('eol', "\r\n");
         if ($result = $this->stream->send(join($eol, $commands) . $eol)) {
             $result = $this->stream->getline($response, $eof);
         }
         $this->has_error = !$result || $this->has_error;
         $this->raw_data[$name] = $response;
         $method = "parse" . join('', array_map('ucfirst', explode('_', strtolower($name))));
         if (method_exists($this, $method)) {
             $result = $this->{$method}($response, $this->data[$name]);
             $this->has_error = !$result || $this->has_error;
         }
     }
     $this->command_stack = array();
     return $this;
 }
開發者ID:simpraight,項目名稱:lwmail,代碼行數:33,代碼來源:Protocol.php

示例2: sendData

 /**
  * 發送數據給服務端
  * 
  * @param string $method        	
  * @param array $arguments        	
  */
 public function sendData($method, $arguments)
 {
     $bin_data = JsonProtocol::encode(array('class' => $this->serviceName, 'method' => $method, 'param_array' => $arguments)) . "\r\n";
     $this->openConnection();
     if (self::$useSwoole) {
         return $this->swooleClient->send($bin_data);
     } else {
         return fwrite($this->connection, $bin_data) == strlen($bin_data);
     }
 }
開發者ID:stonegithubs,項目名稱:swoole-JsonRPC,代碼行數:16,代碼來源:RpcClient.php

示例3: strtolower

 /**
  * Check that the file hasn't already been seen
  * @param array $info The music files tag data
  * @return boolean
  */
 function duplicate_check($info)
 {
     $query = strtolower($info['artist'] . '/' . $info['album'] . '/' . $info['title']);
     if (in_array($query, $this->musicDuplicates)) {
         $this->Output->send('  %5- Duplicate Song File%n');
         return TRUE;
     } else {
         $this->musicDuplicates[] = $query;
         return FALSE;
     }
 }
開發者ID:jiminald,項目名稱:PHP-Multimedia-Sorter,代碼行數:16,代碼來源:music.php

示例4: explode

 /**
  * Create folders recursively
  * @param string $finalFolder The files destined location
  * @param string $niceFolderName The string to remove to shorten the folder name when sent to screen
  * @return string
  */
 function recursive_mkDir($finalFolder, $niceFolderName = '')
 {
     //Create the new folders if and where required
     $finalFolder = str_replace($this->illegalChars, '', $finalFolder);
     $finalFolder = explode('/', substr($finalFolder, 0, strrpos($finalFolder, '/')));
     $appendFolder = '';
     foreach ($finalFolder as $folder) {
         $mkDir = $appendFolder . $folder;
         if ($mkDir != '' && file_exists($mkDir) == FALSE) {
             mkdir($mkDir);
             $this->Output->send('%3Making folder: ' . str_replace($niceFolderName, '', $mkDir) . '%n');
         }
         $appendFolder .= $folder . '/';
     }
     return $appendFolder;
 }
開發者ID:jiminald,項目名稱:PHP-Multimedia-Sorter,代碼行數:22,代碼來源:fileManager.php

示例5: disconnect

 /**
  * Desconnects from SMSC/SMS gateway gracefully
  * @access public
  * @return boolean Always TRUE
  */
 public function disconnect()
 {
     if ($this->state == ESS_BIND_TX || $this->state == ESS_BIND_RX) {
         l('ESME sending UNBIND command...');
         $this->sock->send($this->form_pdu(UNBIND));
         $pdu = $this->sock->pdu_wait_for(UNBIND | ACK, $this->sqn);
         $res = $this->parse_pdu_header(substr($pdu, 0, 16));
         if ($res['stat'] !== 0) {
             l('UNBIND failed: ' . $res['stat'] . '.', L_WARN);
         } else {
             l('UNBIND done.');
         }
     }
     $this->state = ESS_DISCONNECTED;
     $this->sock->disconnect();
     return true;
 }
開發者ID:prayas-sapkota,項目名稱:phpesme,代碼行數:22,代碼來源:nimf_esme.php

示例6: log

 /**
  * Logs the current command
  *
  * @access  public
  * @param   resource $rpc_conn The connection resource
  * @param   array $auth Array of authentication information (email, password)
  * @param   string $command The command used to run this script.
  */
 function log($rpc_conn, $auth, $command)
 {
     $command = base64_encode($command);
     $msg = new XML_RPC_Message("logCommand", array(new XML_RPC_Value($auth[0], 'string'), new XML_RPC_Value($auth[1], 'string'), new XML_RPC_Value($command, 'string')));
     $result = $rpc_conn->send($msg);
     if ($result->faultCode()) {
         Command_Line::quit($result->faultString());
     }
 }
開發者ID:juliogallardo1326,項目名稱:proc,代碼行數:17,代碼來源:class.command_line.php


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