Skip to content
Snippets Groups Projects
Commit 7a2211f8 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #50500 : domains indexed in cron mode, no longer use callback

parent 81d0093e
Branches
Tags 7.9.8
4 merge requests!2080Sandbox detach zf from storm,!1928Master,!1927Hotline master,!1926Hotline#50500 mise a jour de la base
<?PHP
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
......@@ -18,55 +18,47 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/////////////////////////////////////////////////////////////////////////
// INTEGRATION DES RESERVATIONS
/////////////////////////////////////////////////////////////////////////
require_once("classe_transaction.php");
setVariable("traitement_phase","Indexation des domaines");
setVariable('traitement_phase', 'Indexation des domaines');
if ($phase==16) {
$log->ecrire("<h4>Indexation des domaines</h4>");
$log->ecrire('<h4>Indexation des domaines</h4>');
unset($phase_data);
$reprise=false;
$phase_data["nombre"]=0;
$phase_data["nb_fic"]=0;
$phase_data["timeStart"]=time();
$phase_data["pointeur"]=0;
$phase_data["domaine"]=0;
$reprise = false;
$phase_data['nombre'] = 0;
$phase_data['nb_fic'] = 0;
$phase_data['timeStart'] = time();
$phase_data['pointeur'] = 0;
$phase_data['domaine'] = 0;
$phase=17;
}
if ($phase==17) {
$position_domaine=$phase_data["domaine"];
// Indexation des catalogues dynamiques
$catalogues = array_slice(Class_Catalogue::findAllCataloguesAIndexer(),$position_domaine);
if ($mode_cron) {
$position_domaine = $phase_data['domaine'];
$catalogues = array_slice(Class_Catalogue::findAllCataloguesAIndexer(),
$position_domaine);
foreach ($catalogues as $catalogue) {
$page=$phase_data["pointeur"];
$log->ecrire("Indexation du domaine : ".$catalogue->getLibelle()."<br/>");
$catalogue->index($page,
function(&$phase_data) use ($page)
{
$phase_data['pointeur'] = $page;
});
foreach ($catalogues as $catalogue) {
$page = $phase_data['pointeur'];
$log->ecrire('Indexation du domaine : '.$catalogue->getLibelle().'<br/>');
$catalogue->index($page);
$position_domaine++;
$phase_data["domaine"]=$position_domaine;
$phase_data["pointeur"]=0;
}
$position_domaine++;
$phase_data['domaine'] = $position_domaine;
$phase_data['pointeur'] = 0;
}
if ($mode_cron) {
$log->ecrire('<h4>Indexation des paniers dans les domaines</h4>');
Class_PanierNotice::indexAll();
$log->ecrire("<h4>Indexation des articles dans les domaines</h4>");
$log->ecrire('<h4>Indexation des articles dans les domaines</h4>');
Class_Article::indexAll();
$log->ecrire("<h4>Indexation des sitothèques dans les domaines</h4>");
$log->ecrire('<h4>Indexation des sitothèques dans les domaines</h4>');
Class_Sitotheque::indexAll();
} else {
$log->ecrire("<h4>Les indexations des paniers, articles et sitothèques dans les domaines ne sont traitées qu'en mode cron</h4>");
$log->ecrire('<h4>Les indexations des domaines, des paniers, articles et sitothèques dans les domaines ne sont traitées qu\'en mode cron</h4>');
}
}
?>
\ No newline at end of file
}
\ 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