diff --git a/cosmogramme/php/_init.php b/cosmogramme/php/_init.php index 633bd0493dc62447f2d64905cc6f127767b62ea6..6ab78cb83b050683157bc45a09053b727fa5d895 100644 --- a/cosmogramme/php/_init.php +++ b/cosmogramme/php/_init.php @@ -1,7 +1,7 @@ <?php error_reporting(E_ERROR | E_PARSE); -define("PATCH_LEVEL","264"); +define("PATCH_LEVEL","265"); define("APPLI","cosmogramme"); define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs"); diff --git a/cosmogramme/sql/patch/patch_265.php b/cosmogramme/sql/patch/patch_265.php new file mode 100644 index 0000000000000000000000000000000000000000..f12163ced40cc4087c3f2e755a549fef8dc7e012 --- /dev/null +++ b/cosmogramme/sql/patch/patch_265.php @@ -0,0 +1,4 @@ +<?php +$adapter = Zend_Db_Table::getDefaultAdapter(); +$adapter->query('ALTER TABLE `album` MODIFY `notice_id` int(11) null default null'); +$adapter->query('UPDATE `album` SET `notice_id`=null WHERE `notice_id`=0'); \ No newline at end of file diff --git a/library/Class/Autocomplete/Index.php b/library/Class/Autocomplete/Index.php index 37c06bf75510efbec2d4289a5b65727b9ce03d2f..4a5e86c05109b26f36be5ede0b3db03d9313ad51 100644 --- a/library/Class/Autocomplete/Index.php +++ b/library/Class/Autocomplete/Index.php @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with BOKEH; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -36,17 +36,17 @@ class Class_Autocomplete_Index { return $this->getBasePath() . $this->file_name; } - + public static function getClassFor($name) { foreach (['Title' => new Class_Autocomplete_IndexTitle(), - 'Author' => new Class_Autocomplete_IndexAuthor()] + 'Author' => new Class_Autocomplete_IndexAuthor()] as $k => $clazz) { if ((false !== strpos($name, $k))) return $clazz; } return new Class_Autocomplete_IndexNull(); } - + public static function getMethodFor($name) { if ('search' == substr($name, 0, 6)) @@ -85,6 +85,7 @@ class Class_Autocomplete_Index { $current = $response->done; Class_Notice::clearCache(); + Class_CodifAuteur::clearCache(); Storm_Model_Loader::resetCache(); gc_collect_cycles(); } while($response->done < $response->total); diff --git a/library/Class/Cosmogramme/Chronometre.php b/library/Class/Cosmogramme/Chronometre.php index e7c08c6ecdd730f924baa7c2ee0a226ef85ac546..99c579fa4f30fb305ff499e24510befece0fd2a9 100644 --- a/library/Class/Cosmogramme/Chronometre.php +++ b/library/Class/Cosmogramme/Chronometre.php @@ -92,7 +92,7 @@ class Class_Cosmogramme_Chronometre { $elapsed = 1; $mean = $total / ($elapsed / 60); - return number_format($mean, 0, ',', '.') + return number_format($mean, 0, ',', ' ') . ' ' . $label . ' par minute'; } } diff --git a/library/Class/Cosmogramme/Integration/PhasePseudoRecord.php b/library/Class/Cosmogramme/Integration/PhasePseudoRecord.php index c305c39f48d7cc4d63d717849749e85f339e2a3f..a75d4ddb7315be1ec7b4724d7b288e9505558c74 100644 --- a/library/Class/Cosmogramme/Integration/PhasePseudoRecord.php +++ b/library/Class/Cosmogramme/Integration/PhasePseudoRecord.php @@ -23,22 +23,27 @@ abstract class Class_Cosmogramme_Integration_PhasePseudoRecord extends Class_Cosmogramme_Integration_PhaseAbstract { + protected $_model_id_field; + /** @var Trait_Indexable */ protected $_model_name; protected function _getModelIdField() { - return call_user_func([$this->_model_name, 'getIdField']); + if (!$this->_model_id_field) + $this->_model_id_field = call_user_func([$this->_model_name, 'getIdField']); + + return $this->_model_id_field; } protected function _loadPage() { + $this->_cleanMemory(); $id_field = $this->_getModelIdField(); - return call_user_func_array([$this->_model_name, 'findAllBy'], - [['where' => $id_field . ' > ' . $this->_getData('pointeur_reprise'), - 'order' => $id_field, - 'limit' => 100 - ]]); + return call_user_func([$this->_model_name, 'findAllBy'], + ['where' => $id_field . ' > ' . $this->_getData('pointeur_reprise'), + 'order' => $id_field, + 'limit' => 100]); } @@ -55,6 +60,7 @@ abstract class Class_Cosmogramme_Integration_PhasePseudoRecord protected function _runPage($models) { + $this->_log->ecrire($this->_getData('nombre') . '<br>'); foreach($models as $model) { if ($this->isTimeOut()) return; @@ -85,7 +91,7 @@ abstract class Class_Cosmogramme_Integration_PhasePseudoRecord return; } - $this->_incrementCount(Class_Cosmogramme_Integration_Phase::RECORD_UPDATE); + $this->_incrementCount(Class_Cosmogramme_Integration_Phase::RECORD_FULLUPDATE); } @@ -124,4 +130,11 @@ abstract class Class_Cosmogramme_Integration_PhasePseudoRecord ->startOnFile() ->startOnRecords(); } + + + protected function _cleanMemory() { + Storm_Model_Abstract::unsetLoaders(); + Storm_Model_Loader::resetCache(); + gc_collect_cycles(); + } } \ No newline at end of file