Login   Register  
PHP Classes
elePHPant
Icontem

File: htdig_build_databases.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Manuel Lemos  >  Htdig site indexing and searching interface  >  htdig_build_databases.php  >  Download  
File: htdig_build_databases.php
Role: Example script
Content type: text/plain
Description: Example script to build Ht:/Dig databases about the indexed pages.
Class: Htdig site indexing and searching interface
Interface with Ht:/Dig indexing and search engine.
Author: By
Last change: Used external file to define Ht:/Dig configuration options.
Date: 9 years ago
Size: 1,742 bytes
 

Contents

Class file image Download
<?php
/*
 * htdig_build_databases.php
 *
 * Purpose: build the databases that contain the information about the
 * indexed documents.
 *
 * Run this script from the command line use PHP standalone CGI 
 * executable program. Execute this script after executing
 * htdig_setup_configuration.php .
 *
 * @(#) $Header: /home/mlemos/cvsroot/htdiginterface/htdig_build_databases.php,v 1.3 2005/02/08 06:10:10 mlemos Exp $
 *
 */

    
require("htdig.php");
    require(
"configuration.php");

    
$htdig=new htdig_class;

    
/*
     * Where are the executables of htsearch, htdig, htmerge, htfuzzy 
     * located? They should be in the same directory. It does not need
     * to be in the original instalation directory.
     */
    
$htdig->htdig_path=$htdig_path;

    
/*
     * Where this search engine configuration file should be stored? It
     * does not need to be in the original htdig instalation directory.
     * If you need to index more than one site in your server run this
     * script as many times as need specifying different configuration file
     * names.
     */
    
$htdig->configuration=$htdig_configuration_file;

    
/*
     * Where this search engine database files hould be stored? It
     * does not need to be in the original htdig instalation directory.
     * If you need to index more than one site in your server run this
     * script as many times as need specifying different database
     * directories.
     */
    
$htdig->database_directory=$htdig_database_directory;

    
/*
     * Make Htdig programs traverse the pages specified in the configuration
     * file and generate the databases with information about them.
     */
    
$error=$htdig->Dig("endings",$log);
    if(
strcmp($error,""))
    {
        echo 
implode("\n",$log),"\n";
        echo 
"Error: $error\n";
    }
    else
        echo 
implode("\n",$log),"\n";
?>