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


PHP TeamSpeak3_Helper_String::section方法代碼示例

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


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

示例1: fetchError

 /**
  * Parses a ServerQuery error and returns a TeamSpeak3_Adapter_ServerQuery_Exception object.
  *
  * @param  string $err
  * @throws TeamSpeak3_Adapter_ServerQuery_Exception
  * @return void
  */
 private function fetchError($err)
 {
     $cells = $err->section(TeamSpeak3::SEPERATOR_CELL, 1, 3);
     foreach ($cells->split(TeamSpeak3::SEPERATOR_CELL) as $pair) {
         list($ident, $value) = $pair->split(TeamSpeak3::SEPERATOR_PAIR);
         $this->err[$ident->toString()] = $value->is_numeric() ? $value->toInt() : $value->unescape();
     }
     if ($this->getErrorProperty("id", 0x0) != 0x0) {
         if ($permid = $this->getErrorProperty("failed_permid")) {
             $suffix = " (failed on " . $this->cmd->section(TeamSpeak3::SEPERATOR_CELL) . " " . $permid . "/0x" . strtoupper(dechex($permid)) . ")";
         } elseif ($details = $this->getErrorProperty("extra_msg")) {
             $suffix = " (" . $details . ")";
         } else {
             $suffix = "";
         }
         throw new TeamSpeak3_Adapter_ServerQuery_Exception($this->getErrorProperty("msg") . $suffix, $this->getErrorProperty("id"));
     }
 }
開發者ID:ECP-Black,項目名稱:ECP,代碼行數:25,代碼來源:Reply.php

示例2: fetchError

 /**
  * Parses a ServerQuery error and throws a TeamSpeak3_Adapter_ServerQuery_Exception object if
  * there's an error.
  *
  * @param  string $err
  * @throws TeamSpeak3_Adapter_ServerQuery_Exception
  * @return void
  */
 protected function fetchError($err)
 {
     $cells = $err->section(TeamSpeak3::SEPARATOR_CELL, 1, 3);
     foreach ($cells->split(TeamSpeak3::SEPARATOR_CELL) as $pair) {
         list($ident, $value) = $pair->split(TeamSpeak3::SEPARATOR_PAIR);
         $this->err[$ident->toString()] = $value->isInt() ? $value->toInt() : $value->unescape();
     }
     TeamSpeak3_Helper_Signal::getInstance()->emit("notifyError", $this);
     if ($this->getErrorProperty("id", 0x0) != 0x0 && $this->exp) {
         if ($permid = $this->getErrorProperty("failed_permid")) {
             if ($permsid = key($this->con->request("permget permid=" . $permid, FALSE)->toAssocArray("permsid"))) {
                 $suffix = " (failed on " . $permsid . ")";
             } else {
                 $suffix = " (failed on " . $this->cmd->section(TeamSpeak3::SEPARATOR_CELL) . " " . $permid . "/0x" . strtoupper(dechex($permid)) . ")";
             }
         } elseif ($details = $this->getErrorProperty("extra_msg")) {
             $suffix = " (" . trim($details) . ")";
         } else {
             $suffix = "";
         }
         throw new TeamSpeak3_Adapter_ServerQuery_Exception($this->getErrorProperty("msg") . $suffix, $this->getErrorProperty("id"));
     }
 }
開發者ID:fyfywka,項目名稱:ts3phpframework,代碼行數:31,代碼來源:Reply.php

示例3: versionShort

 /**
  * Returns a client-like short-formatted version of the TeamSpeak 3 version string.
  *
  * @param  string $version
  * @return string
  */
 public static function versionShort($version)
 {
     if (!$version instanceof TeamSpeak3_Helper_String) {
         $version = new TeamSpeak3_Helper_String($version);
     }
     return $version->section(" ", 0);
 }
開發者ID:fyfywka,項目名稱:ts3phpframework,代碼行數:13,代碼來源:Convert.php

示例4: version

 /**
  * Returns a client-like formatted version of the TeamSpeak 3 version string.
  *
  * @param  string $version
  * @param  string $format
  * @return string
  */
 public static function version($version, $format = "Y-m-d h:i:s")
 {
     if (!$version instanceof TeamSpeak3_Helper_String) {
         $version = new TeamSpeak3_Helper_String($version);
     }
     $buildno = $version->section("[", 1)->filterDigits()->toInt();
     return $buildno <= 15001 ? $version : $version->section("[")->append("(" . date($format, $buildno) . ")");
 }
開發者ID:OlivierLamiraux,項目名稱:mtgas,代碼行數:15,代碼來源:Convert.php


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