mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
use logger in task to check checksum
This commit is contained in:
parent
5bb70b82aa
commit
fc8bef612e
|
@ -365,7 +365,10 @@ class SeedDMS_IndexingDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ *
|
||||||
* iterating over all folders recursively.
|
* iterating over all folders recursively.
|
||||||
*/
|
*/
|
||||||
class SeedDMS_Task_CheckSum_Process_Folder { /* {{{ */
|
class SeedDMS_Task_CheckSum_Process_Folder { /* {{{ */
|
||||||
public function __construct() { /* {{{ */
|
protected $logger;
|
||||||
|
|
||||||
|
public function __construct($logger) { /* {{{ */
|
||||||
|
$this->logger = $logger;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
public function process($folder) { /* {{{ */
|
public function process($folder) { /* {{{ */
|
||||||
|
@ -378,10 +381,10 @@ class SeedDMS_Task_CheckSum_Process_Folder { /* {{{ */
|
||||||
if(file_exists($dms->contentDir.$version->getPath())) {
|
if(file_exists($dms->contentDir.$version->getPath())) {
|
||||||
$checksum = SeedDMS_Core_File::checksum($dms->contentDir.$version->getPath());
|
$checksum = SeedDMS_Core_File::checksum($dms->contentDir.$version->getPath());
|
||||||
if($checksum != $version->getChecksum()) {
|
if($checksum != $version->getChecksum()) {
|
||||||
echo $document->getId().':'.$version->getVersion().' wrong checksum'.PHP_EOL;
|
$this->logger->log($document->getId().':'.$version->getVersion().' wrong checksum', PEAR_LOG_WARNING);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo $document->getId().':'.$version->getVersion().' missing content'.PHP_EOL;
|
$this->logger->log($document->getId().':'.$version->getVersion().' missing content', PEAR_LOG_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user