本文整理汇总了PHP中kString::generateStringId方法的典型用法代码示例。如果您正苦于以下问题:PHP kString::generateStringId方法的具体用法?PHP kString::generateStringId怎么用?PHP kString::generateStringId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kString
的用法示例。
在下文中一共展示了kString::generateStringId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tokenToKey
public function tokenToKey($matches)
{
$token = $matches[0];
$key = "@K" . kString::generateStringId() . "K@";
$this->tokensMap[$key] = $token;
return $key;
}
示例2: calculateId
private static function calculateId()
{
$dc = kDataCenterMgr::getCurrentDc();
for ($i = 0; $i < 10; ++$i) {
$id = $dc["id"] . '_' . kString::generateStringId();
$existing_object = entryPeer::retrieveByPk($id);
if (!$existing_object) {
return $id;
}
}
die;
}
示例3: getUniqueAnnotationId
/**
* generate unique string id for annotation
*/
public function getUniqueAnnotationId()
{
$dc = kDataCenterMgr::getCurrentDc();
for ($i = 0; $i < 10; $i++) {
$id = $dc["id"] . '_' . kString::generateStringId();
$existingObject = AnnotationPeer::retrieveByPK($id);
if ($existingObject) {
KalturaLog::log(__METHOD__ . ": id [{$id}] already exists");
} else {
return $id;
}
}
throw new Exception("Could not find unique id for annotation");
}
示例4: calculateId
/**
* generate unique string id for CuePoint
*/
private function calculateId()
{
$currentDcId = kDataCenterMgr::getCurrentDcId();
for ($i = 0; $i < 10; $i++) {
$id = $currentDcId . '_' . kString::generateStringId();
$existingObject = CuePointPeer::retrieveByPKNoFilter($id);
if ($existingObject) {
KalturaLog::log(__METHOD__ . ": id [{$id}] already exists");
} else {
return $id;
}
}
throw new Exception("Could not find unique id for CuePoint");
}
示例5: calculateId
private function calculateId()
{
$dc = kDataCenterMgr::getCurrentDc();
for ($i = 0; $i < 10; $i++) {
$id = $dc["id"] . '_' . kString::generateStringId();
$existingObject = AppTokenPeer::retrieveByPkNoFilter($id);
if ($existingObject) {
KalturaLog::log("ID [{$id}] already exists");
} else {
return $id;
}
}
throw new Exception("Could not find unique id for AppToken");
}
示例6: getUniqueRequestId
/**
* @return int unique id per request
*/
public function getUniqueRequestId()
{
if (!is_null(self::$uniqueRequestId)) {
return self::$uniqueRequestId;
}
$dcId = kDataCenterMgr::getCurrentDcId();
for ($i = 0; $i < 10; ++$i) {
$requestId = $dcId . '_' . kString::generateStringId();
$exists = AuditTrailPeer::retrieveByRequestId($requestId);
if (!$exists) {
self::$uniqueRequestId = $requestId;
return self::$uniqueRequestId;
}
}
throw new kAuditTrailException('Unable to generate unique id', kAuditTrailException::UNIQUE_ID_NOT_GENERATED);
}
示例7: calculateId
protected function calculateId()
{
$allChars = '0123456789abcdefghijklmnopqrstuvwxyz';
$dcChars = str_split($allChars, strlen($allChars) / count(kDataCenterMgr::getAllDcs()));
$dc = kDataCenterMgr::getCurrentDc();
$dcId = (int) $dc["id"];
$currentDcChars = $dcChars[$dcId];
for ($i = 0; $i < 10; $i++) {
$dcChar = substr($currentDcChars, rand(0, strlen($currentDcChars) - 1), 1);
if (!$dcChar) {
$dcChar = '0';
}
$id = $dcChar . kString::generateStringId(3);
$existingObject = ShortLinkPeer::retrieveByPK($id);
if ($existingObject) {
KalturaLog::log("id [{$id}] already exists");
} else {
return $id;
}
}
throw new Exception("Could not find unique id for short link");
}
示例8: calculateId
public static function calculateId($widget)
{
$dc = kDataCenterMgr::getCurrentDc();
for ($i = 0; $i < 10; ++$i) {
$id = $dc["id"] . '_' . kString::generateStringId();
$existing_widget = widgetPeer::retrieveByPk($id);
if (!$existing_widget) {
return $id;
}
}
die;
}
示例9: calculateId
private function calculateId()
{
$dc = kDataCenterMgr::getCurrentDc();
for ($i = 0; $i < 10; $i++) {
$id = $dc["id"] . '_' . kString::generateStringId();
$existingObject = flavorAssetPeer::retrieveById($id);
if ($existingObject) {
KalturaLog::log(__METHOD__ . ": id [{$id}] already exists");
} else {
return $id;
}
}
throw new Exception("Could not find unique id for flavorAsset");
}