2 const INCLUDED
= __FILE__
;
5 $css = "concise/css/concise.min.css";
6 $fnt = "//fonts.googleapis.com/css?family=Droid+Sans";
8 require_once "index.php";
11 $res->addHeader("Link", "<" . dirname((new http\Env\Url
)->path
) . $css . ">; rel=preload; as=style");
17 <meta charset
="utf-8">
18 <title
>Replicator
</title
>
19 <link rel
="stylesheet" href
="<?=$css?>">
20 <link rel
="stylesheet" href
="<?=$fnt?>">
21 <meta name
="viewport" content
="width=device-width, initial-scale=1">
39 box
-shadow
: 0px
0px
.8em
.4em
#89a;
46 .header h1 a
, .footer a
:hover
{
47 text
-decoration
: none
;
50 text
-decoration
: underline
;
53 /* normalize browser difference */
56 .header h1 a
, .footer
, .footer a
{
58 text
-shadow
: grey
0 0 .1em
;
63 text
-shadow
: white
0 0 .2em
;
66 list-style
-type
: circle
;
75 padding
: 0 1.5em
1.5em
1em
;
78 display
: inline
-block
;
86 @media
(max
-width
: 80em
) {
92 .old
-version
, #new-toggle {
95 .package
-description
{
96 white
-space
: pre
-line
;
99 display
: inline
-block
;
104 vertical
-align
: middle
;
106 form input
[type
=reset
] {
114 <h1
class="container">
115 <a href
="?">Replicator
</a
><br
>
116 <small
>Replicating PECL releases
as pharext packages since
2015</small
>
118 <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
>
121 <div
class="container">
123 <?php
if (!empty($package)) : $versions = package_versions($package); $info = package_info($package); ?
>
125 <h2
><?
= htmlspecialchars($package) ?
></h2
>
126 <?php
if ($info) : ?
>
127 <h3
><?
= htmlspecialchars($info["title"]) ?
><br
>
128 <small
>License
: <?
= htmlspecialchars($info["license"]) ?
></small
></h3
>
129 <p
class="package-description"><?
= htmlspecialchars($info["description"]) ?
></p
>
131 <table
class="table table-full versions">
134 <th
class="text-left" colspan
="2">Package
</th
>
135 <th
class="text-left" colspan
="<?= count(SIGS) ?>">Signatures
</th
>
136 <th
class="text-left">Date
</th
>
137 <th
class="text-right">Pharext
</th
>
142 <?php
$i = 0; foreach (array_reverse($versions) as $version => $phars) : ++
$i; ?
>
143 <?php
foreach (array_map("array_values", $phars) as $ext => list($phar, $date, $size, $pharext)) : ?
>
144 <tr
<?php
if ($i > NCURRENT
) : ?
>class="old-version"<?php
endif; ?
> <?php
if ($i === NCURRENT
) : ?
>id
="old"<?php
endif; ?
>>
145 <?php
if (empty($ext)) : ?
>
146 <td
class="text-left" rowspan
="<?= count($phars) ?>">
147 <?
= htmlspecialchars($package) ?
>
148 <?
= htmlspecialchars($version) ?
>
152 <td
class="text-left">
153 ⤋ <a href="<?= htmlspecialchars($phar) ?>"
154 download
>phar
<?
= htmlspecialchars($ext) ?
></a
> 
;<small
>(<?
= human_size($size) ?
>)</small
><br
>
156 <?php
foreach (SIGS
as $typ => $sig) : ?
>
158 # <a href="<?= sigof($phar, $sig) ?>" download><?= "$typ.$sig" ?></a>
161 <td
class="text-left">
162 <?
= human_date($date); ?
>
165 <td
class="text-right <?= version_compare($pharext, "3.0.1", "<") ? "color
-red
":"" ?>">
174 <?php
if ($i >= 3) : ?
>
176 <a id
="old-toggle" href
="#old" onclick
="toggleOldVersions(this)">Show
177 <?
=count($versions)-NCURRENT?
> older
version(s
) »
;</a
>
178 <a id
="new-toggle" href
="#" onclick
="toggleOldVersions(this)">Show
179 less versions
«
;</a
>
184 <h2
>Available Packages
</h2
>
185 <form name
="search"></form
>
186 <ul
class="list-inline package-list">
187 <?php
foreach (array_map("htmlspecialchars", $packages) as $index => $pkg) : ?
>
188 <?php
$next = strtolower($pkg{0}); ?
>
189 <?php
if (isset($prev) && $next != $prev) : ?
>
192 <ul
class="list-inline package-list">
195 <li id
="<?= strtolower($pkg) ?>"><a href
="?<?= $pkg ?>"><?
= $pkg ?
></a
></li
>
196 <?php
$prev = $next; ?
>
203 <?php
if (empty($package)) : ?
>
205 <?php
else : list($phar) = array_values(current(end($versions))); ?
>
206 <h3
>Download latest version
and signatures
:</h3
>
207 <div
class="column-16">
208 <pre
class="code fit-code"><code
>
210 -O https
://replicator.pharext.org/<?= htmlspecialchars($phar) ?><?php foreach (SIGS as $sig) : ?> \
211 -O https
://replicator.pharext.org/<?= htmlspecialchars(sigof($phar, $sig)) ?><?php endforeach; ?></code></pre>
215 <h3
>Verify with a
public key
:</h3
>
218 <div
class="column-8">
219 <h4
>RSA
<small
><a href
="replicator.pub" download
>replicator
.pub
</a
></small
></h4
>
220 <?php
if (!empty($phar)) : ?
>
221 <pre
class="code"><code
>
222 curl
-sSO https
://replicator.pharext.org/replicator.pub
225 -verify replicator
.pub \
226 -signature
<?
= htmlspecialchars(basename($phar)).".sig" ?
> \
227 <?
= htmlspecialchars(basename($phar)) ?
></code
></pre
>
229 <pre
class="publickey"><?php
readfile("./replicator.pub") ?
></pre
>
231 <div
class="column-8">
232 <h4
>OpenPGP
<small
><a href
="4093AEF6.pub" download
>4093AEF6
.pub
</a
></small
></h4
>
233 <?php
if (!empty($phar)) : ?
>
234 <pre
class="code"><code
>
235 curl
-sSO https
://replicator.pharext.org/4093AEF6.pub
237 gpg
--import
4093AEF6
.pub
239 gpg
--verify
<?
= htmlspecialchars(basename($phar)).".asc" ?
> \
240 <?
= htmlspecialchars(basename($phar)) ?
></code
></pre
>
242 <pre
class="publickey"><?php
readfile("./4093AEF6.pub") ?
></pre
>
248 ©
; 2015 <a href
="https://m6w6.name">m6w6
</a
>, Michael Wallner
&mdash
; Powered by
<a href
="//github.com/m6w6/pharext">pharext
250 require_once "../vendor/autoload.php";
251 printf("v%s\n", pharext\Metadata
::version());
256 <script type
="text/javascript">
257 function searchPackages(search
, regex
) {
258 console
.log("searchPackages", search
, regex
);
259 document
.querySelectorAll("ul.package-list li").forEach(function(li
) {
261 if (li
.id
.match(search
.toLowerCase())) {
262 li
.style
.removeProperty("display");
264 li
.style
.display
= "none";
267 if (li
.id
.startsWith(search
.toLowerCase())) {
268 li
.style
.removeProperty("display");
270 li
.style
.display
= "none";
276 document
.body
.onload
= function() {
277 var form
= document
.querySelector("form[name=search]");
278 var input
= document
.createElement("input");
279 var reset
= document
.createElement("input");
280 var prefix_label
= document
.createElement("label");
281 var prefix
= document
.createElement("input");
282 var regex_label
= document
.createElement("label");
283 var regex
= document
.createElement("input");
285 form
.onreset
= function() {
286 searchPackages("", false);
290 input
.autocomplete
= "off";
292 input
.type
= "search";
293 input
.placeholder
= "Search...";
294 input
.oninput
= function() {
295 searchPackages(input
.value
, regex
.checked
);
297 input
.style
.paddingRight
= "4ch";
298 form
.appendChild(input
);
302 reset
.type
= "reset";
304 reset
.title
= "Reset";
305 reset
.style
.marginLeft
= "-4ch";
306 reset
.style
.marginRight
= "4ch";
307 reset
.style
.border
= "none";
308 reset
.style
.background
= "transparent";
309 form
.appendChild(reset
);
311 prefix
.id
= "prefix";
313 prefix
.value
= "prefix";
314 prefix
.type
= "radio";
315 prefix
.defaultChecked
= true;
316 prefix
.checked
= true;
317 prefix
.onchange
= function() {
318 searchPackages(input
.value
, regex
.checked
);
320 //form.appendChild(prefix);
321 prefix_label
.innerText
= "by Prefix";
322 prefix_label
.appendChild(prefix
);
323 form
.appendChild(prefix_label
);
327 regex
.value
= "regex";
328 regex
.type
= "radio";
329 regex
.checked
= false;
330 regex
.onchange
= function() {
331 searchPackages(input
.value
, regex
.checked
);
333 //form.appendChild(regex);
334 regex_label
.innerText
= "by RegExp";
335 regex_label
.appendChild(regex
);
336 form
.appendChild(regex_label
);
341 function toggleOldVersions(a
) {
342 var nodes
, row_style
;
344 if (a
.hash
.substring(1) === "old") {
345 row_style
= "table-row";
346 document
.getElementById("old-toggle").style
.display
= "none";
347 document
.getElementById("new-toggle").style
.display
= "inline";
350 document
.getElementById("old-toggle").style
.display
= "inline";
351 document
.getElementById("new-toggle").style
.display
= "none";
354 nodes
= document
.querySelectorAll("table.versions>tbody>tr.old-version");
356 for (var i
= 0; i
< nodes
.length
; ++i
) {
357 nodes
.item(i
).style
.display
= row_style
;