blob: 6b44c1b4d7c5292a5f35da608b5c16e87f1ef645 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2014 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
*
* Contributors:
* Wayne Beaton (Eclipse Foundation)- initial API and implementation
*******************************************************************************/
function getRepositories($url, $base) {
$projects = json_decode(file_get_contents($url), true);
$repositories = array();
foreach($projects as $project => $paths) {
foreach($paths as $path) {
$repositories[$project][] = "$base$path";
}
}
return $repositories;
}
$json = array();
$json['eclipse'] = getRepositories('http://projects.eclipse.org/json/repos/git', 'git://git.eclipse.org');
echo json_encode($json);
?>