/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
- <?php
- $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
- $a = new Phar($fname);
- $a['index.php'] = '<?php
- echo file_get_contents("dir/file1.txt");
- echo file_get_contents("file1.txt", true);
- ?>';
- $a['dir/file1.txt'] = 'hi';
- $a['dir/file2.txt'] = 'hi2';
- $a['dir/file3.txt'] = 'hi3';
- $a->setStub('<?php
- Phar::interceptFileFuncs();
- set_include_path("phar://" . __FILE__ . "/dir" . PATH_SEPARATOR . "phar://" . __FILE__);
- include "index.php";
- __HALT_COMPILER();');
- include $fname;
- ?>
- ===DONE===
- <?php error_reporting(0); ?>
- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'); ?>