| <?php |
| /******************************************************************************* |
| * Copyright (c) 2011 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 - initial API and implementation |
| *******************************************************************************/ |
| |
| /** |
| * This file provides a listing of all the sources of information used by |
| * the "Project Downloads" tool. More specifically, this script shows a |
| * listing of all directories scanned for each project. This file is linked |
| * to by ./downloads.php |
| */ |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/common.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/debug.php"); |
| trace_file_info(__FILE__); |
| |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); |
| $App = new App(); |
| $Nav = new Nav(); |
| $Menu = new Menu(); |
| |
| if ($App->devmode) { |
| $base = $_SERVER['DOCUMENT_ROOT'] . '/projects/tests/data/ip-scans'; |
| } else { |
| $base = '/home/data/httpd/writable/projects/ip-scans/'; |
| mustBeCommitter(); |
| include($App->getProjectCommon()); |
| } |
| |
| function getMapping($base) { |
| global $projectNamePattern; |
| |
| $mapping = array(); |
| $file = fopen("$base/mapping.txt", "r"); |
| if (!$file) return $mapping; |
| |
| while (($line = fgets($file)) !== false) { |
| if (!preg_match("/^($projectNamePattern),(.+)\$/", $line, $matches)) continue; |
| $id = $matches[1]; |
| $path = $matches[3]; |
| |
| $mapping[$id][] = $path; |
| } |
| fclose($file); |
| |
| ksort($mapping); |
| return $mapping; |
| } |
| |
| ob_start(); |
| |
| $pageKeywords = ""; |
| $pageTitle = "Project Downloads Sources"; |
| $pageAuthor = "Wayne Beaton"; |
| ?> |
| |
| <div id="midcolumn"> |
| <h1><?= $pageTitle ?></h1> |
| |
| <div class="homeitem"> |
| |
| <p>This page lists the sources of download information used |
| by the <a href="downloads.php">Project Downloads</a> Tool. |
| Please report any errors you find to |
| <a href=\"mailto:emo@eclipse.org\">EMO</a>.</p> |
| |
| <?php |
| $mapping = getMapping($base); |
| echo "<ul>"; |
| foreach($mapping as $project => $paths) { |
| echo "<li>"; |
| echo "$project"; |
| echo "<ul>"; |
| foreach ($paths as $path) { |
| echo "<li>$path</li>"; |
| } |
| echo "</ul>"; |
| echo "</li>"; |
| } |
| echo "</ul>"; |
| ?> |
| |
| </div> |
| </div> |
| |
| <?php |
| $html = ob_get_contents(); |
| ob_end_clean(); |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| |
| echo get_trace_html(); |
| ?> |