CatalystX-ListFramework

 view release on metacpan or  search on metacpan

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

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
    $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');
}
 
    



( run in 0.228 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )