1 2 3 4 5 6 7 8 9 10 11 | <?php if (file_exists('test.phar')) { unlink('test.phar'); } $phar = new Phar('test.phar'); $phar->addFromString( 'path/to/foo.php', '<?php echo "__FILE__ is: " . __FILE__ . "\n";?>' ); ?> |
1 2 3 | <?php include 'phar://test.phar/path/to/foo.php'; ?> |
__FILE__ is: phar:///home/cweiske/Dev/test/phar/test.phar/path/to/foo.php