Add CachedDownloadManager #62

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants
@chEbba
Contributor

chEbba commented Oct 23, 2011

This is a prototype of Download cache.

The main idea is to have a local repository which stores all downloaded packages. Also we can add a cli in the future to work with this storage (add/remove packages). May be this storage can be used for package servers.

I've added some utils for archives, which can be used in Downloaders.

Notes:

  • PackageStorage api is not clean enough, I think it should be placed inside WritableRepository.
  • There is only one implementation of Archiver as example
  • Source is not tested at all, as it is only a prototype. But if PR will be applied i will stabilize it and write tests.
@chEbba

This comment has been minimized.

Show comment Hide comment
@chEbba

chEbba Oct 23, 2011

Contributor

Found a related issue #54

Contributor

chEbba commented Oct 23, 2011

Found a related issue #54

+ *
+ * @author Kirill chEbba Chebunin <iam@chebba.org>
+ */
+interface ArchiverInterface extends ExtractorInterface, CompressorInterface {}

This comment has been minimized.

Show comment Hide comment
@stof

stof Nov 11, 2011

Contributor

this is broken as both interface contain getArchiveType. You should either remove this method from one of the interfaces, either define an interface with the method and extend it in both interfaces.

@stof

stof Nov 11, 2011

Contributor

this is broken as both interface contain getArchiveType. You should either remove this method from one of the interfaces, either define an interface with the method and extend it in both interfaces.

This comment has been minimized.

Show comment Hide comment
@chEbba

chEbba Nov 11, 2011

Contributor

Ooops, fixed. Wrote in a blind mode :)

@chEbba

chEbba Nov 11, 2011

Contributor

Ooops, fixed. Wrote in a blind mode :)

@stof

This comment has been minimized.

Show comment Hide comment
@stof

stof Nov 11, 2011

Contributor

@Seldaek @naderman Could you take a look at this PR ?

I know there is a bunch of CS issues in this PR but it might be easier to discuss the way it is implemented if I don't add many CS comments in the PR. These ones can be added later.

Contributor

stof commented Nov 11, 2011

@Seldaek @naderman Could you take a look at this PR ?

I know there is a bunch of CS issues in this PR but it might be easier to discuss the way it is implemented if I don't add many CS comments in the PR. These ones can be added later.

@chEbba

This comment has been minimized.

Show comment Hide comment
@chEbba

chEbba Nov 11, 2011

Contributor

Thnx @stof
Yes, there are a lot of CS problems, but the main idea is to discuss architecture things.

For me it will be cleaner to use only WritableRepositoryInterface without separate PackageStorageInterface (may be encapsulate it inside some implementation of repository). But there are some problems: WritableRepository does not allow to pass a downloaded location; repository is used on the installer level while cache implementation on the downloader level is more logical.

Contributor

chEbba commented Nov 11, 2011

Thnx @stof
Yes, there are a lot of CS problems, but the main idea is to discuss architecture things.

For me it will be cleaner to use only WritableRepositoryInterface without separate PackageStorageInterface (may be encapsulate it inside some implementation of repository). But there are some problems: WritableRepository does not allow to pass a downloaded location; repository is used on the installer level while cache implementation on the downloader level is more logical.

@everzet

This comment has been minimized.

Show comment Hide comment
@everzet

everzet Dec 1, 2011

Contributor

I will look at it tomorrow.

Contributor

everzet commented Dec 1, 2011

I will look at it tomorrow.

@henrikbjorn

This comment has been minimized.

Show comment Hide comment
@henrikbjorn

henrikbjorn Dec 22, 2011

Contributor

@everzet did you ever play with this?

Contributor

henrikbjorn commented Dec 22, 2011

@everzet did you ever play with this?

@everzet

This comment has been minimized.

Show comment Hide comment
@everzet

everzet Dec 22, 2011

Contributor

@henrikbjorn yup, but not much. The problem for now is that we have bigger issues with downloaders. When remote service is slow with response or when zip is not installed - package is breaks, but Composer still thinks that it exists (becuase folder is already created). Because of this, this cacher makes things even worse. We need to correctly handle downloads first.

Contributor

everzet commented Dec 22, 2011

@henrikbjorn yup, but not much. The problem for now is that we have bigger issues with downloaders. When remote service is slow with response or when zip is not installed - package is breaks, but Composer still thinks that it exists (becuase folder is already created). Because of this, this cacher makes things even worse. We need to correctly handle downloads first.

@kaiwa kaiwa referenced this pull request Jan 24, 2012

Closed

added clean command #254

@phiamo

This comment has been minimized.

Show comment Hide comment
@phiamo

phiamo Mar 25, 2012

+1 for slow connection, around the world ;)

phiamo commented Mar 25, 2012

+1 for slow connection, around the world ;)

@chEbba chEbba referenced this pull request Jul 15, 2012

Closed

Package cache #915

@chEbba chEbba closed this Jul 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment