Merge branch 'seeddms-5.0.x' into develop

This commit is contained in:
Uwe Steinmann 2016-02-26 09:08:17 +01:00
commit 206983cffd
2 changed files with 10 additions and 10 deletions

View File

@ -26,13 +26,13 @@ function formatted_size($size_bytes) { /* {{{ */
return number_format($size_bytes,0,"","")." Bytes"; return number_format($size_bytes,0,"","")." Bytes";
} /* }}} */ } /* }}} */
function getReadableDate($timestamp) { function getReadableDate($timestamp) { /* {{{ */
return date("Y-m-d", $timestamp); return date("Y-m-d", $timestamp);
} } /* }}} */
function getLongReadableDate($timestamp) { function getLongReadableDate($timestamp) { /* {{{ */
return date("Y-m-d H:i:s", $timestamp); return date("Y-m-d H:i:s", $timestamp);
} } /* }}} */
/* /*
* Converts a date/time string into a timestamp * Converts a date/time string into a timestamp
@ -52,16 +52,16 @@ function makeTsFromLongDate($date) { /* {{{ */
return $ts; return $ts;
} /* }}} */ } /* }}} */
function getReadableDuration($secs) { function getReadableDuration($secs) { /* {{{ */
$s = ""; $s = "";
foreach ( getReadableDurationArray($secs) as $k => $v ) { foreach ( getReadableDurationArray($secs) as $k => $v ) {
if ( $v ) $s .= $v." ".($v==1? substr($k,0,-1) : $k).", "; if ( $v ) $s .= $v." ".($v==1? substr($k,0,-1) : $k).", ";
} }
return substr($s, 0, -2); return substr($s, 0, -2);
} } /* }}} */
function getReadableDurationArray($secs) { function getReadableDurationArray($secs) { /* {{{ */
$units = array( $units = array(
getMLText("weeks") => 7*24*3600, getMLText("weeks") => 7*24*3600,
getMLText("days") => 24*3600, getMLText("days") => 24*3600,
@ -77,7 +77,7 @@ function getReadableDurationArray($secs) {
} }
return $units; return $units;
} } /* }}} */
/** /**
* Compare two version * Compare two version

View File

@ -83,7 +83,7 @@ function tree($dms, $index, $indexconf, $folder, $indent='') { /* {{{ */
$lucenesearch = new $indexconf['Search']($index); $lucenesearch = new $indexconf['Search']($index);
if(!($hit = $lucenesearch->getDocument($document->getId()))) { if(!($hit = $lucenesearch->getDocument($document->getId()))) {
try { try {
$index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false)); $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout));
echo " (Document added)\n"; echo " (Document added)\n";
} catch(Exception $e) { } catch(Exception $e) {
echo " (Timeout)\n"; echo " (Timeout)\n";
@ -100,7 +100,7 @@ function tree($dms, $index, $indexconf, $folder, $indent='') { /* {{{ */
} else { } else {
if($index->delete($hit->id)) { if($index->delete($hit->id)) {
try { try {
$index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false)); $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout));
echo " (Document updated)\n"; echo " (Document updated)\n";
} catch(Exception $e) { } catch(Exception $e) {
echo " (Timeout)\n"; echo " (Timeout)\n";