Fix notices on undefined $fileHandle and $res
authorChad Horohoe <chadh@wikimedia.org>
Wed, 27 Nov 2013 18:02:34 +0000 (10:02 -0800)
committerChad Horohoe <chadh@wikimedia.org>
Wed, 27 Nov 2013 18:02:34 +0000 (10:02 -0800)
Change-Id: If9f37549af85df0a418dbd12a7793e5a45868f61

maintenance/cdb.php

index bda64f3..1772b5f 100644 (file)
@@ -52,7 +52,7 @@ do {
        $bad = false;
        $showhelp = false;
        $quit = false;
-       static $fileHandle;
+       static $fileHandle = false;
 
        $line = Maintenance::readconsole();
        if ( $line === false ) {
@@ -98,6 +98,7 @@ do {
                                $res = $fileHandle->get( $args[0] );
                        } catch ( CdbException $e ) {
                                print "Unable to read key from file\n";
+                               break;
                        }
                        if ( $res === false ) {
                                print "No such key/value pair\n";