User Tools

Site Tools


tools:db:dump
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Last revision
tools:db:dump [2019/01/12 17:53] – external edit 127.0.0.1
Line 1: Line 1:
 +====== 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 [[:tools:db:spbimporter]].
 +
 +===== Installing and using =====
 +
 +  - Copy the code in a file named ''dbdump.php'' and then point your browser to %%http://mysite/flatpress/dump.php%%
 +  - Please remember to **delete** this file once you don't need it anymore.
 +
 +===== dump.php =====
 +
 +<file 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";
 +
 +?>
 +</file>

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki