1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-10-27 03:51:35 +01:00

fix incorrect time in archive

This commit is contained in:
Ne-Lexa
2017-03-15 19:03:04 +03:00
parent 67fc1ea7ad
commit 1b065c4cca
8 changed files with 94 additions and 52 deletions

View File

@@ -166,6 +166,18 @@ class CentralDirectory
return $this->entries[$entryName];
}
/**
* @param string $entryName
* @return ZipEntry
* @throws ZipNotFoundEntry
*/
public function getModifiedEntry($entryName){
if (!isset($this->modifiedEntries[$entryName])) {
throw new ZipNotFoundEntry('Zip modified entry ' . $entryName . ' not found');
}
return $this->modifiedEntries[$entryName];
}
/**
* @return EndOfCentralDirectory
*/
@@ -420,7 +432,7 @@ class CentralDirectory
// compression method 2 bytes
$entry->getMethod(),
// last mod file datetime 4 bytes
$entry->getTime(),
$entry->getDosTime(),
// crc-32 4 bytes
$entry->getCrc(),
// compressed size 4 bytes