get_parms( "bid", "piv", "repair" ); function fixW(&$node, $depth = 0) { if ($node && $node->nodeType == XML_ELEMENT_NODE) { if (($v = $node->getAttribute("v")) != "") { $unicode = new unicode(); $node->setAttribute("w", $unicode->remove_indexer_chars($v)); } for ($c = $node->firstChild; $c; $c = $c->nextSibling) fixW($c, $depth + 1); } } if ($hdir = opendir($registry->get('GV_RootPath') . "www/thesaurus2/patch")) { while (false !== ($file = readdir($hdir))) { if (substr($file, 0, 1) == ".") continue; if (is_file($f = $registry->get('GV_RootPath') . "www/thesaurus2/patch/" . $file)) { require_once($f); print("\n"); } } closedir($hdir); } function fixThesaurus(&$domct, &$domth, &$connbas) { $oldversion = $version = $domth->documentElement->getAttribute("version"); // $cls = "patch_th_".str_replace(".","_",$version); //printf("---- %s %s %s \n", $version, $cls, class_exists($cls) ); //printf("---- %s %s \n", $version, $cls ); while (class_exists($cls = "patch_th_" . str_replace(".", "_", $version), false)) { print("// ============== patching from version='$version'\n"); $last_version = $version; $zcls = new $cls; print("// ----------- calling class '$cls'\n"); $version = $zcls->patch($version, $domct, $domth, $connbas); print("// ----------- method 'patch' -> returned '$version'\n"); if ($version == $last_version) break; } return($version); } ?>