-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathobtain.php
More file actions
40 lines (35 loc) · 1.13 KB
/
obtain.php
File metadata and controls
40 lines (35 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
$revision = filter_var (ltrim ($_POST["revision"], 'r'), FILTER_SANITIZE_NUMBER_INT);
if (empty ($revision) || ($revision == "")) { header ("Location: /download.php"); }
include "inc/header.inc";
$source = "GH";
$description = "GitHub";
if ($_POST["source"] == "GC") {
$source = "GC";
$description = "GoogleCode";
}
$line = `grep -P "^r$revision\t" "rev-table_$source-SVN.csv"`;
$new = ltrim (substr ($line, strpos ($line, "\t") + 1), 'r');
?>
<div class="centcolumnpad">
<h2>Obtain an old revision</h2>
<?php
if ($new) {
?>
<h3>• SVN checkout:</h3>
SVN read-only access:
<div class="codescroll"><code>svn checkout -r <?php echo $new; ?> https://pencil-code.org/svn/trunk pencil-code</code></div>
SVN read & write access:
<div class="codescroll"><code>svn checkout -r <?php echo $new; ?> --username=USERNAME https://pencil-code.org/svn/trunk pencil-code</code></div>
<?php
} else {
?>
<p><font color="#e00000" style="color:red"><b>Revision <?php echo $revision; ?> not found in <?php echo $description; ?> repository.</b></font></p>
<?php
}
?>
</div>
<?php
include "inc/download.inc";
include "inc/footer.inc";
?>