Remove commented code

This commit is contained in:
Romain Neutron
2013-11-20 16:04:20 +01:00
parent 8663f49228
commit cae61dfe1e
11 changed files with 5 additions and 131 deletions

View File

@@ -517,7 +517,6 @@ class Thesaurus implements ControllerProviderInterface
foreach ($t_sort as $i => $query) { foreach ($t_sort as $i => $query) {
$topic = $topics->appendChild($dom->createElement('topic')); $topic = $topics->appendChild($dom->createElement('topic'));
// $topic->setAttribute('id', $n->getAttribute('id'));
if ($opened_display != '' && in_array($t_node[$i]['node']->getAttribute('id'), $obr)) { if ($opened_display != '' && in_array($t_node[$i]['node']->getAttribute('id'), $obr)) {
$topic->setAttribute('view', $opened_display); $topic->setAttribute('view', $opened_display);
} }
@@ -902,10 +901,8 @@ class Thesaurus implements ControllerProviderInterface
if (in_array($fieldname, $request->get('field', [])) != $ck) { if (in_array($fieldname, $request->get('field', [])) != $ck) {
if ($ck) { if ($ck) {
// print("il etait lie a la branche, il ne l'est plus<br/>\n");
unset($tids[$request->get('tid')]); unset($tids[$request->get('tid')]);
} else { } else {
// print("il n'etait pas lie a la branche, il l'est maintenant<br/>\n");
$tids[$request->get('tid')] = $xpathth->query("/thesaurus//te[@id='" . \thesaurus::xquery_escape($request->get('tid')) . "']")->item(0); $tids[$request->get('tid')] = $xpathth->query("/thesaurus//te[@id='" . \thesaurus::xquery_escape($request->get('tid')) . "']")->item(0);
} }
$newtbranch = ""; $newtbranch = "";
@@ -1782,7 +1779,6 @@ class Thesaurus implements ControllerProviderInterface
$delsy = $delte->appendChild($domct->createElement("sy")); $delsy = $delte->appendChild($domct->createElement("sy"));
$delsy->setAttribute("id", $newid = ($delid . "." . $delteid . ".0")); $delsy->setAttribute("id", $newid = ($delid . "." . $delteid . ".0"));
// $delsy->setAttribute("id", $newid = ($delid . "." . $delteid));
$delsy->setAttribute("lng", $sy0->getAttribute("lng")); $delsy->setAttribute("lng", $sy0->getAttribute("lng"));
$delsy->setAttribute("v", $sy0->getAttribute("v")); $delsy->setAttribute("v", $sy0->getAttribute("v"));
$delsy->setAttribute("w", $sy0->getAttribute("w")); $delsy->setAttribute("w", $sy0->getAttribute("w"));
@@ -2127,7 +2123,6 @@ class Thesaurus implements ControllerProviderInterface
$fp = $root->appendchild($ret->createElement("fullpath_html")); $fp = $root->appendchild($ret->createElement("fullpath_html"));
$fp->appendChild($ret->createTextNode($fullpath_html)); $fp->appendChild($ret->createTextNode($fullpath_html));
// $id = "S" . str_replace(".", "d", substr($nodes->item(0)->getAttribute("id"), 1)) . "d";
$id = str_replace(".", "d", $nodes->item(0)->getAttribute("id")) . "d"; $id = str_replace(".", "d", $nodes->item(0)->getAttribute("id")) . "d";
$hits = "0"; $hits = "0";
@@ -2251,10 +2246,6 @@ class Thesaurus implements ControllerProviderInterface
$lng = $n2->getAttribute("lng"); $lng = $n2->getAttribute("lng");
$t = $n2->getAttribute("v"); $t = $n2->getAttribute("v");
$ksy = $n2->getAttribute("w"); $ksy = $n2->getAttribute("w");
if ($k = $n2->getAttribute("k")) {
// $t .= " ($k)";
// $ksy .= " ($k)";
}
if (! $firstksy) { if (! $firstksy) {
$firstksy = $ksy; $firstksy = $ksy;
} }
@@ -2314,7 +2305,6 @@ class Thesaurus implements ControllerProviderInterface
$sy->setAttribute("lng", $lng = $n->getAttribute("lng")); $sy->setAttribute("lng", $lng = $n->getAttribute("lng"));
if (($k = $n->getAttribute("k"))) { if (($k = $n->getAttribute("k"))) {
$sy->setAttribute("k", $k); $sy->setAttribute("k", $k);
// $t .= " (" . $k . ")";
} }
$sy->setAttribute("t", $t); $sy->setAttribute("t", $t);
if ($n->getAttribute("id") == $sel) { if ($n->getAttribute("id") == $sel) {
@@ -3005,7 +2995,6 @@ class Thesaurus implements ControllerProviderInterface
} }
$q = "/cterms//te[./sy[$q]]"; $q = "/cterms//te[./sy[$q]]";
// $root->appendChild($ret->createCDATASection( $q ));
$nodes = $xpathct->query($q); $nodes = $xpathct->query($q);
// le terme peut etre present dans plusieurs candidats // le terme peut etre present dans plusieurs candidats
for ($i = 0; $i < $nodes->length; $i ++) { for ($i = 0; $i < $nodes->length; $i ++) {

View File

@@ -577,7 +577,6 @@ class Xmlhttp implements ControllerProviderInterface
$t = $n2->getAttribute("v"); $t = $n2->getAttribute("v");
$ksy = $n2->getAttribute("w"); $ksy = $n2->getAttribute("w");
if ($k = $n2->getAttribute("k")) { if ($k = $n2->getAttribute("k")) {
// $t .= " ($k)";
$ksy .= " ($k)"; $ksy .= " ($k)";
} }
if (!$firstksy) { if (!$firstksy) {
@@ -1379,7 +1378,6 @@ class Xmlhttp implements ControllerProviderInterface
try { try {
$databox = $appbox->get_databox($sbas['sbas_id']); $databox = $appbox->get_databox($sbas['sbas_id']);
$connbas = $databox->get_connection(); $connbas = $databox->get_connection();
// $domth = $databox->get_dom_thesaurus();
$tsbas[$ksbas]['domct'] = $databox->get_dom_cterms(); $tsbas[$ksbas]['domct'] = $databox->get_dom_cterms();
} catch (\Exception $e) { } catch (\Exception $e) {
continue; continue;

View File

@@ -13,12 +13,6 @@ namespace Alchemy\Phrasea\SearchEngine\Phrasea;
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
/**
*
* @package searchEngine
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class PhraseaEngineQueryParser class PhraseaEngineQueryParser
{ {
public $ops = [ public $ops = [
@@ -53,8 +47,6 @@ class PhraseaEngineQueryParser
"last" => [ "last" => [
"CLASS" => "PHRASEA_KW_LAST", "NODETYPE" => PHRASEA_KW_LAST, "CANNUM" => true "CLASS" => "PHRASEA_KW_LAST", "NODETYPE" => PHRASEA_KW_LAST, "CANNUM" => true
], ],
// "first" => array("CLASS"=>PHRASEA_KW_FIRST, "CANNUM"=>true),
// "premiers" => array("CLASS"=>PHRASEA_KW_FIRST, "CANNUM"=>true),
"tout" => [ "tout" => [
"CLASS" => "PHRASEA_KW_ALL", "NODETYPE" => PHRASEA_KW_ALL, "CANNUM" => false "CLASS" => "PHRASEA_KW_ALL", "NODETYPE" => PHRASEA_KW_ALL, "CANNUM" => false
], ],
@@ -268,12 +260,6 @@ class PhraseaEngineQueryParser
else else
printf(str_repeat("\t", $depth) . "<b><font color='blue'>%s</font></b>\n", $tree["VALUE"][0]); printf(str_repeat("\t", $depth) . "<b><font color='blue'>%s</font></b>\n", $tree["VALUE"][0]);
break; break;
// case PHRASEA_KW_FIRST:
// if($tree["PNUM"]!==null)
// printf("<b><font color='blue'>%s <i>%s</i></font></b>", $tree["VALUE"], $tree["PNUM"]);
// else
// printf("<b><font color='blue'>%s</font></b>", $tree["VALUE"]);
// break;
case "OPS": case "OPS":
case "OPK": case "OPK":
print(str_repeat("\t", $depth) . "<div>\n"); print(str_repeat("\t", $depth) . "<div>\n");
@@ -319,12 +305,6 @@ class PhraseaEngineQueryParser
else else
printf("<b><font color='blue'>%s</font></b>", $tree["VALUE"][0]); printf("<b><font color='blue'>%s</font></b>", $tree["VALUE"][0]);
break; break;
// case PHRASEA_KW_FIRST:
// if($tree["PNUM"]!==null)
// printf("<b><font color='blue'>%s <i>%s</i></font></b>", $tree["VALUE"], $tree["PNUM"]);
// else
// printf("<b><font color='blue'>%s</font></b>", $tree["VALUE"]);
// break;
case "OPS": case "OPS":
case "OPK": case "OPK":
print("<table border='1'>"); print("<table border='1'>");
@@ -409,27 +389,12 @@ class PhraseaEngineQueryParser
$tids[] = $tid["pid"]; $tids[] = $tid["pid"];
} }
if (count($tids) >= 1) { if (count($tids) >= 1) {
/*
if (count($tids)==1) {
// on cherche un id simple, on utilisera la syntaxe sql 'like' (l'extension repérera elle méme la syntaxe car la value finit par '%')
$val = str_replace(".", "d", $tids[0]) . "d%";
$tree["VALUE"] = array($val);
} else {
// on cherche plusieurs id's, on utilisera la syntaxe 'regexp' (l'extension repérera elle méme la syntaxe car la value finit par '$'
$val = "";
foreach($tids as $tid)
$val .= ($val?"|":"") . "(" . str_replace(".", "d", $tid) . "d.*)";
$tree["VALUE"] = array("^" . $val);
}
*/
$tree["VALUE"] = []; $tree["VALUE"] = [];
foreach ($tids as $tid) foreach ($tids as $tid)
$tree["VALUE"][] = str_replace(".", "d", $tid) . "d%";; $tree["VALUE"][] = str_replace(".", "d", $tid) . "d%";;
} else { } else {
// le mot n'est pas dans le thesaurus // le mot n'est pas dans le thesaurus
} }
/*
*/
} }
if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") { if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") {
$this->thesaurus2_apply($tree["LB"], $bid); $this->thesaurus2_apply($tree["LB"], $bid);
@@ -502,7 +467,6 @@ class PhraseaEngineQueryParser
$context = null; $context = null;
if (isset($simple["CONTEXT"])) { if (isset($simple["CONTEXT"])) {
$context = $simple["CONTEXT"]; $context = $simple["CONTEXT"];
// unset($simple["CONTEXT"]);
} }
if ($keepFullText) { if ($keepFullText) {
// on fait un OU entre la recherche ft et une recherche th // on fait un OU entre la recherche ft et une recherche th
@@ -753,7 +717,6 @@ class PhraseaEngineQueryParser
if ($nodes->length == 1) { if ($nodes->length == 1) {
// on cherche un id simple, on utilisera la syntaxe sql 'like' (l'extension repérera elle méme la syntaxe car la value finira par '%') // on cherche un id simple, on utilisera la syntaxe sql 'like' (l'extension repérera elle méme la syntaxe car la value finira par '%')
$this->addtoTIDS($tree["RB"], $bid, $nodes->item(0)); $this->addtoTIDS($tree["RB"], $bid, $nodes->item(0));
// $this->thesaurusDOMNodes[] = $nodes->item(0);
} else { } else {
// on cherche plusieurs id's, on utilisera la syntaxe 'regexp' (l'extension repérera elle meme la syntaxe car la value finira par '$') // on cherche plusieurs id's, on utilisera la syntaxe 'regexp' (l'extension repérera elle meme la syntaxe car la value finira par '$')
foreach ($nodes as $node) { foreach ($nodes as $node) {
@@ -810,14 +773,6 @@ class PhraseaEngineQueryParser
continue; continue;
if ($ztid["pid"] == $pid) { if ($ztid["pid"] == $pid) {
$found = true; $found = true;
} else {
// if($ztid["w"]==$w && $ztid["k"]==$k && $ztid["lng"]==$lng)
// {
// // FATAL : il y a un doublon réel dans le thesaurus de cette base (méme terme, méme contexte)
// // printf("<font color='red'>FATAL doublon on base %d (%s[%s])</font>\n", $bid, $w, $k);
// $found = true;
// break;
// }
} }
} }
if (!$found) if (!$found)
@@ -825,15 +780,12 @@ class PhraseaEngineQueryParser
// on liste les propositions de thésaurus pour ce node (dans l'arbre simple) // on liste les propositions de thésaurus pour ce node (dans l'arbre simple)
if (!isset($this->proposals["BASES"]["b$bid"]["TERMS"][$path])) { if (!isset($this->proposals["BASES"]["b$bid"]["TERMS"][$path])) {
// $this->proposals["TERMS"][$path] = array("TERM"=>implode(" ", $extendednode["VALUE"]), "PROPOSALS"=>[]);
$term = implode(" ", $extendednode["VALUE"]); $term = implode(" ", $extendednode["VALUE"]);
if (isset($extendednode["CONTEXT"]) && $extendednode["CONTEXT"]) { if (isset($extendednode["CONTEXT"]) && $extendednode["CONTEXT"]) {
$term .= " (" . $extendednode["CONTEXT"] . ")"; $term .= " (" . $extendednode["CONTEXT"] . ")";
} }
$this->proposals["BASES"]["b$bid"]["TERMS"][$path] = ["TERM" => $term]; // , "PROPOSALS"=>[] ); //, "PROPOSALS_TREE"=>new DOMDocument("1.0", "UTF-8")); $this->proposals["BASES"]["b$bid"]["TERMS"][$path] = ["TERM" => $term]; // , "PROPOSALS"=>[] ); //, "PROPOSALS_TREE"=>new DOMDocument("1.0", "UTF-8"));
} }
// printf("<%s id='%s'><br/>\n", $DOMnode->tagName, $DOMnode->getAttribute("id"));
// printf("<b>found node &lt;%s id='%s' w='%s' k='%s'></b><br/>\n", $DOMnode->nodeName, $DOMnode->getAttribute('id'), $DOMnode->getAttribute('w'), $DOMnode->getAttribute('k'));
// on commence par marquer les fils directs. rappel:$DOMnode pointe sur un sy // on commence par marquer les fils directs. rappel:$DOMnode pointe sur un sy
for ($node = $DOMnode->parentNode->firstChild; $node; $node = $node->nextSibling) { for ($node = $DOMnode->parentNode->firstChild; $node; $node = $node->nextSibling) {
if ($node->nodeName == "te") { if ($node->nodeName == "te") {
@@ -1020,8 +972,9 @@ class PhraseaEngineQueryParser
public function factor_or(&$tree) public function factor_or(&$tree)
{ {
do do {
$n = $this->factor_or2($tree); while ($n > 0); $n = $this->factor_or2($tree);
} while ($n > 0);
} }
public function factor_or2(&$tree, $depth = 0) public function factor_or2(&$tree, $depth = 0)
@@ -1092,8 +1045,6 @@ class PhraseaEngineQueryParser
public function changeNodeEquals2($oneBranch) public function changeNodeEquals2($oneBranch)
{ {
## creation branche gauche avec ">=" ## creation branche gauche avec ">="
// print("changeNodeEquals2\n");
// print("creation branche gauche ( '>=' ) \n");
$newTreeLB = ["CLASS" => "OPK", $newTreeLB = ["CLASS" => "OPK",
"VALUE" => ">=", "VALUE" => ">=",
"NODETYPE" => PHRASEA_OP_GEQT, "NODETYPE" => PHRASEA_OP_GEQT,
@@ -1119,7 +1070,6 @@ class PhraseaEngineQueryParser
"PNUM" => NULL, "PNUM" => NULL,
"DEPTH" => 0] "DEPTH" => 0]
]; ];
// print("fin creation branche droite avec '<=' \n");
## fin creation branche droite ( "<=" ) ## fin creation branche droite ( "<=" )
$tree = ["CLASS" => "OPS", $tree = ["CLASS" => "OPS",
@@ -1316,7 +1266,6 @@ class PhraseaEngineQueryParser
"RB" => $tree["RB"]]; "RB" => $tree["RB"]];
$tree["LB"]["RB"] = $tree["RB"]["RB"]; $tree["LB"]["RB"] = $tree["RB"]["RB"];
// return;
} }
if ($tree["RB"]["CLASS"] == "OPS" && in_array($tree["RB"]["NODETYPE"], $opdistrib)) { if ($tree["RB"]["CLASS"] == "OPS" && in_array($tree["RB"]["NODETYPE"], $opdistrib)) {
@@ -1394,7 +1343,6 @@ class PhraseaEngineQueryParser
public function maketree($depth, $inquote = false) public function maketree($depth, $inquote = false)
{ {
// printf("<!-- PARSING $depth -->\n\n");
$tree = null; $tree = null;
while ($t = $this->nexttoken($inquote)) { while ($t = $this->nexttoken($inquote)) {
if ($this->debug) if ($this->debug)
@@ -1499,11 +1447,6 @@ class PhraseaEngineQueryParser
break; break;
default: default:
$tree = $this->addtotree($tree, $t, $depth, $inquote); $tree = $this->addtotree($tree, $t, $depth, $inquote);
if ($this->debug) {
// print("---- après addtotree ----\n");
// var_dump($tree);
// print("-------------------------\n");
}
if (!$tree) { if (!$tree) {
return(null); return(null);
} }
@@ -1522,23 +1465,12 @@ class PhraseaEngineQueryParser
public function addtotree($tree, $t, $depth, $inquote) public function addtotree($tree, $t, $depth, $inquote)
{ {
if ($this->debug) {
// printf("addtotree({tree}, \$t[CLASS]='%s', \$t[VALUE]='%s', \$depth=%d, inquote=%s)\n", $t["CLASS"], $t["VALUE"], $depth, $inquote ? "true" : "false");
// print("---- avant addtotree ----\n");
// var_dump($tree);
// print("-------------------------\n");
}
if (!$t) { if (!$t) {
return($tree); return($tree);
} }
switch ($t["CLASS"]) { switch ($t["CLASS"]) {
case "TOK_CONTEXT": case "TOK_CONTEXT":
// if($this->debug)
// {
// printf("addtotree({tree}, \$t='%s', \$depth=%d, inquote=%s)\n", $t["VALUE"], $depth, $inquote?"true":"false");
// }
if ($tree["CLASS"] == "SIMPLE" || $tree["CLASS"] == "QSIMPLE") { if ($tree["CLASS"] == "SIMPLE" || $tree["CLASS"] == "QSIMPLE") {
// un [xxx] suit un terme : il introduit un contexte // un [xxx] suit un terme : il introduit un contexte
$tree["CONTEXT"] = $t["VALUE"]; $tree["CONTEXT"] = $t["VALUE"];
@@ -1571,7 +1503,6 @@ class PhraseaEngineQueryParser
case "TOK_CMP": case "TOK_CMP":
// < > <= >= <> = : sont des opérateurs de comparaison // < > <= >= <> = : sont des opérateurs de comparaison
if (!$tree) { if (!$tree) {
// printf("\nUne question ne peut commencer par '" . $t["VALUE"] . "'<br>");
if ($this->errmsg != "") if ($this->errmsg != "")
$this->errmsg .= "\\n"; $this->errmsg .= "\\n";
$this->errmsg .= sprintf(_('qparser::erreur : une question ne peut commencer par %s'), $t["VALUE"]); $this->errmsg .= sprintf(_('qparser::erreur : une question ne peut commencer par %s'), $t["VALUE"]);
@@ -1579,7 +1510,6 @@ class PhraseaEngineQueryParser
return(null); return(null);
} }
if (($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") && $tree["RB"] == null) { if (($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") && $tree["RB"] == null) {
// printf("'" . $t["VALUE"] . "' ne peut suivre un opérateur<br>");
if ($this->errmsg != "") if ($this->errmsg != "")
$this->errmsg .= "\\n"; $this->errmsg .= "\\n";
$this->errmsg .= sprintf(_('qparser::Formulation incorrecte, ne peut suivre un operateur : %s'), $t["VALUE"]); $this->errmsg .= sprintf(_('qparser::Formulation incorrecte, ne peut suivre un operateur : %s'), $t["VALUE"]);
@@ -1593,7 +1523,6 @@ class PhraseaEngineQueryParser
if ($t["CLASS"] == "TOK_WORD" && isset($this->ops[$t["VALUE"]]) && !$inquote) { if ($t["CLASS"] == "TOK_WORD" && isset($this->ops[$t["VALUE"]]) && !$inquote) {
// ce mot est un opérateur phrasea // ce mot est un opérateur phrasea
if (!$tree) { if (!$tree) {
// printf("\n581 : Une question ne peut commencer par un opérateur<br>");
if ($this->errmsg != "") if ($this->errmsg != "")
$this->errmsg .= "\\n"; $this->errmsg .= "\\n";
$this->errmsg .= sprintf(_('qparser::erreur : une question ne peut commencer par %s'), $t["VALUE"]); $this->errmsg .= sprintf(_('qparser::erreur : une question ne peut commencer par %s'), $t["VALUE"]);
@@ -1602,7 +1531,6 @@ class PhraseaEngineQueryParser
} }
if (($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") && $tree["RB"] == null) { if (($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") && $tree["RB"] == null) {
// printf("\n586 : Un opérateur ne peut suivre un opérateur<br>");
if ($this->errmsg != "") if ($this->errmsg != "")
$this->errmsg .= "\\n"; $this->errmsg .= "\\n";
$this->errmsg .= sprintf(_('qparser::Formulation incorrecte, %s ne peut suivre un operateur'), $t["VALUE"]); $this->errmsg .= sprintf(_('qparser::Formulation incorrecte, %s ne peut suivre un operateur'), $t["VALUE"]);
@@ -1639,7 +1567,6 @@ class PhraseaEngineQueryParser
} }
} }
} else { } else {
//printf("sdfsdfsdfsd<br>");
$type = $inquote ? "QSIMPLE" : "SIMPLE"; $type = $inquote ? "QSIMPLE" : "SIMPLE";
} }
@@ -1666,7 +1593,6 @@ class PhraseaEngineQueryParser
return(null); return(null);
} }
// $nok = 0;
} else } else
$nok++; $nok++;
} }
@@ -1817,11 +1743,6 @@ class PhraseaEngineQueryParser
return(["CLASS" => "TOK_RP", "VALUE" => ")"]); return(["CLASS" => "TOK_RP", "VALUE" => ")"]);
break; break;
case "[": case "[":
// if($inquote)
// {
// $this->phq = ltrim(substr($this->phq, 1));
// return(array("CLASS"=>"TOK_VOID", "VALUE"=>$c));
// }
// un '[' introduit un contexte qu'on lit jusqu'au ']' // un '[' introduit un contexte qu'on lit jusqu'au ']'
$closeb = mb_strpos($this->phq, "]", 1, 'UTF-8'); $closeb = mb_strpos($this->phq, "]", 1, 'UTF-8');
if ($closeb !== false) { if ($closeb !== false) {
@@ -1835,18 +1756,6 @@ class PhraseaEngineQueryParser
return(["CLASS" => "TOK_CONTEXT", "VALUE" => $context]); return(["CLASS" => "TOK_CONTEXT", "VALUE" => $context]);
break; break;
/*
case "]":
// if($inquote)
// {
// $this->phq = ltrim(substr($this->phq, 1));
// return(array("CLASS"=>"TOK_VOID", "VALUE"=>$c));
// }
$this->phq = ltrim(substr($this->phq, 1));
return(array("CLASS"=>"TOK_RB", "VALUE"=>"]"));
break;
*/
case "\"": case "\"":
$this->phq = $this->mb_ltrim(mb_substr($this->phq, 1, 99999, 'UTF-8'), 'UTF-8'); $this->phq = $this->mb_ltrim(mb_substr($this->phq, 1, 99999, 'UTF-8'), 'UTF-8');
@@ -1858,13 +1767,10 @@ class PhraseaEngineQueryParser
$c_utf8 = ""; $c_utf8 = "";
for ($i = 0; $i < $l; $i++) { for ($i = 0; $i < $l; $i++) {
if (!$this->app['unicode']->has_indexer_bad_char(($c_utf8 = mb_substr($this->phq, $i, 1, 'UTF-8')))) { if (!$this->app['unicode']->has_indexer_bad_char(($c_utf8 = mb_substr($this->phq, $i, 1, 'UTF-8')))) {
// $c = mb_strtolower($c);
// $t .= isset($this->noaccent[$c]) ? $this->noaccent[$c] : $c;
$t .= $this->app['unicode']->remove_diacritics(mb_strtolower($c_utf8)); $t .= $this->app['unicode']->remove_diacritics(mb_strtolower($c_utf8));
} else } else
break; break;
} }
// if ($c_utf8 == "(" || $c_utf8 == ")" || $c_utf8 == "[" || $c_utf8 == "]" || $c_utf8 == "=" || $c_utf8 == ":" || $c_utf8 == "<" || $c_utf8 == ">" || $c_utf8 == "\"")
if (in_array($c_utf8, ["(", ")", "[", "]", "=", ":", "<", ">", "\""])) { if (in_array($c_utf8, ["(", ")", "[", "]", "=", ":", "<", ">", "\""])) {
// ces caractéres sont des délimiteurs avec un sens, il faut les garder // ces caractéres sont des délimiteurs avec un sens, il faut les garder
$this->phq = $this->mb_ltrim(mb_substr($this->phq, $i, 99999, 'UTF-8'), 'UTF-8'); $this->phq = $this->mb_ltrim(mb_substr($this->phq, $i, 99999, 'UTF-8'), 'UTF-8');

View File

@@ -644,17 +644,7 @@ class User_Query implements User_QueryInterface
*/ */
public function like($like_field, $like_value) public function like($like_field, $like_value)
{ {
// if ($like_field == self::LIKE_NAME)
// {
// $this->like_field[self::LIKE_FIRSTNAME] = trim($like_value);
// $this->like_field[self::LIKE_LASTNAME] = trim($like_value);
// }
// else
// {
$this->like_field[trim($like_field)] = trim($like_value); $this->like_field[trim($like_field)] = trim($like_value);
// }
$this->total = $this->page = $this->total_page = null; $this->total = $this->page = $this->total_page = null;
return $this; return $this;

View File

@@ -247,9 +247,6 @@ class ftpclient
echo $e; echo $e;
} }
$ret = $this->nb_get($localfile, $remotefile, 0); $ret = $this->nb_get($localfile, $remotefile, 0);
// if($this->debug)
// echo "On doit avoir a la fin $remotefile de size ".filesize($localfile)."\n<br>";
} }
if ($ret != FTP_FINISHED) { if ($ret != FTP_FINISHED) {
throw new Exception('Erreur lors du transfert de fichier'); throw new Exception('Erreur lors du transfert de fichier');

View File

@@ -104,7 +104,6 @@ class patch_370alpha8a implements patchInterface
if ($task['class'] === 'task_period_workflow01') { if ($task['class'] === 'task_period_workflow01') {
$t = $tasks->appendChild($dom->createElement('task')); $t = $tasks->appendChild($dom->createElement('task'));
$t->setAttribute('active', '0'); $t->setAttribute('active', '0');
// $t->setAttribute('name', 'imported from \'' . $task->getTitle() . '\'');
$t->setAttribute('name', 'imported from \'' . $task['name'] . '\''); $t->setAttribute('name', 'imported from \'' . $task['name'] . '\'');
$t->setAttribute('action', 'update'); $t->setAttribute('action', 'update');

View File

@@ -32,7 +32,6 @@ class patchthesaurus_100 implements patchthesaurus_interface
foreach ($te1 as $tei) { foreach ($te1 as $tei) {
$th->appendChild($tei); $th->appendChild($tei);
$this->fixThesaurus2($domth, $tei, 0, $unicode); $this->fixThesaurus2($domth, $tei, 0, $unicode);
// $tei->parentNode->removeChild($tei);
} }
$te0->parentNode->removeChild($te0); $te0->parentNode->removeChild($te0);
} }
@@ -58,9 +57,9 @@ class patchthesaurus_100 implements patchthesaurus_interface
$tenode->removeAttribute("v"); $tenode->removeAttribute("v");
$tenode->removeAttribute("w"); $tenode->removeAttribute("w");
$tenode->removeAttribute("k"); $tenode->removeAttribute("k");
if ($tenode->getAttribute("nextid") == "") if ($tenode->getAttribute("nextid") == "") {
$tenode->setAttribute("nextid", "0"); $tenode->setAttribute("nextid", "0");
// $tenode->setAttribute("id", "0.".$tenode->getAttribute("id")); }
$todel = []; $todel = [];
for ($n = $tenode->firstChild; $n; $n = $n->nextSibling) { for ($n = $tenode->firstChild; $n; $n = $n->nextSibling) {
if ($n->nodeName == "ta") if ($n->nodeName == "ta")

View File

@@ -20,7 +20,6 @@ class patchthesaurus_201 implements patchthesaurus_interface
$xp = new DOMXPath($domth); $xp = new DOMXPath($domth);
$te = $xp->query("/thesaurus//te"); $te = $xp->query("/thesaurus//te");
for ($i = 0; $i < $te->length; $i ++) { for ($i = 0; $i < $te->length; $i ++) {
// $id = "S" . substr($te->item($i)->getAttribute("id"), 1);
$id = $te->item($i)->getAttribute("id"); $id = $te->item($i)->getAttribute("id");
$nid = (int) ($te->item($i)->getAttribute("nextid")); $nid = (int) ($te->item($i)->getAttribute("nextid"));
for ($n = $te->item($i)->firstChild; $n; $n = $n->nextSibling) { for ($n = $te->item($i)->firstChild; $n; $n = $n->nextSibling) {

View File

@@ -134,7 +134,6 @@ class patchthesaurus_203 implements patchthesaurus_interface
if ($pid != "") { if ($pid != "") {
$id = $node->getAttribute("id"); $id = $node->getAttribute("id");
if (substr($id, 1, strlen($pid)) != substr($pid, "1") . ".") { if (substr($id, 1, strlen($pid)) != substr($pid, "1") . ".") {
//printf("pid='%s', id='%s'\n", $pid, $id);
$nid = $node->parentNode->getAttribute("nextid"); $nid = $node->parentNode->getAttribute("nextid");
$node->parentNode->setAttribute("nextid", $nid + 1); $node->parentNode->setAttribute("nextid", $nid + 1);
$node->setAttribute("id", $newid = ($pid . "." . $nid)); $node->setAttribute("id", $newid = ($pid . "." . $nid));

View File

@@ -136,7 +136,6 @@ class patchthesaurus_204 implements patchthesaurus_interface
if ($pid != "") { if ($pid != "") {
$id = $node->getAttribute("id"); $id = $node->getAttribute("id");
if (substr($id, 1, strlen($pid)) != substr($pid, "1") . ".") { if (substr($id, 1, strlen($pid)) != substr($pid, "1") . ".") {
//printf("pid='%s', id='%s'\n", $pid, $id);
$nid = $node->parentNode->getAttribute("nextid"); $nid = $node->parentNode->getAttribute("nextid");
$node->parentNode->setAttribute("nextid", $nid + 1); $node->parentNode->setAttribute("nextid", $nid + 1);
$node->setAttribute("id", $newid = ($pid . "." . $nid)); $node->setAttribute("id", $newid = ($pid . "." . $nid));

View File

@@ -364,7 +364,6 @@ class phraseadate
break; break;
default: default:
$n = 0; $n = 0;
// printf("format de date inconnu : %s\n", $format);
break; break;
} }
if ($n > 0) { if ($n > 0) {