Skip to content

Commit

Permalink
www/--/package-imports.php: Provide a listing of the latest package i…
Browse files Browse the repository at this point in the history
…mports
  • Loading branch information
dlangille committed Aug 23, 2024
1 parent 9bd4cc4 commit 31ca717
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions www/--/package-imports.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

# Provide a listing of the latest package imports

define('PACKAGE_FILE', "/var/db/freshports/cache/html/package-imports.txt");


if (file_exists(PACKAGE_FILE)) {
$myfile = fopen(PACKAGE_FILE, 'r');

$HTML = fread($myfile, filesize(PACKAGE_FILE));
fclose($myfile);

header("HTTP/1.1 200 OK");
$modified = date("F d Y H:i:s.", filemtime(PACKAGE_FILE));
header("Last-Modified: " . $modified);
} else {
header("HTTP/1.1 500 Internal Server Error");

$HTML = 'The required file was not found: ' . PACKAGE_FILE;
}

?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/plain charset=UTF-8">
</head>
<body>

<pre>

<?php

echo $HTML;

?>

</pre>
</body>
</html>

0 comments on commit 31ca717

Please sign in to comment.