File-RsyBak

 view release on metacpan or  search on metacpan

script/rsybak  view on Meta::CPAN

#    if( @_ > 1 ){
#        $self->{agent} =
#            (defined $agent && $agent =~ / $/) ? $agent . $self->_agent : $agent;
#    }
#    return $self->{agent};
#}
#
#sub timeout {
#    my ($self, $timeout) = @_;
#    if ( @_ > 1 ) {
#        $self->{timeout} = $timeout;
#        if ($self->{handle}) {
#            $self->{handle}->timeout($timeout);
#        }
#    }
#    return $self->{timeout};
#}
#
#sub new {
#    my($class, %args) = @_;
#
#    my $self = {
#        max_redirect => 5,
#        timeout      => defined $args{timeout} ? $args{timeout} : 60,
#        keep_alive   => 1,
#        verify_SSL   => $args{verify_SSL} || $args{verify_ssl} || 0, 
#        no_proxy     => $ENV{no_proxy},
#    };
#
#    bless $self, $class;
#
#    $class->_validate_cookie_jar( $args{cookie_jar} ) if $args{cookie_jar};
#
#    for my $key ( @attributes ) {
#        $self->{$key} = $args{$key} if exists $args{$key}
#    }
#
#    $self->agent( exists $args{agent} ? $args{agent} : $class->_agent );
#
#    $self->_set_proxies;
#
#    return $self;
#}
#
#sub _set_proxies {
#    my ($self) = @_;
#
#
#    if (! exists $self->{proxy} ) {
#        $self->{proxy} = $ENV{all_proxy} || $ENV{ALL_PROXY};
#    }
#
#    if ( defined $self->{proxy} ) {
#        $self->_split_proxy( 'generic proxy' => $self->{proxy} ); 
#    }
#    else {
#        delete $self->{proxy};
#    }
#
#    if (! exists $self->{http_proxy} ) {
#        local $ENV{HTTP_PROXY} if $ENV{REQUEST_METHOD};
#        $self->{http_proxy} = $ENV{http_proxy} || $ENV{HTTP_PROXY} || $self->{proxy};
#    }
#
#    if ( defined $self->{http_proxy} ) {
#        $self->_split_proxy( http_proxy => $self->{http_proxy} ); 
#        $self->{_has_proxy}{http} = 1;
#    }
#    else {
#        delete $self->{http_proxy};
#    }
#
#    if (! exists $self->{https_proxy} ) {
#        $self->{https_proxy} = $ENV{https_proxy} || $ENV{HTTPS_PROXY} || $self->{proxy};
#    }
#
#    if ( $self->{https_proxy} ) {
#        $self->_split_proxy( https_proxy => $self->{https_proxy} ); 
#        $self->{_has_proxy}{https} = 1;
#    }
#    else {
#        delete $self->{https_proxy};
#    }
#
#    unless ( ref $self->{no_proxy} eq 'ARRAY' ) {
#        $self->{no_proxy} =
#            (defined $self->{no_proxy}) ? [ split /\s*,\s*/, $self->{no_proxy} ] : [];
#    }
#
#    return;
#}
#
#
#for my $sub_name ( qw/get head put post delete/ ) {
#    my $req_method = uc $sub_name;
#    no strict 'refs';
#    eval <<"HERE"; 
#    sub $sub_name {
#        my (\$self, \$url, \$args) = \@_;
#        \@_ == 2 || (\@_ == 3 && ref \$args eq 'HASH')
#        or _croak(q/Usage: \$http->$sub_name(URL, [HASHREF])/ . "\n");
#        return \$self->request('$req_method', \$url, \$args || {});
#    }
#HERE
#}
#
#
#sub post_form {
#    my ($self, $url, $data, $args) = @_;
#    (@_ == 3 || @_ == 4 && ref $args eq 'HASH')
#        or _croak(q/Usage: $http->post_form(URL, DATAREF, [HASHREF])/ . "\n");
#
#    my $headers = {};
#    while ( my ($key, $value) = each %{$args->{headers} || {}} ) {
#        $headers->{lc $key} = $value;
#    }
#    delete $args->{headers};
#
#    return $self->request('POST', $url, {
#            %$args,
#            content => $self->www_form_urlencode($data),
#            headers => {



( run in 0.340 second using v1.01-cache-2.11-cpan-483215c6ad5 )