Re add wpScrolltop id in EditPage
[lhc/web/wiklou.git] / maintenance / cdb.php
index 4590611..bff2c13 100644 (file)
  * @todo document
  * @ingroup Maintenance
  */
+use \Cdb\Exception as CdbException;
+use \Cdb\Reader as CdbReader;
 
-/** */
 require_once __DIR__ . '/commandLine.inc';
 
 function cdbShowHelp( $command ) {
-       $commandList = array(
+       $commandList = [
                'load' => 'load a cdb file for reading',
                'get' => 'get a value for a key',
                'exit' => 'exit cdb',
                'quit' => 'exit cdb',
                'help' => 'help about a command',
-       );
+       ];
        if ( !$command ) {
                $command = 'fullhelp';
        }
@@ -59,7 +60,7 @@ do {
                exit;
        }
 
-       $args = explode( ' ', $line );
+       $args = explode( ' ', $line, 2 );
        $command = array_shift( $args );
 
        // process command
@@ -77,7 +78,8 @@ do {
                        print "Loading cdb file $file...";
                        try {
                                $fileHandle = CdbReader::open( $file );
-                       } catch ( CdbException $e ) {}
+                       } catch ( CdbException $e ) {
+                       }
 
                        if ( !$fileHandle ) {
                                print "not a cdb file or unable to read it\n";