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 p
.package
-description
, div
.package
-description p
{
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"]) ?
><br
>
129 <a href
="//pecl.php.net/package/<?= htmlspecialchars($package) ?>">View at PECL
</a
></small
></h3
>
130 <?php
if (extension_loaded("discount")) : ?
>
131 <div
class="package-description">
133 $md = MarkdownDocument
::createFromString($info["description"]);
134 $md->compile( MarkdownDocument
::AUTOLINK |
135 MarkdownDocument
::ONE_COMPAT
);
140 <p
class="package-description">
141 <?
= htmlspecialchars($info["description"]) ?
>
145 <table
class="table table-full versions">
148 <th
class="text-left" colspan
="2">Package
</th
>
149 <th
class="text-left" colspan
="<?= count(SIGS) ?>">Signatures
</th
>
150 <th
class="text-left">Date
</th
>
151 <th
class="text-right">Pharext
</th
>
156 <?php
$i = 0; foreach (array_reverse($versions) as $version => $phars) : ++
$i; ?
>
157 <?php
foreach (array_map("array_values", $phars) as $ext => list($phar, $date, $size, $pharext)) : ?
>
158 <tr
<?php
if ($i > NCURRENT
) : ?
>class="old-version"<?php
endif; ?
> <?php
if ($i === NCURRENT
) : ?
>id
="old"<?php
endif; ?
>>
159 <?php
if (empty($ext)) : ?
>
160 <td
class="text-left" rowspan
="<?= count($phars) ?>">
161 <?
= htmlspecialchars($package) ?
>
162 <?
= htmlspecialchars($version) ?
>
166 <td
class="text-left">
167 ⤋ <a href="<?= htmlspecialchars($phar) ?>"
168 download
>phar
<?
= htmlspecialchars($ext) ?
></a
> 
;<small
>(<?
= human_size($size) ?
>)</small
><br
>
170 <?php
foreach (SIGS
as $typ => $sig) : ?
>
172 # <a href="<?= sigof($phar, $sig) ?>" download><?= "$typ.$sig" ?></a>
175 <td
class="text-left">
176 <?
= human_date($date); ?
>
179 <td
class="text-right <?= version_compare($pharext, "3.0.1", "<") ? "color
-red
":"" ?>">
188 <?php
if ($i >= 3) : ?
>
190 <a id
="old-toggle" href
="#old" onclick
="toggleOldVersions(this)">Show
191 <?
=count($versions)-NCURRENT?
> older
version(s
) »
;</a
>
192 <a id
="new-toggle" href
="#" onclick
="toggleOldVersions(this)">Show
193 less versions
«
;</a
>
198 <h2
>Available Packages
</h2
>
199 <form name
="search"></form
>
200 <ul
class="list-inline package-list">
201 <?php
foreach (array_map("htmlspecialchars", $packages) as $index => $pkg) : ?
>
202 <?php
$next = strtolower($pkg[0]); ?
>
203 <?php
if (isset($prev) && $next != $prev) : ?
>
206 <ul
class="list-inline package-list">
209 <li id
="<?= strtolower($pkg) ?>"><a href
="?<?= $pkg ?>"><?
= $pkg ?
></a
></li
>
210 <?php
$prev = $next; ?
>
217 <?php
if (empty($package)) : ?
>
219 <?php
else : list($phar) = array_values(current(end($versions))); ?
>
220 <h3
>Download latest version
and signatures
:</h3
>
221 <div
class="column-16">
222 <pre
class="code fit-code"><code
>
224 -O https
://replicator.pharext.org/<?= htmlspecialchars($phar) ?><?php foreach (SIGS as $sig) : ?> \
225 -O https
://replicator.pharext.org/<?= htmlspecialchars(sigof($phar, $sig)) ?><?php endforeach; ?></code></pre>
229 <h3
>Verify with a
public key
:</h3
>
232 <div
class="column-8">
233 <h4
>RSA
<small
><a href
="replicator.pub" download
>replicator
.pub
</a
></small
></h4
>
234 <?php
if (!empty($phar)) : ?
>
235 <pre
class="code"><code
>
236 curl
-sSO https
://replicator.pharext.org/replicator.pub
239 -verify replicator
.pub \
240 -signature
<?
= htmlspecialchars(basename($phar)).".sig" ?
> \
241 <?
= htmlspecialchars(basename($phar)) ?
></code
></pre
>
243 <pre
class="publickey"><?php
readfile("./replicator.pub") ?
></pre
>
245 <div
class="column-8">
246 <h4
>OpenPGP
<small
><a href
="4093AEF6.pub" download
>4093AEF6
.pub
</a
></small
></h4
>
247 <?php
if (!empty($phar)) : ?
>
248 <pre
class="code"><code
>
249 curl
-sSO https
://replicator.pharext.org/4093AEF6.pub
251 gpg
--import
4093AEF6
.pub
253 gpg
--verify
<?
= htmlspecialchars(basename($phar)).".asc" ?
> \
254 <?
= htmlspecialchars(basename($phar)) ?
></code
></pre
>
256 <pre
class="publickey"><?php
readfile("./4093AEF6.pub") ?
></pre
>
262 ©
; 2015 <a href
="https://m6w6.name">m6w6
</a
>, Michael Wallner
&mdash
; Powered by
<a href
="//github.com/m6w6/pharext">pharext
264 require_once "../vendor/autoload.php";
265 printf("v%s\n", pharext\Metadata
::version());
270 <script type
="text/javascript">
271 function searchPackages(search
, regex
) {
272 console
.log("searchPackages", search
, regex
);
273 document
.querySelectorAll("ul.package-list li").forEach(function(li
) {
275 if (li
.id
.match(search
.toLowerCase())) {
276 li
.style
.removeProperty("display");
278 li
.style
.display
= "none";
281 if (li
.id
.startsWith(search
.toLowerCase())) {
282 li
.style
.removeProperty("display");
284 li
.style
.display
= "none";
290 document
.body
.onload
= function() {
291 var form
= document
.querySelector("form[name=search]");
292 var input
= document
.createElement("input");
293 var reset
= document
.createElement("input");
294 var prefix_label
= document
.createElement("label");
295 var prefix
= document
.createElement("input");
296 var regex_label
= document
.createElement("label");
297 var regex
= document
.createElement("input");
299 form
.onreset
= function() {
300 searchPackages("", false);
304 input
.autocomplete
= "off";
306 input
.type
= "search";
307 input
.placeholder
= "Search...";
308 input
.oninput
= function() {
309 searchPackages(input
.value
, regex
.checked
);
311 input
.style
.paddingRight
= "4ch";
312 form
.appendChild(input
);
316 reset
.type
= "reset";
318 reset
.title
= "Reset";
319 reset
.style
.marginLeft
= "-4ch";
320 reset
.style
.marginRight
= "4ch";
321 reset
.style
.border
= "none";
322 reset
.style
.background
= "transparent";
323 form
.appendChild(reset
);
325 prefix
.id
= "prefix";
327 prefix
.value
= "prefix";
328 prefix
.type
= "radio";
329 prefix
.defaultChecked
= true;
330 prefix
.checked
= true;
331 prefix
.onchange
= function() {
332 searchPackages(input
.value
, regex
.checked
);
334 //form.appendChild(prefix);
335 prefix_label
.innerText
= "by Prefix";
336 prefix_label
.appendChild(prefix
);
337 form
.appendChild(prefix_label
);
341 regex
.value
= "regex";
342 regex
.type
= "radio";
343 regex
.checked
= false;
344 regex
.onchange
= function() {
345 searchPackages(input
.value
, regex
.checked
);
347 //form.appendChild(regex);
348 regex_label
.innerText
= "by RegExp";
349 regex_label
.appendChild(regex
);
350 form
.appendChild(regex_label
);
355 function toggleOldVersions(a
) {
356 var nodes
, row_style
;
358 if (a
.hash
.substring(1) === "old") {
359 row_style
= "table-row";
360 document
.getElementById("old-toggle").style
.display
= "none";
361 document
.getElementById("new-toggle").style
.display
= "inline";
364 document
.getElementById("old-toggle").style
.display
= "inline";
365 document
.getElementById("new-toggle").style
.display
= "none";
368 nodes
= document
.querySelectorAll("table.versions>tbody>tr.old-version");
370 for (var i
= 0; i
< nodes
.length
; ++i
) {
371 nodes
.item(i
).style
.display
= row_style
;