Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ZIP stat information #31929

Merged
merged 3 commits into from
Apr 12, 2022
Merged

Expose ZIP stat information #31929

merged 3 commits into from
Apr 12, 2022

Conversation

PVince81
Copy link
Member

Required to be able to read the mtime and other metadata.

Note: not added on the interface because it would require adjusting TarStreamer as well

@PVince81 PVince81 added the 2. developing Work in progress label Apr 11, 2022
@PVince81 PVince81 requested a review from come-nc April 11, 2022 13:14
@PVince81 PVince81 self-assigned this Apr 11, 2022
@PVince81
Copy link
Member Author

this is mostly for nextcloud/user_migration#83

but I'm not too happy about the approach there

the elephant in the room is that OC\Archive\Zip::getFiles() is called repeatedly for each call of getFolder(), for everything.
maybe I'll optimize that instead and add a method getMtime($name) instead

@PVince81 PVince81 force-pushed the enh/noid/zip-expose-stat branch from 28f41e6 to 44fece6 Compare April 11, 2022 13:59
lib/private/Archive/ZIP.php Outdated Show resolved Hide resolved
lib/private/Archive/ZIP.php Outdated Show resolved Hide resolved
lib/private/Archive/ZIP.php Outdated Show resolved Hide resolved
@PVince81 PVince81 force-pushed the enh/noid/zip-expose-stat branch from 44fece6 to 62b6297 Compare April 11, 2022 15:35
Add getStat to OC\Archive\Zip
Required to be able to read the mtime and other metadata.
To give direct access to mtime

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Co-authored-by: Côme Chilliet <come.chilliet@nextcloud.com>
@PVince81 PVince81 force-pushed the enh/noid/zip-expose-stat branch from 62b6297 to f5004e8 Compare April 11, 2022 15:49
@PVince81 PVince81 requested a review from come-nc April 11, 2022 15:49
@PVince81 PVince81 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 11, 2022
@PVince81 PVince81 added this to the Nextcloud 24 milestone Apr 11, 2022
lib/private/Archive/ZIP.php Show resolved Hide resolved
@Pytal
Copy link
Member

Pytal commented Apr 11, 2022

For some reason psalm doesnt find ZipArchive 🤔

@come-nc
Copy link
Contributor

come-nc commented Apr 12, 2022

For some reason psalm doesnt find ZipArchive thinking

The php used is not built with zip extension. I had the problem before but I think I did not solve it (I added to the baseline or something).

come-nc added 2 commits April 12, 2022 11:10
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc
Copy link
Contributor

come-nc commented Apr 12, 2022

See:

TL;DR: it’s not possible / too complicated to have ext-zip installed on the docker for the github psalm action, easier to add a stub for ZipArchive.

@come-nc
Copy link
Contributor

come-nc commented Apr 12, 2022

drone failure unrelated

@come-nc come-nc merged commit a3017a4 into master Apr 12, 2022
@come-nc come-nc deleted the enh/noid/zip-expose-stat branch April 12, 2022 12:17
@blizzz blizzz mentioned this pull request Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants