Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zmupdate #1484

Merged
merged 4 commits into from
May 16, 2016
Merged

Update zmupdate #1484

merged 4 commits into from
May 16, 2016

Conversation

connortechnology
Copy link
Member

So I broke zmupdate at some point.

This fixes it.

I have been cleaning up all the database connection code, hopefully leaving us with just one place for it.
I am also deprecating the ConfigAdmin module and moving it's two functions into Config.pm.

@connortechnology
Copy link
Member Author

Also of note here are some missing sth->finishes and some cases where we move the statement preparing outside of the loop.

@knight-of-ni
Copy link
Member

Rather than specify the full module name like this
ZoneMinder::Config::loadConfigFromDB();

Would it be more efficient to do something like this?
use ZoneMinder::Config qw(loadConfigFromDB);

my syntax might not be exactly correct.

Actually, I see you added "use ZoneMinder" ...wouldn't that import all zoneminder perl modules, including ZoneMinder::Config ?

@@ -359,12 +361,12 @@ if ( $interactive ) {
if ( $response =~ /^[yY]$/ ) {
$dbh->do(q|SET sql_mode='traditional'|); # Elevate warnings to errors
print "\nConverting MyISAM tables to InnoDB. Please wait.\n";
my $sql = "ALTER TABLE $_ ENGINE = InnoDB";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
Copy link
Member

@knight-of-ni knight-of-ni May 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is right. These two lines got moved outside of the foreach loop just below, which means the default variable $_ won't contain the right value(s).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are totally right.

@connortechnology
Copy link
Member Author

Matter of personal preference. I like to fully specify my function calls. Less ambiguous.

@knight-of-ni knight-of-ni mentioned this pull request May 16, 2016
@knight-of-ni knight-of-ni merged commit b3c6382 into master May 16, 2016
@SteveGilvarry SteveGilvarry deleted the update_zmupdate branch May 17, 2016 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants