Esempio n. 1
0
$page = '';
$page_size = '';
if (isset($_GET['message_id'])) {
    $message_id = pg_escape_string($_GET['message_id']);
}
if (isset($_GET['commit_id'])) {
    $commit_id = pg_escape_string($_GET['commit_id']);
}
if (isset($_GET['revision'])) {
    $revision = pg_escape_string($_GET['revision']);
}
# I'm quite sure we use only message_id, and never commit_id.
if ($message_id != '') {
    require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/commit.php';
    $Commit = new Commit($db);
    $Commit->FetchByMessageId($message_id);
    freshports_ConditionalGet($Commit->last_modified);
} else {
    if ($revision != '') {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/commit.php';
        $Commit = new Commit($db);
        // Get the message IDs for this revision
        $message_id_array = $Commit->FetchByRevision($revision);
        if (count($message_id_array) == 1) {
            header('Location: /commit.php?message_id=' . $message_id_array[0]);
            exit;
        }
        freshports_ConditionalGet($Commit->last_modified);
        if ($Debug) {
            echo 'oh... got something back there: <pre>' . print_r($message_id_array, true) . '</pre>';
        }
Esempio n. 2
0
The short description is encoded as ISO-8859-15.  The commit is encoded
as UTF-8.

<p>
The short description is obtained from a "make -V COMMENT".

<p>
The commit messages arrives via an XML file encoded with ISO-8859-1.

<h2>Test iconv output</h2>

<?php 
$str = "Full-screen task manager similar to Exposé(tm)";
echo "<p>{$str}</p>\n";
echo "<p>" . iconv("ISO-8859-15", "UTF-8", $str) . "</p>\n";
echo "<p>" . htmlentities($str) . "</p>\n";
$str = "Antônio Carlos Venâncio Júnior";
echo "<p>{$str}</p>\n";
echo "<p>" . iconv("ISO-8859-1", "UTF-8", $str) . "</p>\n";
echo "<p>" . htmlentities($str) . "</p>\n";
$Commit = new Commit($db);
$Commit->FetchByMessageId('*****@*****.**');
echo "<pre>{$Commit->commit_description}</pre>\n";
$Port = new Port($db);
$Port->Fetch('deskutils', 'kompose');
echo "<pre>{$Port->short_description}</pre>\n";
echo "<pre>" . iconv("ISO-8859-15", "UTF-8", $Port->short_description) . "</pre>\n";
?>
The end
</body>
</head>