Пример #1
0
function svn_utils_write_svn_access_file($project_svnroot, $contents)
{
    global $feedback, $Language;
    $accessfile = new SVN_AccessFile_Writer($project_svnroot);
    $ret = $accessfile->write($contents);
    if ($accessfile->isErrorFile()) {
        $feedback .= $Language->getText('svn_utils', 'file_err', $accessfile->filename());
    } else {
        if ($accessfile->isErrorWrite()) {
            $feedback .= $Language->getText('svn_utils', 'write_err', $accessfile->filename());
        }
    }
    return $ret;
}
Пример #2
0
 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());
     }
 }