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">
22 <meta name
="color-scheme" content
="dark light">
46 .header h1 a
, .footer a
:hover
{
47 text
-decoration
: none
;
50 text
-decoration
: underline
;
53 /* normalize browser difference */
60 list-style
-type
: circle
;
69 padding
: 0 1.5em
1.5em
1em
;
72 display
: inline
-block
;
83 @media
(max
-width
: 80em
) {
89 .old
-version
, #new-toggle {
92 p
.package
-description
, div
.package
-description p
{
93 white
-space
: pre
-line
;
100 display
: inline
-block
;
105 vertical
-align
: middle
;
107 form input
[type
=reset
] {
111 box
-shadow
: 0px
0px
.8em
.4em
#89a;
114 .header h1 a
, .footer
, .footer a
{
116 text
-shadow
: grey
0 0 .1em
;
120 text
-shadow
: white
0 0 .2em
;
122 @media
(prefers
-color
-scheme
: dark
) {
124 box
-shadow
: 0px
0px
.8em
.4em
#123;
127 .header h1 a
, .footer
, .footer a
{
129 text
-shadow
: dimgrey
0 0 .1em
;
133 text
-shadow
: black
0 0 .2em
;
135 body
, h2
, h3
, h4
, h5
, h6
{
145 <h1
class="container">
146 <a href
="?">Replicator
</a
><br
>
147 <small
>Replicating PECL releases
as pharext packages since
2015</small
>
149 <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
>
152 <div
class="container">
154 <?php
if (!empty($package)) : $versions = package_versions($package); $info = package_info($package); ?
>
156 <h2
><?
= htmlspecialchars($package) ?
></h2
>
157 <?php
if ($info) : ?
>
158 <h3
><?
= htmlspecialchars($info["title"]) ?
><br
>
159 <small
>License
: <?
= htmlspecialchars($info["license"]) ?
><br
>
160 <a href
="//pecl.php.net/package/<?= htmlspecialchars($package) ?>">View at PECL
</a
></small
></h3
>
161 <?php
if (extension_loaded("discount")) : ?
>
162 <div
class="package-description">
164 $md = MarkdownDocument
::createFromString($info["description"]);
165 $md->compile( MarkdownDocument
::AUTOLINK |
166 MarkdownDocument
::ONE_COMPAT
);
171 <p
class="package-description">
172 <?
= htmlspecialchars($info["description"]) ?
>
176 <table
class="table table-full versions">
179 <th
class="text-left" colspan
="2">Package
</th
>
180 <th
class="text-left" colspan
="<?= count(SIGS) ?>">Signatures
</th
>
181 <th
class="text-left">Date
</th
>
182 <th
class="text-right">Pharext
</th
>
187 <?php
$i = 0; foreach (array_reverse($versions) as $version => $phars) : ++
$i; ?
>
188 <?php
foreach (array_map("array_values", $phars) as $ext => list($phar, $date, $size, $pharext)) : ?
>
189 <tr
<?php
if ($i > NCURRENT
) : ?
>class="old-version"<?php
endif; ?
> <?php
if ($i === NCURRENT
) : ?
>id
="old"<?php
endif; ?
>>
190 <?php
if (empty($ext)) : ?
>
191 <td
class="text-left" rowspan
="<?= count($phars) ?>">
192 <?
= htmlspecialchars($package) ?
>
193 <?
= htmlspecialchars($version) ?
>
197 <td
class="text-left">
198 ⤋ <a href="<?= htmlspecialchars($phar) ?>"
199 download
>phar
<?
= htmlspecialchars($ext) ?
></a
> 
;<small
>(<?
= human_size($size) ?
>)</small
><br
>
201 <?php
foreach (SIGS
as $typ => $sig) : ?
>
203 # <a href="<?= sigof($phar, $sig) ?>" download><?= "$typ.$sig" ?></a>
206 <td
class="text-left">
207 <?
= human_date($date); ?
>
210 <td
class="text-right <?= version_compare($pharext, "3.0.1", "<") ? "color
-red
":"" ?>">
219 <?php
if ($i >= 3) : ?
>
221 <a id
="old-toggle" href
="#old" onclick
="toggleOldVersions(this)">Show
222 <?
=count($versions)-NCURRENT?
> older
version(s
) »
;</a
>
223 <a id
="new-toggle" href
="#" onclick
="toggleOldVersions(this)">Show
224 less versions
«
;</a
>
230 <h2
>Available Packages
</h2
>
231 <form name
="search"></form
>
232 <ul
class="list-inline package-list">
233 <?php
foreach (array_map("htmlspecialchars", $packages) as $index => $pkg) : ?
>
234 <?php
$next = strtolower($pkg[0]); ?
>
235 <?php
if (isset($prev) && $next != $prev) : ?
>
238 <ul
class="list-inline package-list">
241 <li id
="<?= strtolower($pkg) ?>"><a href
="?<?= $pkg ?>"><?
= $pkg ?
></a
></li
>
242 <?php
$prev = $next; ?
>
249 <?php
if (empty($package)) : ?
>
251 <?php
else : list($phar) = array_values(current(end($versions))); ?
>
252 <h3
>Download latest version
and signatures
:</h3
>
253 <div
class="column-16">
254 <pre
class="code fit-code"><code
>
256 -O https
://replicator.pharext.org/<?= htmlspecialchars($phar) ?><?php foreach (SIGS as $sig) : ?> \
257 -O https
://replicator.pharext.org/<?= htmlspecialchars(sigof($phar, $sig)) ?><?php endforeach; ?></code></pre>
261 <h3
>Verify with a
public key
:</h3
>
264 <div
class="column-8">
265 <h4
>RSA
<small
><a href
="replicator.pub" download
>replicator
.pub
</a
></small
></h4
>
266 <?php
if (!empty($phar)) : ?
>
267 <pre
class="code"><code
>
268 curl
-sSO https
://replicator.pharext.org/replicator.pub
271 -verify replicator
.pub \
272 -signature
<?
= htmlspecialchars(basename($phar)).".sig" ?
> \
273 <?
= htmlspecialchars(basename($phar)) ?
></code
></pre
>
275 <pre
class="publickey"><?php
readfile("./replicator.pub") ?
></pre
>
277 <div
class="column-8">
278 <h4
>OpenPGP
<small
><a href
="4093AEF6.pub" download
>4093AEF6
.pub
</a
></small
></h4
>
279 <?php
if (!empty($phar)) : ?
>
280 <pre
class="code"><code
>
281 curl
-sSO https
://replicator.pharext.org/4093AEF6.pub
283 gpg
--import
4093AEF6
.pub
285 gpg
--verify
<?
= htmlspecialchars(basename($phar)).".asc" ?
> \
286 <?
= htmlspecialchars(basename($phar)) ?
></code
></pre
>
288 <pre
class="publickey"><?php
readfile("./4093AEF6.pub") ?
></pre
>
294 ©
; 2015 <a href
="https://m6w6.name">m6w6
</a
>, Michael Wallner
&mdash
; Powered by
<a href
="//github.com/m6w6/pharext">pharext
296 require_once "../vendor/autoload.php";
297 printf("v%s\n", pharext\Metadata
::version());
302 <script type
="text/javascript">
303 function searchPackages(search
, regex
) {
304 console
.log("searchPackages", search
, regex
);
305 document
.querySelectorAll("ul.package-list li").forEach(function(li
) {
307 if (li
.id
.match(search
.toLowerCase())) {
308 li
.style
.removeProperty("display");
310 li
.style
.display
= "none";
313 if (li
.id
.startsWith(search
.toLowerCase())) {
314 li
.style
.removeProperty("display");
316 li
.style
.display
= "none";
322 document
.body
.onload
= function() {
323 var form
= document
.querySelector("form[name=search]");
327 var input
= document
.createElement("input");
328 var reset
= document
.createElement("input");
329 var prefix_label
= document
.createElement("label");
330 var prefix
= document
.createElement("input");
331 var regex_label
= document
.createElement("label");
332 var regex
= document
.createElement("input");
334 form
.onreset
= function() {
335 searchPackages("", false);
339 input
.autocomplete
= "off";
341 input
.type
= "search";
342 input
.placeholder
= "Search...";
343 input
.oninput
= function() {
344 searchPackages(input
.value
, regex
.checked
);
346 input
.style
.paddingRight
= "4ch";
347 form
.appendChild(input
);
351 reset
.type
= "reset";
353 reset
.title
= "Reset";
354 reset
.style
.marginLeft
= "-4ch";
355 reset
.style
.marginRight
= "4ch";
356 reset
.style
.border
= "none";
357 reset
.style
.background
= "transparent";
358 form
.appendChild(reset
);
360 prefix
.id
= "prefix";
362 prefix
.value
= "prefix";
363 prefix
.type
= "radio";
364 prefix
.defaultChecked
= true;
365 prefix
.checked
= true;
366 prefix
.onchange
= function() {
367 searchPackages(input
.value
, regex
.checked
);
369 //form.appendChild(prefix);
370 prefix_label
.innerText
= "by Prefix";
371 prefix_label
.appendChild(prefix
);
372 form
.appendChild(prefix_label
);
376 regex
.value
= "regex";
377 regex
.type
= "radio";
378 regex
.checked
= false;
379 regex
.onchange
= function() {
380 searchPackages(input
.value
, regex
.checked
);
382 //form.appendChild(regex);
383 regex_label
.innerText
= "by RegExp";
384 regex_label
.appendChild(regex
);
385 form
.appendChild(regex_label
);
387 form
.after(document
.createElement("HR"));
392 function toggleOldVersions(a
) {
393 var nodes
, row_style
;
395 if (a
.hash
.substring(1) === "old") {
396 row_style
= "table-row";
397 document
.getElementById("old-toggle").style
.display
= "none";
398 document
.getElementById("new-toggle").style
.display
= "inline";
401 document
.getElementById("old-toggle").style
.display
= "inline";
402 document
.getElementById("new-toggle").style
.display
= "none";
405 nodes
= document
.querySelectorAll("table.versions>tbody>tr.old-version");
407 for (var i
= 0; i
< nodes
.length
; ++i
) {
408 nodes
.item(i
).style
.display
= row_style
;