add(FilesystemPeer::REF_ID,$filesystem_id); $c->add(FilesystemPeer::SECTION,WikiPlugin::SECTION); //$fso = new Filesystem(); //echo FilesystemPeer::REF_ID ."=" . $filesystem_id . "\n"; //echo FilesystemPeer::SECTION ."=" . WikiPlugin::SECTION . "\n"; $fso = FilesystemPeer::doSelectOne($c); if (is_object($fso)){ //echo "fso" . " is object"; return $fso->getFileData(); }else { error_log( "fso" . " is not object"); } } //xmlpipe2 document $configFile='/opt/gforge5/wwwlib/project/ftsearch/gfxmlpipe-db-conf.php'; Propel::init($configFile); $con = Propel::getConnection(UserPeer::DATABASE_NAME); $stmt = $con->createStatement(); $sql = "select wv.wiki_version_id,wv.create_date,wp.wiki_page_id,wp.pagename ,fs.filesystem_id,wp.ref_id as project_id from wiki_version wv, wiki_page wp,filesystem fs where wv.wiki_page_id = wp.wiki_page_id and wv.wiki_version_id = fs.ref_id and fs.filesystem_id > (select max_doc_id from sph_counter where counter_id =3) order by fs.filesystem_id " ; $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC); if ($rs->getRecordCount() > 0) { echo ""."\n"; echo ""."\n"; // you can define the structure of your index in the actual XML body. This means you dont need to define each field in your sphinx.conf // if you prefer to add it to your config, you can omit the whole of this block (the block) echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; $pagename = ''; $pageid = 0; $filesystem_id = 0; $wikifile_id = 0 ; $project_id = 0; $message = ''; $count = 0; while ($rs->next()) { //if ($count>10) break; $create_date = $rs->getDate('create_date'); $wikifile_id =$rs->getInt('filesystem_id'); $pagename = $rs->getString('pagename'); $pageid = $rs->getString('wiki_page_id'); $project_id = $rs->getString('project_id'); $message = getfileContents($wikifile_id); $message = StringUtils::getPlainUTF8FromHtml($message); //$message = StringUtils::unHtmlSpecialChars($message); echo ''."\n"; echo ''."\n"; echo ''."\n"; echo '' . $create_date . ''."\n"; echo '' . '3' . ''."\n"; echo '' . $project_id . ''."\n"; echo '' . $pagename . ''."\n"; echo '' . $pageid . ''."\n"; echo ''."\n"; $count++; } $sql="update sph_counter set max_doc_id =" . $wikifile_id . "where counter_id =3"; $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC); echo ""."\n"; } ?>