]> granicus.if.org Git - php/commitdiff
MFB: add safeguard check for timestamp modification to phar_stub.phpt and phar_gzip...
authorGreg Beaver <cellog@php.net>
Sun, 1 Mar 2009 07:16:55 +0000 (07:16 +0000)
committerGreg Beaver <cellog@php.net>
Sun, 1 Mar 2009 07:16:55 +0000 (07:16 +0000)
ext/phar/tests/phar_gzip.phpt
ext/phar/tests/zip/phar_stub.phpt

index 99ff22d7bc8696256b0b2177421d0a92c16ff419..c722834ba6c0a025cf7af703a842b9b6fb96f868 100644 (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--
index 72c1f17d786ae6d8c92a75b65c1fadb563c012ec..302a894d76ab306d7d2c318f44905cf850bf05d2 100644 (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();