當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhabricatorHash類代碼示例

本文整理匯總了PHP中PhabricatorHash的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorHash類的具體用法?PHP PhabricatorHash怎麽用?PHP PhabricatorHash使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PhabricatorHash類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getBuiltinFileKey

 public function getBuiltinFileKey()
 {
     $name = $this->getName();
     $desc = "disk(name={$name})";
     $hash = PhabricatorHash::digestToLength($desc, 40);
     return "builtin:{$hash}";
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:7,代碼來源:PhabricatorFilesOnDiskBuiltinFile.php

示例2: buildWhereClauseParts

 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'service.id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'service.phid IN (%Ls)', $this->phids);
     }
     if ($this->names !== null) {
         $hashes = array();
         foreach ($this->names as $name) {
             $hashes[] = PhabricatorHash::digestForIndex($name);
         }
         $where[] = qsprintf($conn, 'service.nameIndex IN (%Ls)', $hashes);
     }
     if ($this->serviceTypes !== null) {
         $where[] = qsprintf($conn, 'service.serviceType IN (%Ls)', $this->serviceTypes);
     }
     if ($this->devicePHIDs !== null) {
         $where[] = qsprintf($conn, 'binding.devicePHID IN (%Ls)', $this->devicePHIDs);
     }
     if ($this->namePrefix !== null) {
         $where[] = qsprintf($conn, 'service.name LIKE %>', $this->namePrefix);
     }
     if ($this->nameSuffix !== null) {
         $where[] = qsprintf($conn, 'service.name LIKE %<', $this->nameSuffix);
     }
     return $where;
 }
開發者ID:rchicoli,項目名稱:phabricator,代碼行數:30,代碼來源:AlmanacServiceQuery.php

示例3: buildWhereClause

 protected function buildWhereClause(AphrontDatabaseConnection $conn_r)
 {
     $where = array();
     if ($this->ids !== null) {
         $where[] = qsprintf($conn_r, 'id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn_r, 'phid IN (%Ls)', $this->phids);
     }
     if ($this->emailAddresses !== null) {
         $where[] = qsprintf($conn_r, 'emailAddress IN (%Ls)', $this->emailAddresses);
     }
     if ($this->verificationCodes !== null) {
         $hashes = array();
         foreach ($this->verificationCodes as $code) {
             $hashes[] = PhabricatorHash::digestForIndex($code);
         }
         $where[] = qsprintf($conn_r, 'verificationHash IN (%Ls)', $hashes);
     }
     if ($this->authorPHIDs !== null) {
         $where[] = qsprintf($conn_r, 'authorPHID IN (%Ls)', $this->authorPHIDs);
     }
     $where[] = $this->buildPagingClause($conn_r);
     return $this->formatWhereClause($where);
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:25,代碼來源:PhabricatorAuthInviteQuery.php

示例4: buildWhereClause

 protected function buildWhereClause(AphrontDatabaseConnection $conn_r)
 {
     $where = array();
     if ($this->ids !== null) {
         $where[] = qsprintf($conn_r, 'id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn_r, 'phid IN (%Ls)', $this->phids);
     }
     if ($this->names !== null) {
         $hashes = array();
         foreach ($this->names as $name) {
             $hashes[] = PhabricatorHash::digestForIndex($name);
         }
         $where[] = qsprintf($conn_r, 'nameIndex IN (%Ls)', $hashes);
     }
     if ($this->namePrefix !== null) {
         $where[] = qsprintf($conn_r, 'name LIKE %>', $this->namePrefix);
     }
     if ($this->nameSuffix !== null) {
         $where[] = qsprintf($conn_r, 'name LIKE %<', $this->nameSuffix);
     }
     $where[] = $this->buildPagingClause($conn_r);
     return $this->formatWhereClause($where);
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:25,代碼來源:AlmanacDeviceQuery.php

示例5: buildWhereClauseParts

 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'phid IN (%Ls)', $this->phids);
     }
     if ($this->repositoryPHIDs !== null) {
         $where[] = qsprintf($conn, 'repositoryPHID IN (%Ls)', $this->repositoryPHIDs);
     }
     if ($this->refTypes !== null) {
         $where[] = qsprintf($conn, 'refType IN (%Ls)', $this->refTypes);
     }
     if ($this->refNames !== null) {
         $name_hashes = array();
         foreach ($this->refNames as $name) {
             $name_hashes[] = PhabricatorHash::digestForIndex($name);
         }
         $where[] = qsprintf($conn, 'refNameHash IN (%Ls)', $name_hashes);
     }
     if (strlen($this->datasourceQuery)) {
         $where[] = qsprintf($conn, 'refNameRaw LIKE %>', $this->datasourceQuery);
     }
     return $where;
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:27,代碼來源:PhabricatorRepositoryRefCursorQuery.php

示例6: setRefName

 public function setRefName($ref_raw)
 {
     $this->setRefNameRaw($ref_raw);
     $this->setRefNameHash(PhabricatorHash::digestForIndex($ref_raw));
     $this->setRefNameEncoding($this->detectEncodingForStorage($ref_raw));
     return $this;
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:7,代碼來源:PhabricatorRepositoryPushLog.php

示例7: getArtifactIndex

 public static function getArtifactIndex(HarbormasterBuildTarget $target, $artifact_key)
 {
     $build = $target->getBuild();
     $parts = array($build->getPHID(), $target->getBuildGeneration(), $artifact_key);
     $parts = implode("", $parts);
     return PhabricatorHash::digestForIndex($parts);
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:7,代碼來源:HarbormasterBuildArtifact.php

示例8: getBuiltinFileKey

 public function getBuiltinFileKey()
 {
     $icon = $this->getIcon();
     $color = $this->getColor();
     $desc = "compose(icon={$icon}, color={$color})";
     $hash = PhabricatorHash::digestToLength($desc, 40);
     return "builtin:{$hash}";
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:8,代碼來源:PhabricatorFilesComposeIconBuiltinFile.php

示例9: getIndexVersion

 public function getIndexVersion($object)
 {
     $ngrams = $object->newNgrams();
     $map = mpull($ngrams, 'getValue', 'getNgramKey');
     ksort($map);
     $serialized = serialize($map);
     return PhabricatorHash::digestForIndex($serialized);
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:8,代碼來源:PhabricatorNgramsIndexEngineExtension.php

示例10: save

 public function save()
 {
     if (!$this->getVerificationHash()) {
         $hash = PhabricatorHash::digestForIndex($this->getVerificationCode());
         $this->setVerificationHash($hash);
     }
     return parent::save();
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:8,代碼來源:PhabricatorAuthInvite.php

示例11: getPasswordHashInput

 private function getPasswordHashInput(PhutilOpaqueEnvelope $password, PhabricatorUser $user)
 {
     if ($user->getPHID() != $this->getUserPHID()) {
         throw new Exception(pht('User does not match password user PHID!'));
     }
     $raw_input = PhabricatorHash::digestPassword($password, $user->getPHID());
     return new PhutilOpaqueEnvelope($raw_input);
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:8,代碼來源:PhabricatorRepositoryVCSPassword.php

示例12: getMarkupFieldKey

 /**
  * @task markup
  */
 public function getMarkupFieldKey($field)
 {
     if ($this->shouldUseMarkupCache($field)) {
         $id = $this->getID();
     } else {
         $id = PhabricatorHash::digest($this->getMarkupText($field));
     }
     return "phriction:{$field}:{$id}";
 }
開發者ID:fengshao0907,項目名稱:phabricator,代碼行數:12,代碼來源:PhrictionContent.php

示例13: save

 public function save()
 {
     AlmanacNames::validateName($this->getName());
     $this->nameIndex = PhabricatorHash::digestForIndex($this->getName());
     if (!$this->mailKey) {
         $this->mailKey = Filesystem::readRandomCharacters(20);
     }
     return parent::save();
 }
開發者ID:Houzz,項目名稱:phabricator,代碼行數:9,代碼來源:AlmanacDevice.php

示例14: newHTTPAuthorization

 public static function newHTTPAuthorization(PhabricatorRepository $repository, PhabricatorUser $viewer, $operation)
 {
     $lfs_user = self::HTTP_USERNAME;
     $lfs_pass = Filesystem::readRandomCharacters(32);
     $lfs_hash = PhabricatorHash::digest($lfs_pass);
     $ttl = PhabricatorTime::getNow() + phutil_units('1 day in seconds');
     $token = id(new PhabricatorAuthTemporaryToken())->setTokenResource($repository->getPHID())->setTokenType(self::TOKENTYPE)->setTokenCode($lfs_hash)->setUserPHID($viewer->getPHID())->setTemporaryTokenProperty('lfs.operation', $operation)->setTokenExpires($ttl)->save();
     $authorization_header = base64_encode($lfs_user . ':' . $lfs_pass);
     return 'Basic ' . $authorization_header;
 }
開發者ID:rchicoli,項目名稱:phabricator,代碼行數:10,代碼來源:DiffusionGitLFSTemporaryTokenType.php

示例15: setSession

 public function setSession($session)
 {
     // Store the hash of the session, not the actual session key, so that
     // seeing the logs doesn't compromise all the sessions which appear in
     // them. This just prevents casual leaks, like in a screenshot.
     if (strlen($session)) {
         $this->session = PhabricatorHash::digest($session);
     }
     return $this;
 }
開發者ID:netcomtec,項目名稱:phabricator,代碼行數:10,代碼來源:PhabricatorUserLog.php


注:本文中的PhabricatorHash類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。