blob: e2a92bc72d9a239ecd929259e554bfa7c43c6169 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2014, 2016 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
*******************************************************************************/
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
$App = new App();
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Project.class.php");
header("Content-Type: text/plain");
// Note that get_project_from_pmi checks for valid form.
if (!$project = Project::getProject($_GET['id'])) {
header("Location:/projects");
exit();
}
$id = $project->getId();
$forge = $project->getForge();
$entries = array();
if ($description = $project->getDescription()) {
$entries[] = array(
"Project description:",
trim(html_entity_decode(strip_tags($description))),
$project->getUrl()
);
}
$entries[] = array(
"Developer resources:",
"Information regarding source code management, builds, coding standards, and more.",
$project->getUrl() . "/developer"
);
$repositories = array();
foreach($project->getSourceRepositories() as $repository) {
$repositories[] = $repository->getUrl();
}
if (!empty($repositories)) {
$entries[] = array(
"Source Code Repositories:",
"The project maintains the following source code repositories:\n\n- "
. join("\n- ", $repositories),
''
);
}
$entries[] = array(
"Contributor Agreement:",
"Before your contribution can be accepted by the project,"
. " you need to create and electronically sign the"
. " Eclipse Contributor Agreement (ECA).",
"http://www.eclipse.org/legal/ECA.php"
);
if ($devList = $project->getDevListUrl()) {
$entries[] = array(
'Contact:',
"Contact the project developers via the project's \"dev\" list.",
$devList);
}
if ($product = $project->getBugzillaProduct()) {
if ($forge == 'eclipse') {
$base = 'https://bugs.eclipse.org/bugs';
} else {
$base = "https://{$forge->getId()}.org/bugs";
}
$search = "$base/buglist.cgi?product=$product";
$create = "$base/enter_bug.cgi?product=$product";
if ($components = $project->getBugzillaComponents()) {
$search .= "&" . $components[1];
$create .= "&" . $components[1];
}
$entries[] = array(
"Search for bugs:",
"This project uses Bugzilla to track ongoing development and issues.",
$search);
$entries[] = array(
"Create a new bug:",
"Be sure to search for existing bugs before you create another one."
." Remember that contributions are always welcome!",
$create);
}
function renderTitle($text, $char = '=') {
echo $text;
echo "\n";
for($count=0;$count<strlen($text);$count++) echo $char;
echo "\n";
}
?>
<?php renderTitle("Contributing to " . $project->getName()); ?>
Thanks for your interest in this project.
<?php
foreach($entries as $entry) {
echo "\n";
renderTitle($entry[0], '-');
echo "\n";
echo $entry[1];
if (!empty($entry[2])) {
echo "\n\n";
echo '- ' . $entry[2];
}
echo "\n";
}
?>