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


PHP Project::getSVNRootPath方法代码示例

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


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

示例1: getForbiddenPaths

 /**
  * Return SVN path the user is not allowed to see
  * 
  * @param PFUser $user
  * 
  * @return string 
  */
 protected function getForbiddenPaths(PFUser $user)
 {
     $forbidden = svn_utils_get_forbidden_paths($user->getName(), $this->project->getSVNRootPath());
     $where_forbidden = "";
     foreach ($forbidden as $no_access => $v) {
         $where_forbidden .= " AND svn_dirs.dir not like '" . db_es(substr($no_access, 1)) . "%'";
     }
     return $where_forbidden;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:16,代码来源:SVN_LogFactory.class.php

示例2: import_dumpfile

 private function import_dumpfile(Project $project, $xml_svn, $extraction_path)
 {
     $attrs = $xml_svn->attributes();
     if (!isset($attrs['dump-file'])) {
         return true;
     }
     $rootpath_arg = escapeshellarg($project->getSVNRootPath());
     $dumpfile_arg = escapeshellarg("{$extraction_path}/{$attrs["dump-file"]}");
     $commandline = "svnadmin load {$rootpath_arg} <{$dumpfile_arg} 2>&1";
     $this->logger->info($commandline);
     try {
         $cmd = new System_Command();
         $command_output = $cmd->exec($commandline);
         $return_status = 0;
     } catch (System_Command_CommandException $e) {
         $command_output = $e->output;
         $return_status = $e->return_value;
     }
     foreach ($command_output as $line) {
         $this->logger->debug($line);
     }
     $this->logger->debug("Exited with status {$return_status}");
     return 0 === $return_status;
 }
开发者ID:bamboolsu,项目名称:tuleap,代码行数:24,代码来源:SVNXMLImporter.class.php

示例3: renameSVNRepository

 /**
  * Rename svn repository (following project unix_name change)
  * 
  * @param Project $project
  * @param String  $newName
  * 
  * @return Boolean
  */
 public function renameSVNRepository(Project $project, $newName)
 {
     return rename($project->getSVNRootPath(), $GLOBALS['svn_prefix'] . '/' . $newName);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:BackendSVN.class.php

示例4: svn_get_revisions

function svn_get_revisions(Project $project, $offset, $chunksz, $_rev_id = '', $_commiter = '', $_srch = '', $order_by = '', $pv = 0, $foundRows = true)
{
    global $_path;
    $um = UserManager::instance();
    //check user access rights
    $forbidden = svn_utils_get_forbidden_paths($um->getCurrentUser()->getName(), $project->getSVNRootPath());
    $select = 'SELECT';
    $group_by = '';
    if ($foundRows) {
        $select .= ' SQL_CALC_FOUND_ROWS';
    }
    $select .= ' svn_commits.revision as revision, svn_commits.id as commit_id, svn_commits.description as description, svn_commits.date as date, svn_commits.whoid';
    $from = " FROM svn_commits";
    $where = " WHERE svn_commits.group_id=" . db_ei($project->getGroupId());
    //check user access rights
    if (!empty($forbidden)) {
        $from .= " INNER JOIN svn_checkins ON (svn_checkins.commitid = svn_commits.id)";
        $from .= " INNER JOIN svn_dirs ON (svn_dirs.id = svn_checkins.dirid)";
        $where_forbidden = "";
        foreach ($forbidden as $no_access => $v) {
            if ($no_access == $_path) {
                $_path = '';
            }
            $where_forbidden .= " AND svn_dirs.dir not like '" . db_es(substr($no_access, 1)) . "%'";
        }
        $where .= $where_forbidden;
        $group_by .= ' GROUP BY revision';
    }
    //if status selected, and more to where clause
    if ($_path != '') {
        $path_str = " AND svn_dirs.dir like '%" . db_es($_path) . "%'";
        if (!isset($forbidden) || empty($forbidden)) {
            $from .= " INNER JOIN svn_checkins ON (svn_checkins.commitid = svn_commits.id)";
            $from .= " INNER JOIN svn_dirs ON (svn_dirs.id = svn_checkins.dirid)";
            $group_by .= ' GROUP BY revision';
        }
    } else {
        $path_str = "";
    }
    //if revision selected, and more to where clause
    if (isset($_rev_id) && $_rev_id != '') {
        $commit_str = " AND svn_commits.revision='" . db_ei($_rev_id) . "' ";
    } else {
        $commit_str = '';
    }
    if (isset($_commiter) && $_commiter && $_commiter != 100) {
        $commiter_str = " AND svn_commits.whoid='" . db_ei($um->getUserByUserName($_commiter)->getId()) . "' ";
    } else {
        //no assigned to was chosen, so don't add it to where clause
        $commiter_str = '';
    }
    if (isset($_srch) && $_srch != '') {
        $srch_str = " AND svn_commits.description like '%" . db_es(htmlspecialchars($_srch)) . "%'";
    } else {
        $srch_str = "";
    }
    $where .= $commiter_str . $commit_str . $srch_str . $path_str;
    if (!isset($pv) || !$pv) {
        $limit = " LIMIT " . db_ei($offset) . "," . db_ei($chunksz);
    }
    // SQLi Warning: no real possibility to escape $order_by here.
    // We rely on a proper filtering of user input by calling methods.
    if (!isset($order_by) || $order_by == '') {
        $order_by = " ORDER BY revision DESC ";
    }
    $sql = $select . $from . $where . $group_by . $order_by . $limit;
    //echo $sql."<br>\n";
    $result = db_query($sql);
    // Compute the number of rows.
    $totalrows = -1;
    if ($foundRows) {
        $sql1 = 'SELECT FOUND_ROWS() as nb';
        $result1 = db_query($sql1);
        if ($result1 && !db_error($result1)) {
            $row1 = db_fetch_array($result1);
            $totalrows = $row1['nb'];
        }
    }
    return array($result, $totalrows);
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:80,代码来源:svn_utils.php

示例5: parseGroupLines

 /**
  * Update renamed ugroup line or comment invalid ugroup lines for all lines of .SVNAccessFile
  *
  * @param Project $project  Project of the svn repository
  * @param String  $contents Text to validate
  * @param Boolean $verbose  Show feedback or not
  *
  * @return String
  */
 public function parseGroupLines($project, $contents, $verbose = false)
 {
     $defaultLines = explode("\n", $this->getPlatformBlock($project->getSVNRootPath()));
     $groups = array();
     $currentSection = -1;
     foreach ($defaultLines as $line) {
         $currentSection = $this->getCurrentSection($line, $currentSection);
         if ($currentSection == 'groups') {
             $groups = $this->accumulateDefinedGroups($groups, $line, true);
         }
     }
     $lines = explode("\n", $contents);
     $validContents = '';
     foreach ($lines as $line) {
         $currentSection = $this->getCurrentSection($line, $currentSection);
         switch ($currentSection) {
             case 'groups':
                 $groups = $this->accumulateDefinedGroups($groups, $line, false);
                 $validContents .= $line . PHP_EOL;
                 break;
             default:
                 $validContents .= $this->validateUGroupLine($groups, $line, $verbose) . PHP_EOL;
                 break;
         }
     }
     return substr($validContents, 0, -1);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:36,代码来源:SVNAccessFile.class.php

示例6: getInfo

 /**
  * Returns revision info for a project E.g. array(
  *      lucky luke,     //author
  *      1545654656,     //datestamp
  *      16,             //log message size (in bytes)
  *      'my message',   //log message
  *  );
  *
  * @param Project $project
  * @param int $revision
  *
  * @throw SVN_SvnlookException
  *
  * @return array
  */
 public function getInfo(Project $project, $revision)
 {
     $command = 'info -r ' . escapeshellarg($revision) . ' ' . escapeshellarg($project->getSVNRootPath());
     return $this->execute($command);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:20,代码来源:SVN_Svnlook.class.php

示例7: userCanRead

 public function userCanRead(PFUser $user, Project $project, $svnpath)
 {
     include_once 'www/svn/svn_utils.php';
     return svn_utils_check_access($user->getUserName(), $project->getSVNRootPath(), $svnpath);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:5,代码来源:SVN_PermissionsManager.class.php

示例8: importAccessFile

 private function importAccessFile(Project $project, $xml_svn)
 {
     $dao = $this->getAccessFileDAO();
     $tagname = "access-file";
     $contents = (string) $xml_svn->{$tagname} . "\n";
     $writer = new SVN_AccessFile_Writer($project->getSVNRootPath());
     $this->logger->debug("Write SVN AccessFile: " . $writer->filename());
     if (!$dao->saveNewAccessFileVersionInProject($project->getID(), $contents)) {
         throw new SVNXMLImporterException("Could not save new access file version");
     }
     if (!$writer->write_with_defaults($contents)) {
         throw new SVNXMLImporterException("Could not write to " . $writer->filename());
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:SVNXMLImporter.class.php


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