コード例 #1
0
ファイル: index.php プロジェクト: browserplus/borg
        $link = (string) $item->link['href'];
        $title = (string) $item->title;
        $s .= "<li><a href=\"{$link}\">{$title}</a></li>";
    }
    $s .= "</ul>";
    return render_widget("blog", "BrowserPlus: <a href=\"/blog/\">Blog</a>", $s);
}
// IRC Transcript
$irc = new IRC();
$results = $irc->get_rows($irc->get_max_id(), $tableRowsToShow);
$ircnav = l("#browserplus", "/discuss/");
$irctable = render_table($results, "stamp", "who", "utterance", array("show_long_dates" => true, "top_nav" => "<strong>IRC: {$ircnav}</strong>"));
//$ircwidgets = $irc->render_widget("day") . $irc->render_widget("week") . $irc->render_widget("month");
$ircwidgets = $irc->render_widget("week");
// GIT Projects
$git = new GIT();
$results = $git->get_rows($tableRowsToShow);
$gitnav = "<strong>GitHub: <a href=\"http://www.github.com/browserplus/\">BrowserPlus</a></strong>";
$gittable = render_table($results, "tcommit", "project", "msg", array("show_long_dates" => true, "top_nav" => $gitnav, "url_key" => "url", "url_pat" => "%s"));
$gitwidgets = $git->render_project_widget();
// bugzilla issues
$bugzilla = new Bugzilla();
$issuewidget = $bugzilla->render_widget($listItemsToShow);
// Links Widget
$linkswidget = get_links_widget();
// Blog Widget
$blogwidget = get_blog_widget($listItemsToShow);
// Twitter Widgets
$twitter = new Twitter();
$tw_user_widget = $twitter->render_user_widget("browserplus", $listItemsToShow);
$tw_search_widget = $twitter->render_search_widget("browserplus", $listItemsToShow);
コード例 #2
0
 function canPiston()
 {
     $errors = array();
     if (!SVN::available()) {
         $errors[] = "Subversion is not available.";
     }
     if (!Piston::available()) {
         $errors[] = "Piston is not available.";
     }
     if (!SVN::isSVNRepo() && !GIT::isGITRepo()) {
         $errors[] = "Piston only works on svn working copies and git repositories.";
     }
     return $errors;
 }
コード例 #3
0
ファイル: cache_git.php プロジェクト: browserplus/borg
<?php

include "../../php/site.php";
include "../../php/db.php";
include "../../php/git.php";
$g = new GIT();
// to make sure we're the ones calling
if (isset($_GET["s"]) && $_GET["s"] == $g->get_cache_secret()) {
    echo ($g->fetch_platform_issues() ? "cached" : "error caching") . " forums\n";
}
コード例 #4
0
}

// Check we're not being re-called before we do anything
$alreadyexists = false;
foreach ($template as $dest => $source) {
	if (file_exists($dest)) { 
		echo "ERROR: Module $dest already exists. This script can not be called multiple times, or upgrade existing modules.\n"; 
		$alreadyexists = true;
	}
}
if ($alreadyexists) die;

if ($mode == 'piston') {
	echo "Now running piston to add modules. Piston is quite noisy, and can sometimes list errors as fatal that can be ignored.\n";
	echo "If errors are shown, please check result before assuming failure\n\n";
}

foreach ($template as $dest => $source) {
	if ($mode == 'contribute') {
		GIT::ignore($dest);
		$source->checkout($dest);
	}
	else if ($mode == 'piston') $source->piston($dest);
	else $source->export($dest);
}

if ($mode == 'piston' && GIT::isGITRepo()) {
	echo "\n\nNow commit the changes with something like \"git commit -m 'Import core SilverStripe modules'\"\n";
}

コード例 #5
0
ファイル: fetch_git.php プロジェクト: browserplus/borg
#!/usr/bin/php
<?php 
include "/home/websites/browserplus/php/site.php";
include "/home/websites/browserplus/php/db.php";
include "/home/websites/browserplus/php/git.php";
// DOK_BASE - normally set in apache, but not available to scripts
putenv("DOK_BASE=/home/websites/browserplus/data");
$gitbase = "http://github.com/";
$db = new DB("git");
$git = new GIT();
// Fetch issues
$secret = $git->get_cache_secret();
$host = get_cfg_var('bp_env') == "local" ? "borg" : "browserplus.org";
fetch("http://{$host}/site/cache_git.php?s={$secret}");
// Fetch commits
// projects stored in data/projects/projects.json file
$all_projects = get_projects();
foreach ($all_projects as $label => $projects) {
    foreach ($projects as $purl) {
        // only process urls hosted on github (see gitbase above)
        if (substr($purl, 0, strlen($gitbase)) == $gitbase) {
            // project is "lloyd/bp-imagealter"
            $np = explode("/", substr($purl, strlen($gitbase)));
            $user = $np[0];
            $repository = $np[1];
            // fetch commit data
            $commit_url = "http://github.com/api/v1/json/{$user}/{$repository}/commit/master";
            $json = fetch($commit_url);
            if ($json) {
                // commit data is a json struct
                $data = json_decode($json, 1);