CatalystX-ListFramework

 view release on metacpan or  search on metacpan

t/lib/TestApp/Controller/Root.pm  view on Meta::CPAN

    $c->view('JSON')->process($c);
}

sub resetdb :Path('/start') {
    my ($self, $c) = @_;
    my $dbfile = "/tmp/__listframework_testapp.sqlite";
    if (-e $dbfile) { unlink $dbfile or die "Failed to unlink $dbfile: $!"; }
    my $dbh = DBI->connect("dbi:SQLite2:dbname=$dbfile","","");

    open my $sql_fh, $c->config()->{'sql_path'}.'/test_app.sql' or die "Can't read SQL file: $!";
    local $/ = "";  ## empty line(s) are delimeters
    while (my $sql = <$sql_fh>) {
        $dbh->do($sql);
    }
    $dbh->disconnect;
    close $sql_fh;
    $c->res->redirect("/listsearch/track");
    #$c->res->output('reset ok');
}

    

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.423 second using v1.00-cache-2.02-grep-82fe00e-cpan-d29e8ade9f55 )