Esempio n. 1
0
function write_rss2()
{
    $proj = $_GET['p'];
    //$repo = get_repo_path($proj);
    $link = "http://{$_SERVER['HTTP_HOST']}" . sanitized_url() . "p={$proj}";
    $c = git_commit($proj, "HEAD");
    header("Content-type: text/xml", true);
    echo '<?xml version="1.0" encoding="UTF-8"?>';
    ?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

		<channel>
			<title><?php 
    echo $proj;
    ?>
</title>
			<link><?php 
    echo $link;
    ?>
</link>
			<description><?php 
    echo $proj;
    ?>
</description>
			<pubDate><?php 
    echo date('D, d M Y G:i:s', $c['date']);
    ?>
</pubDate>
			<generator>http://code.google.com/p/git-php/</generator>
			<language>en</language>
			<?php 
    for ($i = 0; $i < 10 && $c; $i++) {
        ?>
			<item>
				<title><?php 
        echo $c['message'];
        ?>
</title>
				<link><?php 
        echo $link;
        ?>
</link>
				<pubDate><?php 
        echo date('D, d M Y G:i:s', $c['date']);
        ?>
</pubDate>
				<guid isPermaLink="false"><?php 
        echo $link;
        ?>
</guid>
				<description><?php 
        echo $c['message'];
        ?>
</description>
				<content><?php 
        echo $c['message'];
        ?>
</content>
			</item>
			<?php 
        $c = git_commit($proj, $c['parent']);
        $link = "http://{$_SERVER['HTTP_HOST']}" . sanitized_url() . "p={$proj}&amp;a=commitdiff&amp;h={$c['commit_id']}&amp;hb={$c['parent']}&amp;tm=0";
    }
    ?>
		</channel>
	</rss>
<?php 
    die;
}
Esempio n. 2
0
     break;
 case "tree":
     require_once 'include/display.git_tree.php';
     git_tree($gitphp_conf['projectroot'], $project, isset($_GET['h']) ? $_GET['h'] : NULL, isset($_GET['f']) ? $_GET['f'] : NULL, isset($_GET['hb']) ? $_GET['hb'] : NULL);
     break;
 case "shortlog":
     require_once 'include/display.git_shortlog.php';
     git_shortlog($gitphp_conf['projectroot'], $project, isset($_GET['h']) ? $_GET['h'] : NULL, isset($_GET['pg']) ? $_GET['pg'] : NULL);
     break;
 case "log":
     require_once 'include/display.git_log.php';
     git_log($gitphp_conf['projectroot'], $project, isset($_GET['h']) ? $_GET['h'] : NULL, isset($_GET['pg']) ? $_GET['pg'] : NULL);
     break;
 case "commit":
     require_once 'include/display.git_commit.php';
     git_commit($gitphp_conf['projectroot'], $project, $_GET['h']);
     break;
 case "commitdiff":
     require_once 'include/display.git_commitdiff.php';
     git_commitdiff($gitphp_conf['projectroot'], $project, $_GET['h'], isset($_GET['hp']) ? $_GET['hp'] : NULL);
     break;
 case "commitdiff_plain":
     require_once 'include/display.git_commitdiff_plain.php';
     git_commitdiff_plain($gitphp_conf['projectroot'], $project, $_GET['h'], isset($_GET['hp']) ? $_GET['hp'] : NULL);
     break;
 case "heads":
     require_once 'include/display.git_heads.php';
     git_heads($gitphp_conf['projectroot'], $project);
     break;
 case "tags":
     require_once 'include/display.git_tags.php';
Esempio n. 3
0
function ajax_save_remove_feature($param, $postdata)
{
    global $data_path;
    if (!check_param($param)) {
        return array('saved' => false, 'error' => 'Invalid ID');
    }
    git_init();
    if (array_key_exists('rev', $param)) {
        git_checkout($param['rev']);
    }
    // create directory for map data
    $path = "{$data_path}/{$param['id']}";
    if (!is_dir($path)) {
        mkdir($path);
    }
    $feature_id = $postdata;
    git_exec("rm " . shell_escape("{$param['id']}/_" . $feature_id . '.json'));
    git_commit("remove feature");
    $rev = git_rev();
    if (!git_merge()) {
        return array('saved' => false, 'rev' => $rev, 'error' => "Conflict when merging changes. Please reload and re-do changes.");
    }
    return array('saved' => true, 'rev' => $rev);
}