本文整理汇总了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;
}
示例2: fullTableName
public function fullTableName()
{
return TeraWurflConfig::$TABLE_PREFIX . '_' . $this->userAgentMatcher->tableSuffix();
}
示例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;
}
示例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;
}
示例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;
}