4 * FusionForge document search engine
6 * Copyright 2010, Franck Villaume
7 * http://fusionforge.org
9 * This file is part of FusionForge.
11 * FusionForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published
13 * by the Free Software Foundation; either version 2 of the License,
14 * or (at your option) any later version.
16 * FusionForge is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 require dirname(__FILE__).'/../../../www/env.inc.php';
29 require_once $gfcommon.'docman/engine/parser_text.inc.php';
34 echo "Usage : parser_oo.php <filename>\n";
39 if (!is_file($fichin)) exit (1);
40 $zip = new ZipArchive;
41 if ($zip->open($fichin) === TRUE) {
42 $output_dir = $fichin.".dir";
44 $zip->extractTo($output_dir,array('content.xml'));
49 // transformer le context.xml en fichier txt
50 $regexp_oo = "sed -e 's/<[^>]*>//g;s/</</g;s/>/>/g;s/'/'\"'\"'/g;s/"/\"/g;s/&/\&/g'";
52 $cmd = $regexp_oo." ".$output_dir."/content.xml > ".$output_dir."/content.xml.txt";
54 $res = shell_exec($cmd);
55 $rep = parser_text($output_dir.'/content.xml.txt');
58 unlink($output_dir.'/content.xml');
59 unlink($output_dir.'/content.xml.txt');
64 // c-file-style: "bsd"