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


PHP kString::generateStringId方法代码示例

本文整理汇总了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;
 }
开发者ID:DBezemer,项目名称:server,代码行数:7,代码来源:kRegExTokenMapper.class.php

示例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;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:12,代码来源:syndicationFeed.php

示例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");
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:17,代码来源:Annotation.php

示例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");
 }
开发者ID:kubrickfr,项目名称:server,代码行数:17,代码来源:CuePoint.php

示例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");
 }
开发者ID:DBezemer,项目名称:server,代码行数:14,代码来源:AppToken.php

示例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);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:19,代码来源:AuditTrail.php

示例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");
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:22,代码来源:ShortLink.php

示例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;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:12,代码来源:widget.php

示例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");
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:14,代码来源:asset.php


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