[Fusionforge-commits] r16571 - trunk/src/common/docman

Franck VILLAUME nerville at fusionforge.org
Wed Oct 17 23:25:59 CEST 2012


Author: nerville
Date: 2012-10-17 23:25:59 +0200 (Wed, 17 Oct 2012)
New Revision: 16571

Modified:
   trunk/src/common/docman/Parsedata.class.php
Log:
fix behavior since data is store on fs

Modified: trunk/src/common/docman/Parsedata.class.php
===================================================================
--- trunk/src/common/docman/Parsedata.class.php	2012-10-17 21:25:27 UTC (rev 16570)
+++ trunk/src/common/docman/Parsedata.class.php	2012-10-17 21:25:59 UTC (rev 16571)
@@ -53,11 +53,11 @@
 		// always parse title, description, filename and filetype
 		$data1 = utf8_decode("$title $description $filename $filetype");
 		// temporary file for treatement
-		$filename = tempnam("/tmp", "tmp");
-		$handle = fopen($filename, "w");
+		$filename = tempnam(forge_get_config('data_path'), 'tmp');
+		$handle = fopen($filename, 'w');
 		fwrite($handle, $data1);
 		fclose($handle);
-		$cmd = $this->p_path.$this->parsers["text/plain"];
+		$cmd = $this->p_path.$this->parsers['text/plain'];
 		$cmd = "php -f $cmd $filename";
 		$rep1 = shell_exec($cmd);
 		// dont need to unlink the filename because parser_text already remove it
@@ -65,9 +65,9 @@
 	}
 
 	function get_parser_list($parser_path) {
-		$file = $parser_path."parser_list.txt";
+		$file = $parser_path.'parser_list.txt';
 		$rep = array();
-		$handle = fopen($file, "r");
+		$handle = fopen($file, 'r');
 		if ($handle) {
 			$buff = fread($handle, 2048);
 			$lines = explode("\n", $buff);




More information about the Fusionforge-commits mailing list