forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinks.phpt
More file actions
33 lines (33 loc) · 699 Bytes
/
links.phpt
File metadata and controls
33 lines (33 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--TEST--
Phar: tar with hard link and symbolic link
--EXTENSIONS--
phar
--INI--
phar.require_hash=0
--FILE--
<?php
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.tar';
copy(__DIR__ . '/files/links.tar', $fname);
try {
$p = new PharData($fname);
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
var_dump($p['testit/link']->getContent());
var_dump($p['testit/hard']->getContent());
var_dump($p['testit/file']->getContent());
$p['testit/link'] = 'overwriting';
var_dump($p['testit/link']->getContent());
?>
--CLEAN--
<?php
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar');
?>
--EXPECT--
string(3) "hi
"
string(3) "hi
"
string(3) "hi
"
string(11) "overwriting"