Skip to content
Snippets Groups Projects
Commit 33ed8ce2 authored by gloas's avatar gloas
Browse files

transmission du script pour comparer les recherches

parents 4ffeb0b4 aca3b95d
Branches
Tags
No related merge requests found
......@@ -4923,6 +4923,7 @@ scripts/opac3.el -text
scripts/org-link-minor-mode.el -text
scripts/split_unimarc.php -text
scripts/svn-export.sh -text
scripts/test_performance_recherche.php -text
scripts/top_10_slow_request.sh -text
tests/.htaccess -text
tests/TestXPathFactory.php -text
......
<?php
function old_recherche($expression_recherchee){
$cookie_file = "/tmp/cookie/cookie_1.txt";
$url_old_recherche = "http://web.afi-sa.net/pergame-enligne.net/recherche/simple";
$url_new_recherche = "http://web.afi-sa.net/opacce.pergame.net/recherche/simple/expressionRecherche/";
$post_fields=array('expressionRecherche'=>urlencode($expression_recherchee));
//"expressionRecherche=$expression_recherchee";
//$item_recherche;
// OLD recherche Step1 fill cookie
$curl_old_step_1 = curl_init($url_old_recherche);
curl_setopt($curl_old_step_1,CURLOPT_COOKIESESSION, true);
curl_setopt($curl_old_step_1,CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt ($curl_old_step_1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_old_step_1,CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($curl_old_step_1,CURLOPT_POSTFIELDS, $post_fields);
$result_old_step_1 = curl_exec($curl_old_step_1);
$temps_step_1 = curl_getinfo($curl_old_step_1,CURLINFO_TOTAL_TIME );
echo($temps_step_1);
// OLD recherche Step2 recherche/simple avec cookie
$curl_old_step_2 = curl_init($url_old_recherche);
curl_setopt($curl_old_step_2,CURLOPT_COOKIEJAR, $cookie_file);
$result_old_step_2 = curl_exec($curl_old_step_2);
$temps_step_2 = curl_getinfo($curl_old_step_2,CURLINFO_TOTAL_TIME );
echo '<br/>';
echo($temps_step_1);
echo '<br/>';
echo($temps_step_2);
echo '<br/>';
$total_time = $temps_step_1 + $temps_step_2;
echo($total_time);
}
// main
$array_item_a_rechercher = [
'Millenium',
'auteur',
'France',
'Livre',
'loisirs',
'sports',
'jardin',
'informatique',
'univers',
'bouteille',
'eau',
'telephone',
'Mac',
'Hercule',
'Emacs',
'Ordinateur',
'son',
'Millenium'];
old_recherche('Millenium');
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment