index.php 921 B

123456789101112131415161718192021222324
  1. <?php
  2. if(isset($_GET['package'])){
  3. if(isset($_GET['arch'])){
  4. $arch=$_GET['arch'];
  5. }else{
  6. $arch='i686';
  7. }
  8. echo exec("cd /home/eeems/omni.eeems.ca/{$arch}; ls -t {$_GET['package']}*.tar.xz");
  9. }else{
  10. echo file_get_contents('templates/header.template');
  11. $db = scandir('phar://'.getcwd().'/x86_64/omni.db');
  12. $dir1 = scandir(getcwd().'/i686');
  13. $dir2 = scandir(getcwd().'/x86_64');
  14. foreach($db as $file) {
  15. $desc = file_get_contents('phar://'.getcwd().'/x86_64/omni.db/'.$file.'/desc');
  16. $desc = substr($desc,strrpos($desc,'%DESC%')+7,strlen($desc)-strrpos($desc,'%DESC%')-(strlen($desc)-strpos($desc,'%CSIZE%'))-7);
  17. echo "<h2>$file</h2><p><h4>{$desc}</h4> :: Downloads<br/>";
  18. echo " => <a href='i686/$file-i686.pkg.tar.xz'>i686</a><br/>";
  19. echo " => <a href='x86_64/$file-x86_64.pkg.tar.xz'>x86_64</a><br/>";
  20. echo "</p>";
  21. }
  22. echo file_get_contents('templates/footer.template');
  23. }
  24. ?>