CPAN-SQLite
view release on metacpan or search on metacpan
lib/CPAN/SQLite/Index.pm view on Meta::CPAN
use CPAN::SQLite::Info;
use CPAN::SQLite::State;
use CPAN::SQLite::Populate;
use CPAN::SQLite::DBI qw($tables);
use File::Spec::Functions qw(catfile);
use File::Basename;
use File::Path;
use HTTP::Tiny;
use Scalar::Util 'weaken';
unless ($ENV{CPAN_SQLITE_NO_LOG_FILES}) {
$ENV{CPAN_SQLITE_DEBUG} = 1;
}
our ($oldout);
my $log_file = 'cpan_sqlite_log.' . time;
# This is usually already defined in real life, but tests need it to be set
$CPAN::FrontEnd ||= "CPAN::Shell";
lib/CPAN/SQLite/Populate.pm view on Meta::CPAN
use English qw/-no_match_vars/;
use CPAN::SQLite::Util qw($table_id has_hash_data print_debug);
use CPAN::SQLite::DBI::Index;
use CPAN::SQLite::DBI qw($dbh);
use File::Find;
use File::Basename;
use File::Spec::Functions;
use File::Path;
use Scalar::Util 'weaken';
our $dbh = $CPAN::SQLite::DBI::dbh;
my ($setup);
my %tbl2obj;
$tbl2obj{$_} = __PACKAGE__ . '::' . $_ foreach (qw(dists mods auths info));
my %obj2tbl = reverse %tbl2obj;
sub new {
my ($class, %args) = @_;
lib/CPAN/SQLite/Populate.pm view on Meta::CPAN
$obj = $pack->new(cdbi => $self->{cdbi}->{objs}->{$table});
}
$self->{obj}->{$table} = $obj;
}
foreach my $table (@tables) {
my $obj = $self->{obj}->{$table};
foreach (@tables) {
next if ref($obj) eq $tbl2obj{$_};
$obj->{obj}->{$_} = $self->{obj}->{$_};
weaken $obj->{obj}->{$_};
}
}
unless ($setup) {
my $state = $self->{state};
my @tables = qw(auths dists mods);
my @data = qw(ids insert update delete);
foreach my $table (@tables) {
my $state_obj = $state->{obj}->{$table};
lib/CPAN/SQLite/State.pm view on Meta::CPAN
use warnings;
no warnings qw(redefine);
our $VERSION = '0.220';
use English qw/-no_match_vars/;
use CPAN::SQLite::DBI qw($dbh);
use CPAN::SQLite::DBI::Index;
use CPAN::SQLite::Util qw(has_hash_data print_debug);
use Scalar::Util 'weaken';
my %tbl2obj;
$tbl2obj{$_} = __PACKAGE__ . '::' . $_ for (qw(dists mods auths info));
my %obj2tbl = reverse %tbl2obj;
our $dbh = $CPAN::SQLite::DBI::dbh;
sub new {
my ($class, %args) = @_;
lib/CPAN/SQLite/State.pm view on Meta::CPAN
$obj = $pack->new();
}
$self->{obj}->{$table} = $obj;
}
foreach my $table (@tables) {
my $obj = $self->{obj}->{$table};
foreach (@tables) {
next if ref($obj) eq $tbl2obj{$_};
$obj->{obj}->{$_} = $self->{obj}->{$_};
weaken $obj->{obj}->{$_};
}
}
return 1;
}
sub state_info {
my $self = shift;
my @methods = qw(ids state);
my @tables = qw(dists auths mods);
( run in 0.683 second using v1.01-cache-2.11-cpan-65fba6d93b7 )