blob: 21e33fa852df678ef827b6bf2fd1db8426d7bff4 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2017 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
/*
* NOT API. This script may change in the future.
*
* This script exports a list of all known Git source code repositories.
* Essentially, this is the list of all repositories that are registered
* by projects in their metadata.
*
* TODO This is a candidate for inclusion in api.eclipse.org
*/
require_once(dirname(__FILE__) . "/../../eclipse.org-common/system/app.class.php");
$App = new App();
require_once dirname(__FILE__) . '/../classes/debug.php';
require_once dirname(__FILE__) . '/../classes/database.inc';
$sql = "
select
project, path
from GitRepo
order by project
";
$fp = fopen('php://output', 'w');
fwrite($fp, "# NOT API; this script is subject to change without notice.\n");
query('dashboard', $sql, array(), function($row) use (&$fp) {
$project = $row['project'];
$path = $row['path'];
if (preg_match('/^\/gitroot\//',$path))
$path = "git://git.eclipse.org{$path}";
fputcsv($fp, array($project, $path));
});
fclose($fp);