Guest User

Untitled

a guest
Aug 17th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <?php
  2. $path = "/tmp/phar.phar";
  3. if (is_file($path)) { unlink($path); }
  4. $phar = new Phar($path);
  5. $phar->startBuffering();
  6. $phar->addFromString('test.txt', 'text');
  7. $phar->setStub('<?php echo "STUB!\n"; __HALT_COMPILER();');
  8. $phar->stopBuffering();
  9. echo file_get_contents("phar://$path/test.txt")."\n";
Add Comment
Please, Sign In to add comment