display pharext version
[m6w6/replicator] / public / index.php
index 39d24c07a39cf1986ef57d2a5ff0fbcf93752779..f132afb1ac77265ea3203ac59a45c48ebdd0db47 100644 (file)
@@ -9,14 +9,20 @@
                <style>
                        body {
                                padding-bottom: 4em;
+                               padding-top: 10em;
+                       }
+                       .header {
+                               top: 0;
+                               width: 100%;
                        }
                        .footer {
                                bottom: 0;
-                               position: fixed;
                                width: 100%;
                                text-align: center;
                        }
                        .header, .footer {
+                               position: fixed;
+                               box-shadow: 0px 0px 1em .4em #89a;
                                background: #62B3E7;
                                padding: 1em 0;
                        }
                        .header h1 a:hover {
                                text-decoration: underline;
                        }
-                       .header h1 big , .footer, .footer a {
+                       .header h1 big {
+                               /* normalize browser difference */
+                               font-size: 1.8em;
+                       }
+                       .header h1 big, .footer, .footer a {
                                color: #fdfdfd;
                                text-shadow: grey 0 0 .1em;
                        }
                        </header>
                </div>
                <div class="container">
-                       <?php $packages = array_map("basename", glob("phars/*")); ?>
+                       <?php 
+                       
+                       $packages = array_map("basename", glob("phars/*", GLOB_NOSORT|GLOB_ONLYDIR)); 
+                       sort($packages, SORT_NATURAL|SORT_FLAG_CASE);
+
+                       ?>
                        
                        <?php if ($_SERVER["QUERY_STRING"] && in_array($_SERVER["QUERY_STRING"], $packages, true)) : ?>
 
@@ -64,6 +79,7 @@
                                                <th class="text-left">Package</th>
                                                <th class="text-left">Date</th>
                                                <th class="text-right">Size</th>
+                                               <th class="text-right">Pharext</th>
                                        </tr>
                                </thead>
                                <tbody>
 
                                                        ?>
                                                </td>
+                                               <td class="text-right">
+                                                       <?php
+                                                       $data = new Phar($phar);
+                                                       $meta = $data->getMetadata();
+                                                       if ($meta) {
+                                                               printf("v%s\n", $meta["version"]);
+                                                       } else {
+                                                               print "v2.0.1\n";
+                                                       }
+                                                       ?>
+                                               </td>
                                        </tr>
                                        <?php endforeach; ?>
 
                </div>
                <div class="footer">
                        <footer>
-                               &copy; 2015 m6w6, Michael Wallner 
+                               &copy; 2015 m6w6, Michael Wallner &mdash; Powered by <a href="//github.com/m6w6/pharext">pharext
+                                       <?php
+                                       require_once __DIR__."/../vendor/m6w6/pharext/src/pharext/Version.php";
+                                       printf("v%s\n", pharext\VERSION);
+                                       ?>
+                               </a>
                        </footer>
                </div>
        </body>