blob: 1190398e707f743164635892eb7e0c7a910e53e3 [file] [log] [blame]
<?php 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(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop'
/*******************************************************************************
* Copyright (c) 2009 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
*******************************************************************************/
/*$scanner = new ProjectScanner();
$scanner->scan_plugin_directory("/rt/ecf/3.5dailies3.2-repo/site.p2/plugins/");
class ProjectScanner {
/**
* This function scans the provided plug-in directory
* and adds the information form that scan to the receiver's
* results. Note that $plugin_path is the partial-directory,
* relative to the root of the downloads server. It is assumed
* to reference a directory; it is further assumed that the
* value ends with a slash.
*/
function scan_plugin_directory($plugin_path) {
global $App;
$root = $App->getDownloadBasePath();
$path = $root . $plugin_path;
if ($dh = opendir($path)) {
while (($file = readdir($dh)) !== false) {
$this->process_file($file, $root, $plugin_path);
}
closedir($dh);
}
}
function process_file($file, $root, $path) {
echo "$file: ";
if (preg_match('/^org\.eclipse\.(.*)\.jar$/', $file)) {
echo "Eclipse project bundle";
$this->process_bundle($file, $root, $path);
} else if (preg_match('/^(.*)\.jar$/', $file)) {
echo "Other bundle";
}
echo "</br>";
}
?>