User Tools

Site Tools


tools:db:new-importer

This is an old revision of the document!


Experimental importer for 0.804+ (Vivace+1)

Usage

  1. Login as usual through the web interface
  2. Upload the code as 'import.php' in your FP web root (usually flatpress/)
  3. Wait for the page to finish loading.

Your index should now have been rebuilt.

remove the file import.php when done!

<?php
	require('defaults.php');
	require(INCLUDES_DIR.'includes.php');
 
	system_init();
	header('Content-Type: text/plain');
 
	if (!user_loggedin()) exit('You must login.');
 
 
	class s_entry_crawler extends fs_filelister {
 
		var $_directory = CONTENT_DIR;
 
		function __construct() {
			$this->index =& entry_init();
			parent::__construct();
		}
 
		function _checkFile($directory, $file) {
			$f = "$directory/$file";
				if ( is_dir($f) && ctype_digit($file)) {
					return 1;
				}
 
				if (fnmatch('entry*'.EXT, $file)) {
					$id=basename($file,EXT);
					$arr=entry_parse($id, true);
 
					echo "[POST] $id => {$arr['SUBJECT']}\n";
					$this->index->add($id, $arr);
 
					return 0;
				}
		}
 
	}
 
 
	echo "FlatPress importing utility .804+\n";
	echo "=================================\n\n";
 
	echo "This may take some time, please wait...\n\n";
 
	new s_entry_crawler;
tools/db/new-importer.1586973488.txt.gz ยท Last modified: 2020/04/15 19:58 by arvid

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki