BZ-Client

 view release on metacpan or  search on metacpan

lib/BZ/Client.pm  view on Meta::CPAN


=item password

The password to use when logging in to the Bugzilla server.

=item autologin

If set to C<1> (true), will try to log in (if not already logged in) when
the first API call is made. This is default.

If set to C<0>, will try APi calls without logging in. You can
still call $client->login() to log in manually.

Note: once you're logged in, you'll stay that way until you call L</logout>

=item restrictlogin

If set to C<1> (true), will ask Bugzilla to restrict logins to your IP only.
Generally this is a good idea, but may caused problems if you are using
a loadbalanced forward proxy.

Default: C<0>

=item connect

A hashref with options for L<HTTP::Tiny>, this is passed through so the
bellow are for reference only:

=over 4

=item http_proxy, https_proxy, proxy

Nominates a proxy for HTTP, HTTPS or both, respectively.

You might also use C<$ENV{all_proxy}>, C<$ENV{http_proxy}>, C<$ENV{https_proxy}>
or C<$ENV{all_proxy}>.

=item timeout

Request timeout in seconds (default is C<60>)

=item verify_SSL

A boolean that indicates whether to validate the SSL certificate of an
"https" connection (default is false)

=back

=back

=head3 Connect Via Socks Proxy

Try something like:

 use HTTP::Tiny; # load this manually
 use IO::Socket::Socks::Wrapper (
  'HTTP::Tiny::Handle::connect()' => {
    ProxyAddr    => 'localhost',
    ProxyPort    => 1080,
    SocksVersion => 4,
    Timeout      => 15
    }
  );
  use BZ::Client ...etc

=head1 INSTANCE METHODS

This section lists the methods, which an instance of BZ::Client can
perform.

=head2 url

 $url = $client->url();
 $client->url( $url );

Returns or sets the Bugzilla servers URL.

=head2 user

 $user = $client->user();
 $client->user( $user );

Returns or sets the user name to use when logging in to the Bugzilla
server. Typically, this will be your email address.

=head2 password

 $password = $client->password();
 $client->password( $password );

Returns or sets the password to use when logging in to the Bugzilla server.

=head2 autologin

If L<login> is automatically called, or not.

=head2 login

Used to login to the Bugzilla server. By default, there is no need to call
this method explicitly: It is done automatically, whenever required.

If L<autologin> is set to C<0>, call this to log in.

=head2 is_logged_in

Returns C<1> if logged in, otherwise C<0>.

=head2 logout

Deletes local cookies and calls Bugzilla's logout function

=head2 logger

Sets or gets the logging function. Argument is a coderef. Returns C<undef> if none.

 $logger = $client->logger();

 $client->logger(
     sub {
         my ($level, $msg) = @_;
         print STDERR "$level $message\n";



( run in 0.525 second using v1.01-cache-2.11-cpan-39bf76dae61 )