blob: 41ea361400967740e1323c1c08df370b50e48be0 [file]
<?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.
*
* KEEP THIS FILE. As of September 2023, this is used by our metrics
* gathering process.
*
* 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';
$where = array("1 = 1");
$args = array();
if ($id = @$_GET['id']) {
$where[] = "project = ':id:'";
$args[':id:'] = $id;
}
$where = implode(" and ", $where);
$sql = <<< EOQ
select
project, path
from GitRepo
where $where
order by project
EOQ;
$fp = fopen('php://output', 'w');
fwrite($fp, "# NOT API; this script is subject to change without notice.\n");
query('dashboard', $sql, $args, function($row) use (&$fp) {
$project = $row['project'];
$path = trim($row['path']);
if (preg_match('/^\/gitroot\//',$path))
$path = "git://git.eclipse.org{$path}";
fputcsv($fp, array($project, $path));
});
fclose($fp);