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

New component/decompress: extracted Piwik\Unzip into a separate package #6367

Closed
mnapoli opened this issue Oct 2, 2014 · 3 comments
Closed
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mnapoli
Copy link
Contributor

mnapoli commented Oct 2, 2014

Just like the PiwikTracker being extracted into its own package, I believe it would be interesting to do the same for small and isolated components that are inside Piwik's code. The Piwik\Unzip component is a perfect candidate for that as it contains the following classes:

  • UncompressInterface
  • Gzip
  • PclZip
  • Tar
  • ZipArchive

All of those classes/interface are not used directly in the codebase as they are abstracted behind the Piwik\Unzip factory. So it seems pretty safe to move all the classes and keep Piwik\Unzip for backward compatibility (until a future refactoring with dependency injection maybe).

The benefits from this:

  • a smaller package on a separate topic, much easier to maintain
  • less tests to run in Piwik (the faster they are the better)
  • the opportunity to write more extensive tests and improve coverage
  • 2 less libraries in libs/ (Archive_Tar/ and PclZip/)
  • an independent package that can be reused outside of Piwik!

Just a side note regarding the name of the future package: Unzip seems too targeted (since the library can handle zips as well as tars and all), and UncompressInterface seems to be not correct english. It seems Decompress is more appropriate. Extract could also be a good candidate but it seems a bit more generic and less evocative of "compressing files".

@mnapoli mnapoli added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Oct 2, 2014
@mnapoli mnapoli self-assigned this Oct 2, 2014
@mattab
Copy link
Member

mattab commented Oct 2, 2014

Sounds good! 👍
To publicise this package we could write a blog post on http://piwik.org/blog/

@mnapoli
Copy link
Contributor Author

mnapoli commented Oct 2, 2014

@mnapoli
Copy link
Contributor Author

mnapoli commented Oct 3, 2014

Done in #6376!

@mnapoli mnapoli closed this as completed Oct 3, 2014
@mnapoli mnapoli added this to the Piwik 2.8.0 milestone Oct 3, 2014
@mattab mattab changed the title [WIP] Extract Piwik\Unzip into a separate package New component/decompress: extracted Piwik\Unzip into a separate package Oct 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

2 participants