Home | Wiki | OI 1.x Docs | OI 2.x Docs |
OpenInteract2::Manage::Website::TestDB - Managment task
#!/usr/bin/perl
use strict; use OpenInteract2::Manage;
my $website_dir = '/home/httpd/mysite'; my $task = OpenInteract2::Manage->new( 'test_db', { website_dir => $website_dir } ); my @status = $task->execute; foreach my $s ( @status ) { my $ok_label = ( $s->{is_ok} eq 'yes' ) ? 'OK' : 'NOT OK'; my $default_label = ( $s->{is_default} eq 'yes' ) ? ' (default) ' : ''; print "Connection: $s->{name} $default_label\n", "Status: $ok_label\n", "$s->{message}\n"; }
This command simply tests all DBI connections defined in the server
configuration. That is, all datasource
entries that are of type
'DBI'. We test that we can connect to the database with the supplied
user/password, that we can create and drop a table.
In addition to the normal entries, each status hashref includes:
Name of the connection
Set to 'yes' if the connection is the default DBI connection, 'no' if not.
Copyright (c) 2002-2003 Chris Winters. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Chris Winters <chris@cwinters.com>
Generated from the OpenInteract 1.99_03 source.