当前位置: 首页>>代码示例>>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;未经允许,请勿转载。