Steffen Müller > PAR-Repository-Client > PAR::Repository::Client::HTTP

Download:
PAR-Repository-Client-0.25.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Module Version: 0.24   Source  

NAME ^

PAR::Repository::Client::HTTP - PAR repository via HTTP

SYNOPSIS ^

  use PAR::Repository::Client;
  
  my $client = PAR::Repository::Client->new(
    uri => 'http:///foo/repository',
    http_timeout => 20, # but default is 180s
  );

DESCRIPTION ^

This module implements repository accesses via HTTP.

If you create a new PAR::Repository::Client object and pass it an uri parameter which starts with http:// or https://, it will create an object of this class. It inherits from PAR::Repository::Client.

The repository is accessed using LWP::Simple.

EXPORT

None.

METHODS ^

Following is a list of class and instance methods. (Instance methods until otherwise mentioned.)

fetch_par

Fetches a .par distribution from the repository and stores it locally. Returns the name of the local file or the empty list on failure.

First argument must be the distribution name to fetch.

validate_repository

Makes sure the repository is valid. Returns the empty list if that is not so and a true value if the repository is valid.

Checks that the repository version is compatible.

The error message is available as $client-error()> on failure.

_repository_info

Returns a YAML::Tiny object representing the repository meta information.

This is a private method.

_fetch_dbm_file

This is a private method.

Fetches a dbm (index) file from the repository and returns the name of the temporary local file or the empty list on failure.

An error message is available via the error() method in case of failure.

_dbm_checksums

This is a private method.

If the repository has a checksums file (new feature of PAR::Repository 0.15), this method returns a hash associating the DBM file names (e.g. foo_bar.dbm.zip) with their MD5 hashes (base 64).

This method always queries the repository and never caches the information locally. That's the whole point of having the checksums.

In case the repository does not have checksums, this method returns the empty list, so check the return value! The error message (see the error() method) will be "Repository does not support checksums" in that case.

_init

This private method is called by the new() method of PAR::Repository::Client. It is used to initialize the client object and new() passes it a hash ref to its arguments.

Should return a true value on success.

SEE ALSO ^

This module is part of the PAR::Repository::Client distribution.

This module is directly related to the PAR project. You need to have basic familiarity with it. The PAR homepage is at http://par.perl.org.

See PAR, PAR::Dist, PAR::Repository, etc.

PAR::Repository implements the server side creation and manipulation of PAR repositories.

PAR::WebStart is doing something similar but is otherwise unrelated.

The repository access is done via LWP::Simple.

AUTHOR ^

Steffen Mueller, <smueller@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2006-2009 by Steffen Mueller

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: