Skip to content
Snippets Groups Projects
Commit 908578df authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #64820 remove exit

parent dd982183
Branches
Tags
1 merge request!2368Hotline#64820 connecteur cite de la musique
......@@ -25,7 +25,8 @@ abstract class Class_WebService_BibNumerique_AbstractOAI extends Class_WebServic
protected
$_harvested_ids = [],
$_oaiws;
$_oaiws,
$_is_total = false;
public function harvest() {
$page = 0;
......@@ -58,14 +59,20 @@ abstract class Class_WebService_BibNumerique_AbstractOAI extends Class_WebServic
protected function _addFromTo($params) {
// not working when harvesting multiple sets. Second set trigger $count;
return $this->_isTotal()
? $params
: array_merge($params, ['from' => $harvest_log->getEndDate()]);
}
protected function _isTotal() {
if($this->_is_total)
return true;
$count = Class_Album::countBy(['type_doc_id' => $this->getTypeDoc()]);
$harvest_log = Class_WebService_HarvestLog::findFirstBy(['type_doc' => $this->getTypeDoc(),
'order' => 'end_date desc']);
return $harvest_log && (0 < $count)
? array_merge($params, ['from' => $harvest_log->getEndDate()])
: $params;
return $this->_is_total = !($harvest_log && (0 < $count));
}
......
......@@ -50,9 +50,6 @@ class Class_WebService_BibNumerique_CiteDeLaMusique
protected function _harvestSet($set) {
while($this->getOaiWS()->hasRecordsToHarvest()) {
$this->addHarvestedIds($this->_importRessources($this->_loadPageOf($set)));
if($set != 'videos-concerts-docu-entiers') {
var_dump($set);exit;
}
}
$this->getOaiWS()->reset();
......
......@@ -106,7 +106,6 @@ class Class_WebService_OAI extends Class_WebService_Abstract {
? '&'
: '?';
$url = $this->oai_handler . $separator . http_build_query($parameters);
var_dump($url);
$response = $this->getContent($url);
$this->_log($url, $response);
......
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