/hphp/test/zend/bad/ext/phar/tests/file_get_contents.php

http://github.com/facebook/hiphop-php · PHP · 20 lines · 20 code · 0 blank · 0 comment · 0 complexity · 3dbd8f20b18998f28d382e6ec634bd35 MD5 · raw file

  1. <?php
  2. $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
  3. $a = new Phar($fname);
  4. $a['index.php'] = '<?php
  5. echo file_get_contents("dir/file1.txt");
  6. echo file_get_contents("file1.txt", true);
  7. ?>';
  8. $a['dir/file1.txt'] = 'hi';
  9. $a['dir/file2.txt'] = 'hi2';
  10. $a['dir/file3.txt'] = 'hi3';
  11. $a->setStub('<?php
  12. Phar::interceptFileFuncs();
  13. set_include_path("phar://" . __FILE__ . "/dir" . PATH_SEPARATOR . "phar://" . __FILE__);
  14. include "index.php";
  15. __HALT_COMPILER();');
  16. include $fname;
  17. ?>
  18. ===DONE===
  19. <?php error_reporting(0); ?>
  20. <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'); ?>