OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



pdftotext in config.inc.php

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

pdftotext in config.inc.php

Postby spliff » Fri Jun 15, 2007 3:29 pm

Dear OJS community

I am running an OJS test installation for a Swiss journal of History.
First I have to thank the whole OJS team for the fantastic job they did! You created just a marvelous piece of software. I am very much excited about it!

I have a question regarding the full text search of PDF files. I understand (http://pkp.sfu.ca/support/forum/viewtopic.php?t=1119) that the first thing to try would be to un-comment the line
Code: Select all
; index[application/pdf] = "/usr/bin/pdftotext %s -"

in config.inc.php, if my server has installed this tool. Then I could run "php tools/rebuildSearchIndex.php" to build a text index. Now fortunately I found this tool at /usr/local/bin/pdftotext.
The problem I am facing is that I cannot find the above-mentioned line in "config.inc.php" (in classes/config). The content I see is:

Code: Select all
<?php

/**
 * Config.inc.php
 *
 * Copyright (c) 2003-2006 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @package config
 *
 * Config class for accessing configuration parameters.
 *
 * $Id: Config.inc.php,v 1.5 2006/06/12 23:25:50 alec Exp $
 */

/** The path to the configuration file */
define('CONFIG_FILE', Core::getBaseDir() . DIRECTORY_SEPARATOR . 'config.inc.php');

import('config.ConfigParser');

class Config {

   /**
    * Retrieve a specified configuration variable.
    * @param $section string
    * @param $key string
    * @return string
    */
   function getVar($section, $key) {
      $configData = &Config::getData();
      return isset($configData[$section][$key]) ? $configData[$section][$key] : null;
   }
   
   /**
    * Get the current configuration data.
    * @return array the configuration data
    */
   function &getData() {
      static $configData;
      
      if (!isset($configData)) {
         // Load configuration data only once per request
         $configData = Config::reloadData();
      }
      
      return $configData;
   }
   
   /**
    * Load configuration data from a file.
    * The file is assumed to be formatted in php.ini style.
    * @return array the configuration data
    */
   function &reloadData() {
      if (($configData = &ConfigParser::readConfig(CONFIG_FILE)) === false) {
         fatalError(sprintf('Cannot read configuration file %s', CONFIG_FILE));
      }
      
      return $configData;
   }
   
   /**
    * Return the path to the configuration file.
    * @return string
    */
   function getConfigFileName() {
      return CONFIG_FILE;
   }
   
}
?>


What am I doing wrong? I am not familiar with php and maybe I am just too stupid to handle OJS... :oops:

Many thanks for your advice in advance!
spliff
 
Posts: 28
Joined: Thu Jun 14, 2007 8:23 am
Location: Switzerland

Postby asmecher » Fri Jun 15, 2007 3:37 pm

Hi spliff,

You're looking in the wrong file; the config.inc.php configuration file should appear in the OJS installation's root directory. The file you're looking at is the code that reads the configuration file, not the configuration file itself.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Many thanks

Postby spliff » Fri Jun 15, 2007 3:56 pm

Dear asmecher

You're looking in the wrong file


I kind of suspected that... :roll:

Many thanks for your help!
spliff
 
Posts: 28
Joined: Thu Jun 14, 2007 8:23 am
Location: Switzerland

Postby asmecher » Sat Jun 16, 2007 12:05 am

Hi Spliff,

No problem; let me know if you have any other questions.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests