add safeguard check for timestamp modification to phar_stub.phpt and phar_gzip.phpt

This commit is contained in:
Greg Beaver 2009-03-01 07:16:46 +00:00
parent 1ff3b85d74
commit 26ce51d6f1
2 changed files with 11 additions and 0 deletions

View File

@ -42,6 +42,11 @@ $a->setAlias('another');
$b = new Phar($fname2);
var_dump($b->isFileFormat(Phar::PHAR));
var_dump($b->isCompressed() == Phar::GZ);
$a = stat($pname . '/test');
$b = stat($pname2 . '/test');
if ($a['mtime'] != $b['mtime']) {
echo "timestamp changed, was $a[mtime], now $b[mtime]!\n";
}
?>
===DONE===
--CLEAN--

View File

@ -19,6 +19,12 @@ $p['b'] = 'b';
$p['c'] = 'c';
copy($fname2, $fname);
$a = stat($pname . '/a');
$b = stat($pname2 . '/a');
if ($a['mtime'] != $b['mtime']) {
echo "timestamp changed, was $a[mtime], now $b[mtime]!\n";
}
$phar = new Phar($fname);
echo $phar->getStub();