FP DB Dump

The following script does not issue any kind of conversion, but it just dumps on video useful informations about your FP DB.

This is useful before you run spbimporter.

Installing and using

  1. Copy the code in a file named dbdump.php and then point your browser to http://mysite/flatpress/dump.php
  2. Please remember to delete this file once you don't need it anymore.

dump.php

dump.php
<?php
 
    header('Content-Type: text/plain');
 
    require_once('defaults.php');
    require_once(INCLUDES_DIR.'includes.php');
 
    class dump extends fs_filelister {
 
        var $_directory = CONTENT_DIR;
	     function _checkFile($d,$f) {
 
            $p="$d/$f";
 
			echo substr(sprintf('%o', fileperms($p)), -4), "\t", $p ;
 
            if (is_dir($p)) {
				echo "\tIS_DIR: entering\n\n";
				return 1;
            } else {
				$s = io_load_file($p);
 
				if ((strpos( $p, '.gz' ) !== false )  ) {
					echo " [ FOUND GZ ] ";
					$s = gzinflate(substr($s, 10 ));
				}
 
 
				if ((strpos($f, 'entry') || strpos($f, 'entry')) && (strpos($s, 'VERSION|') === false)) {
					echo " [ VERY OLD FORMAT ] ";
				}
 
				if (strpos($s, 'relatedlink')!==false)
					echo " [ relatedlink INVALID KEY ] ";
				if (strpos($s, '||')!==false) {
					echo " [ BLANK KEY, dumping ] \n";
					echo wordwrap($s, 80);
					echo "\n";
				}
 
 
			}
 
			echo "\n";
 
        }
 
    }
 
	echo "======= FlatPress db dump =======\n\n" ;
	echo "Listing...\n";
 
 
    $o =& new dump;
    echo "\n\nFINISHED";
 
?>
 
tools/db/dump.txt · Last modified: 2010/05/21 00:24 by fanalion
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki