[Jifty-commit] r2841 - in jifty/trunk: lib/Jifty/Script
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Feb 25 17:04:57 EST 2007
Author: jesse
Date: Sun Feb 25 17:04:57 2007
New Revision: 2841
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Script/Schema.pm
Log:
r48515 at 121: jesse | 2007-02-25 16:14:59 -0500
* Since we use the schema tool to manage jifty's database, it's important that it be able to be called from running code (including a DESTROY block). As it was, we were initializing (reinitializing) Jifty from within the DESTROY. That doesn't work so well.
Modified: jifty/trunk/lib/Jifty/Script/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Script/Schema.pm (original)
+++ jifty/trunk/lib/Jifty/Script/Schema.pm Sun Feb 25 17:04:57 2007
@@ -89,6 +89,7 @@
# Import Jifty
Jifty::Util->require("Jifty");
Jifty::Util->require("Jifty::Model::Metadata");
+ Jifty->new( no_handle => 1, logger_component => 'SchemaTool',) unless (Jifty->handle);
}
=head2 print_help
@@ -148,10 +149,7 @@
# Now try to connect. We trap expected errors and deal with them.
eval {
- Jifty->new(
- no_handle => $no_handle,
- logger_component => 'SchemaTool',
- );
+ Jifty->setup_database_connection( no_handle => $no_handle, logger_component => 'SchemaTool',);
};
if ( $@ =~ /doesn't match (application schema|running jifty) version/i ) {
More information about the Jifty-commit
mailing list