Advertisement
P22DX

make.php

Dec 15th, 2019
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. try {
  4.     $output = trim(readline('output file.phar : '));
  5.     $phar = new Phar($output);
  6.     $input = readline('count of files to compress : ');
  7.     $file = array();
  8.     for ($x = 0; $x < $input; $x++) {
  9.         $file[$x] = trim(readline('filename : '));
  10.         $phar[basename($file[$x])] = file_get_contents($file[$x]);
  11.     }
  12.     $phar->compressFiles(Phar::GZ);
  13.     $phar->setSignatureAlgorithm(Phar::SHA1);
  14.     $phar->setStub('<?php Phar::webPhar();__HALT_COMPILER(); ?>');
  15. } catch (Exception $e) {
  16.     echo $e->getMessage();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement