Exemplo n.º 1
0
         $str .= '  Use <a href="/package/' . $pkg['new_package'] . '">' . htmlspecialchars($pkg['new_package']) . '</a> instead.';
     } elseif ($pkg['new_channel']) {
         $str .= '  Package has moved to channel <a href="http://' . $pkg['new_channel'] . '">' . htmlspecialchars($pkg['new_channel']) . '</a>, package ' . $pkg['new_package'] . '.';
     }
     $str .= '</div>';
     echo $str;
 }
 // }}}
 echo '<table border="0" cellspacing="0" cellpadding="2" class="Project">' . "\n";
 echo '<tr>' . "\n";
 echo '<th>&raquo; Summary</th>' . "\n";
 echo '<th>&raquo; License</th>' . "\n";
 echo '</tr>' . "\n";
 echo '<tr>' . "\n";
 echo '<td class="shortdesc">' . htmlspecialchars($summary) . '</td>' . "\n";
 echo '<td class="license">' . package::get_license_link($license) . '</td>' . "\n";
 echo '</tr>' . "\n";
 echo '<tr>' . "\n";
 echo '<th>&raquo; Current Release</th>' . "\n";
 if (empty($pkg['bug_link'])) {
     echo '<th>&raquo; Bug Summary</th>' . "\n";
 } else {
     echo "<th>&nbsp;</th>\n";
 }
 echo '</tr>' . "\n";
 echo '<tr>' . "\n";
 echo '<td>' . "\n";
 if (isset($versions[0])) {
     echo ' <a class="download-page" href="/package/' . htmlspecialchars($name) . '/download/">' . $versions[0] . '</a>';
     echo ' (' . $pkg['releases'][$versions[0]]['state'] . ')';
     echo ' was released on ' . format_date(strtotime($pkg['releases'][$versions[0]]['releasedate']), 'Y-m-d');
Exemplo n.º 2
0
 * PEAR: helper, contributor, developer, lead
 */
$maintainers = maintainer::getDetailled($pkg['packageid']);
//PEAR -> DOAP
$rolemap = array('helper' => 'helper', 'contributor' => 'helper', 'developer' => 'developer', 'lead' => 'maintainer');
$rolecounter = array('helper' => 0, 'developer' => 0, 'maintainer' => 0);
foreach ($maintainers as $nick => $maint) {
    $role = $rolemap[$maint['role']];
    $n = $rolecounter[$role];
    $p->{$role}[$n]->{'foaf:Person'}->{'foaf:nick'} = $nick;
    $p->{$role}[$n]->{'foaf:Person'}->{'foaf:name'} = $maint['name'];
    $p->{$role}[$n]->{'foaf:Person'}->{'foaf:homepage'}['rdf:resource'] = $maint['homepage'];
    $p->{$role}[$n]->{'foaf:Person'}->{'foaf:mbox_sha1sum'} = sha1('mailto:' . $maint['email']);
    if ($maint['longitude'] != '') {
        $p->{$role}[$n]->{'foaf:Person'}->{'foaf:based_near'}->{'geo:Point'}['geo:lat'] = $maint['latitude'];
        $p->{$role}[$n]->{'foaf:Person'}->{'foaf:based_near'}->{'geo:Point'}['geo:long'] = $maint['longitude'];
    }
    ++$rolecounter[$role];
}
//category
$p->category['rdf:resource'] = 'http://pear.php.net/packages.php' . '?catpid=' . $pkg['categoryid'] . '&catname=' . $pkg['category'];
//latest release
$latest = reset($pkg['releases']);
$version = key($pkg['releases']);
$p->release->Version->name = $latest['state'];
$p->release->Version->created = reset(explode(' ', $latest['releasedate']));
$p->release->Version->revision = $version;
$p->license['rdf:resource'] = package::get_license_link($pkg['license'], true);
$p->{'bug-database'}['rdf:resource'] = $url . '/bugs';
header('Content-Type: application/rdf+xml');
echo $x->asXML();