new package listing
[pharext/replicator.pharext.org] / public / html.php
1 <?php
2 const INCLUDED = __FILE__;
3
4 require_once "index.php";
5
6 ob_start($res);
7
8 ?>
9 <!doctype html>
10 <html>
11 <head>
12 <meta charset="utf-8">
13 <title>Replicator</title>
14 <link rel="stylesheet" href="concise/css/concise.min.css">
15 <link href="//fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet" type="text/css">
16 <meta name="viewport" content="width=device-width, initial-scale=1">
17 <style>
18 body {
19 padding-bottom: 2em;
20 padding-top: 7em;
21 }
22 .header {
23 top: 0;
24 width: 100%;
25 }
26 .footer {
27 bottom: 0;
28 width: 100%;
29 text-align: center;
30 font-size: .9em;
31 }
32 .header, .footer {
33 position: fixed;
34 box-shadow: 0px 0px .8em .4em #89a;
35 background: #62B3E7;
36 padding: .5em 0;
37 }
38 .header h1 {
39 font-weight: bold;
40 }
41 .header h1 a, .footer a:hover {
42 text-decoration: none;
43 }
44 .header h1 a:hover {
45 text-decoration: underline;
46 }
47 .header h1 a {
48 /* normalize browser difference */
49 font-size: 1.3em;
50 }
51 .header h1 a, .footer, .footer a {
52 color: #fdfdfd;
53 text-shadow: grey 0 0 .1em;
54 }
55 .header h1 small {
56 color: #666;
57 font-size: 1.3rem;
58 text-shadow: white 0 0 .2em;
59 }
60 li {
61 list-style-type: circle;
62 }
63 pre.publickey {
64 font-size: .8rem;
65 line-height: 1rem;
66 }
67 pre.code {
68 background: #333;
69 color: #62B3E7;
70 padding: 0 1.5em 1.5em 1em;
71 border-radius: 4px;
72 margin-right: 2em;
73 display: inline-block;
74 }
75 pre.code>code {
76 font-size: .9rem;
77 }
78 .row>h3 {
79 margin-bottom: 0;
80 }
81 @media(max-width: 80em) {
82 .column-8 {
83 float: none;
84 width: auto;
85 }
86 }
87 </style>
88 </head>
89 <body>
90 <div class="header">
91 <header>
92 <h1 class="container">
93 <a href="?">Replicator</a><br>
94 <small>Replicating PECL releases as pharext packages since 2015</small>
95 </h1>
96 <a href="https://github.com/m6w6/replicator"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>
97 </header>
98 </div>
99 <div class="container">
100
101 <?php if (!empty($package)) : $versions = package_versions($package); ?>
102
103 <h2><?= htmlspecialchars($package) ?></h2>
104 <table class="table table-full">
105 <thead>
106 <tr>
107 <th class="text-left" colspan="2">Package</th>
108 <th class="text-left" colspan="<?= count(SIGS) ?>">Signatures</th>
109 <th class="text-left">Date</th>
110 <th class="text-right">Pharext</th>
111 </tr>
112 </thead>
113 <tbody>
114
115 <?php foreach (array_reverse($versions) as $version => $phars) : ?>
116 <?php foreach (array_map("array_values", $phars) as $ext => list($phar, $date, $size, $pharext)) : ?>
117 <tr>
118 <?php if (empty($ext)) : ?>
119 <td class="text-left" rowspan="<?= count($phars) ?>">
120 <?= htmlspecialchars($package) ?>
121 <?= htmlspecialchars($version) ?>
122 </td>
123 <?php endif ?>
124
125 <td class="text-left">
126 &#10507;&nbsp;<a href="<?= htmlspecialchars($phar) ?>"
127 download>phar<?= htmlspecialchars($ext) ?></a>&nbsp;<small>(<?= human_size($size) ?>)</small><br>
128 </td>
129 <?php foreach (SIGS as $typ => $sig) : ?>
130 <td>
131 #&nbsp;<a href="<?= sigof($phar, $sig) ?>" download><?= "$typ.$sig" ?></a>
132 </td>
133 <?php endforeach; ?>
134 <td class="text-left">
135 <?= human_date($date); ?>
136
137 </td>
138 <td class="text-right <?= version_compare($pharext, "3.0.1", "<") ? "color-red":"" ?>">
139 v<?= $pharext ?>
140 </td>
141 </tr>
142 <?php endforeach; ?>
143 <?php endforeach; ?>
144
145 </tbody>
146 </table>
147 <?php else: ?>
148
149 <h2>Available Packages</h2>
150 <ul class="list-inline">
151 <?php foreach (array_map("htmlspecialchars", $packages) as $index => $pkg) : ?>
152 <?php $next = strtolower($pkg{0}); ?>
153 <?php if (isset($prev) && $next != $prev) : ?>
154
155 </ul>
156 <ul class="list-inline">
157 <?php endif; ?>
158
159 <li><a href="?<?= $pkg ?>"><?= $pkg ?></a></li>
160 <?php $prev = $next; ?>
161 <?php endforeach; ?>
162
163 </ul>
164 <?php endif; ?>
165 <hr>
166 <div class="row">
167 <?php if (empty($package)) : ?>
168 <h3>Public keys</h3>
169 <?php else : list($phar) = array_values(current(end($versions))); ?>
170 <h3>Download latest version and signatures:</h3>
171 <div class="column-16">
172 <pre class="code fit-code"><code>
173 curl -sS \
174 -O https://replicator.pharext.org/<?= htmlspecialchars($phar) ?><?php foreach (SIGS as $sig) : ?> \
175 -O https://replicator.pharext.org/<?= htmlspecialchars(sigof($phar, $sig)) ?><?php endforeach; ?></code></pre>
176 </div>
177 </div>
178 <div class="row">
179 <h3>Verify with a public key:</h3>
180 <?php endif; ?>
181
182 <div class="column-8">
183 <h4>RSA <small><a href="replicator.pub" download>replicator.pub</a></small></h4>
184 <?php if (!empty($phar)) : ?>
185 <pre class="code"><code>
186 curl -sSO https://replicator.pharext.org/replicator.pub
187
188 openssl dgst \
189 -verify replicator.pub \
190 -signature <?= htmlspecialchars(basename($phar)).".sig" ?> \
191 <?= htmlspecialchars(basename($phar)) ?></code></pre>
192 <?php endif; ?>
193 <pre class="publickey"><?php readfile("./replicator.pub") ?></pre>
194 </div>
195 <div class="column-8">
196 <h4>OpenPGP <small><a href="4093AEF6.pub" download>4093AEF6.pub</a></small></h4>
197 <?php if (!empty($phar)) : ?>
198 <pre class="code"><code>
199 curl -sSO https://replicator.pharext.org/4093AEF6.pub
200
201 gpg --import 4093AEF6.pub
202
203 gpg --verify <?= htmlspecialchars(basename($phar)).".asc" ?> \
204 <?= htmlspecialchars(basename($phar)) ?></code></pre>
205 <?php endif; ?>
206 <pre class="publickey"><?php readfile("./4093AEF6.pub") ?></pre>
207 </div>
208 </div>
209 </div>
210 <div class="footer">
211 <footer>
212 &copy; 2015 <a href="https://m6w6.name">m6w6</a>, Michael Wallner &mdash; Powered by <a href="//github.com/m6w6/pharext">pharext
213 <?php
214 require_once "../vendor/autoload.php";
215 printf("v%s\n", pharext\Metadata::version());
216 ?>
217 </a>
218 </footer>
219 </div>
220 </body>
221 </html>
222 <?php
223 $res->send();
224 ?>