create_new_phar.phpt 736 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Phar: create a completely new phar
  3. --EXTENSIONS--
  4. phar
  5. --INI--
  6. phar.readonly=0
  7. phar.require_hash=1
  8. --FILE--
  9. <?php
  10. file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/a.php',
  11. "brand new!\n");
  12. include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/a.php';
  13. $fileName = "ChineseFile\xE5\x84\xB7\xE9\xBB\x91.php";
  14. file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/$fileName.php',
  15. 'Text in utf8 file.');
  16. include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/$fileName.php';
  17. ?>
  18. --CLEAN--
  19. <?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
  20. --EXPECT--
  21. brand new!
  22. Text in utf8 file.