当前位置: 首页>>代码示例>>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;未经允许,请勿转载。