当前位置: 首页>>代码示例>>PHP>>正文


PHP UserAgentMatcher::tableSuffix方法代码示例

本文整理汇总了PHP中UserAgentMatcher::tableSuffix方法的典型用法代码示例。如果您正苦于以下问题:PHP UserAgentMatcher::tableSuffix方法的具体用法?PHP UserAgentMatcher::tableSuffix怎么用?PHP UserAgentMatcher::tableSuffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserAgentMatcher的用法示例。


在下文中一共展示了UserAgentMatcher::tableSuffix方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getDeviceFromUA_RIS

 public function getDeviceFromUA_RIS($userAgent, $tolerance, UserAgentMatcher &$matcher)
 {
     $this->numQueries++;
     $query = sprintf("CALL " . TeraWurflConfig::$TABLE_PREFIX . "_RIS(%s,%s,%s)", $this->SQLPrep($userAgent), $tolerance, $this->SQLPrep($matcher->tableSuffix()));
     $res = $this->dbcon->query($query);
     if (!$res) {
         throw new Exception(sprintf("Error in DB RIS Query: %s. \nQuery: %s\n", $this->dbcon->error, $query));
         exit;
     }
     $data = $res->fetch_assoc();
     $this->cleanConnection();
     $wurflid = $data['DeviceID'];
     return $wurflid == 'NULL' || is_null($wurflid) ? WurflConstants::$GENERIC : $wurflid;
 }
开发者ID:vuong93st,项目名称:w-game,代码行数:14,代码来源:TeraWurflDatabase_MySQL5.php

示例2: fullTableName

 public function fullTableName()
 {
     return TeraWurflConfig::$TABLE_PREFIX . '_' . $this->userAgentMatcher->tableSuffix();
 }
开发者ID:vuong93st,项目名称:w-game,代码行数:4,代码来源:TeraWurfl.php

示例3: getDeviceFromUA_RIS

 public function getDeviceFromUA_RIS($userAgent, $tolerance, UserAgentMatcher &$matcher)
 {
     $this->numQueries++;
     $stmt = $this->dbcon->prepare('CALL ' . TeraWurflConfig::$TABLE_PREFIX . '_RIS(?, ?, ?)');
     if (!$stmt->execute(array($userAgent, $tolerance, $matcher->tableSuffix()))) {
         $error = $stmt->errorInfo();
         throw new Exception(sprintf("Error in DB RIS Query: %s\n", $error[2]));
     }
     $data = $stmt->fetch(PDO::FETCH_ASSOC);
     $stmt = null;
     $wurflid = $data['DeviceID'];
     return $wurflid == 'NULL' || is_null($wurflid) ? WurflConstants::NO_MATCH : $wurflid;
 }
开发者ID:pwodaniilea,项目名称:t3x-contexts_wurfl,代码行数:13,代码来源:TeraWurflDatabase_PDO.php

示例4: getDeviceFromUA_RIS

 public function getDeviceFromUA_RIS($userAgent, $tolerance, UserAgentMatcher &$matcher)
 {
     $this->numQueries++;
     $query = sprintf("EXEC " . TeraWurflConfig::$TABLE_PREFIX . "_RIS %s,%s,%s", $this->SQLPrep($userAgent), $tolerance, $this->SQLPrep($matcher->tableSuffix()));
     $result = sqlsrv_query($this->dbcon, $query);
     if (!$result) {
         throw new Exception(sprintf("Error in DB RIS Query: %s. \nQuery: %s\n", $this->lastDBError(), $query));
     }
     $data = sqlsrv_fetch_array($result);
     sqlsrv_free_stmt($result);
     $wurflid = $data['DeviceID'];
     return $wurflid == 'NULL' || is_null($wurflid) ? WurflConstants::NO_MATCH : $wurflid;
 }
开发者ID:pwodaniilea,项目名称:t3x-contexts_wurfl,代码行数:13,代码来源:TeraWurflDatabase_MSSQL2005.php

示例5: getDeviceFromUA_RIS

 /**
  * RIS == Reduction in String (reduce string one char at a time)
  *
  * @param string $userAgent
  * @param int $tolerance
  * @param UserAgentMatcher $matcher
  * @return string A TW Device ID
  */
 public function getDeviceFromUA_RIS($userAgent, $tolerance, UserAgentMatcher $matcher)
 {
     $toexec = 'function(ua, tolerance, matcher) { return performRis(ua, tolerance, matcher) }';
     $args = array(utf8_encode($userAgent), $tolerance, $matcher->tableSuffix());
     $this->numQueries++;
     $response = $this->dbcon->execute($toexec, $args);
     if (!empty($response['ok']) && $response['ok'] == 1 && !empty($response['retval'])) {
         return $response['retval'];
     }
     return WurflConstants::$GENERIC;
 }
开发者ID:vallejos,项目名称:samples,代码行数:19,代码来源:TeraWurflDatabase_MongoDB.php


注:本文中的UserAgentMatcher::tableSuffix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。