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


PHP PhabricatorOwnersPackage::splitPath方法代码示例

本文整理汇总了PHP中PhabricatorOwnersPackage::splitPath方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorOwnersPackage::splitPath方法的具体用法?PHP PhabricatorOwnersPackage::splitPath怎么用?PHP PhabricatorOwnersPackage::splitPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorOwnersPackage的用法示例。


在下文中一共展示了PhabricatorOwnersPackage::splitPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPathMatchStrength

 /**
  * Get the number of directory matches between this path specification and
  * some real path.
  */
 public function getPathMatchStrength($path)
 {
     $this_path = $this->getPath();
     if ($this_path === '/') {
         // The root path "/" just matches everything with strength 1.
         return 1;
     }
     $self_fragments = PhabricatorOwnersPackage::splitPath($this_path);
     $path_fragments = PhabricatorOwnersPackage::splitPath($path);
     $self_count = count($self_fragments);
     $path_count = count($path_fragments);
     if ($self_count > $path_count) {
         // If this path is longer (and therefor more specific) than the target
         // path, we don't match it at all.
         return 0;
     }
     for ($ii = 0; $ii < $self_count; $ii++) {
         if ($self_fragments[$ii] != $path_fragments[$ii]) {
             return 0;
         }
     }
     return $self_count;
 }
开发者ID:truSense,项目名称:phabricator,代码行数:27,代码来源:PhabricatorOwnersPath.php

示例2: getFragmentsForPaths

 private function getFragmentsForPaths(array $paths)
 {
     $fragments = array();
     foreach ($paths as $path) {
         foreach (PhabricatorOwnersPackage::splitPath($path) as $fragment) {
             $fragments[$fragment] = $fragment;
         }
     }
     return $fragments;
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:10,代码来源:PhabricatorOwnersPackageQuery.php

示例3: buildWhereClauseParts

 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'p.phid IN (%Ls)', $this->phids);
     }
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'p.id IN (%Ld)', $this->ids);
     }
     if ($this->repositoryPHIDs !== null) {
         $where[] = qsprintf($conn, 'rpath.repositoryPHID IN (%Ls)', $this->repositoryPHIDs);
     }
     if ($this->ownerPHIDs !== null) {
         $base_phids = $this->ownerPHIDs;
         $projects = id(new PhabricatorProjectQuery())->setViewer($this->getViewer())->withMemberPHIDs($base_phids)->execute();
         $project_phids = mpull($projects, 'getPHID');
         $all_phids = array_merge($base_phids, $project_phids);
         $where[] = qsprintf($conn, 'o.userPHID IN (%Ls)', $all_phids);
     }
     if (strlen($this->namePrefix)) {
         // NOTE: This is a hacky mess, but this column is currently case
         // sensitive and unique.
         $where[] = qsprintf($conn, 'LOWER(p.name) LIKE %>', phutil_utf8_strtolower($this->namePrefix));
     }
     if ($this->controlMap) {
         $clauses = array();
         foreach ($this->controlMap as $repository_phid => $paths) {
             $fragments = array();
             foreach ($paths as $path) {
                 foreach (PhabricatorOwnersPackage::splitPath($path) as $fragment) {
                     $fragments[$fragment] = $fragment;
                 }
             }
             $clauses[] = qsprintf($conn, '(rpath.repositoryPHID = %s AND rpath.path IN (%Ls))', $repository_phid, $fragments);
         }
         $where[] = implode(' OR ', $clauses);
     }
     return $where;
 }
开发者ID:bohanlin,项目名称:phabricator,代码行数:39,代码来源:PhabricatorOwnersPackageQuery.php


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