add support for disabling the cache (#129)
This commit is contained in:
+9
-1
@@ -161,6 +161,10 @@ if (defined('ENCODING')) {
|
|||||||
|
|
||||||
@define('BIBTEXBROWSER_DEBUG',false);
|
@define('BIBTEXBROWSER_DEBUG',false);
|
||||||
|
|
||||||
|
// should we cache the parsed bibtex file?
|
||||||
|
// ref: https://github.com/monperrus/bibtexbrowser/issues/128
|
||||||
|
@define('BIBTEXBROWSER_USE_CACHE',true);
|
||||||
|
|
||||||
// how to print authors names?
|
// how to print authors names?
|
||||||
// default => as in the bibtex file
|
// default => as in the bibtex file
|
||||||
// USE_COMMA_AS_NAME_SEPARATOR_IN_OUTPUT = true => "Meyer, Herbert"
|
// USE_COMMA_AS_NAME_SEPARATOR_IN_OUTPUT = true => "Meyer, Herbert"
|
||||||
@@ -354,6 +358,10 @@ function _zetDB($bibtex_filenames) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$parse=true;
|
||||||
|
$updated = false;
|
||||||
|
|
||||||
|
if (config_value('BIBTEXBROWSER_USE_CACHE')==true) {
|
||||||
|
|
||||||
// ---------------------------- HANDLING caching of compiled bibtex files
|
// ---------------------------- HANDLING caching of compiled bibtex files
|
||||||
// for sake of performance, once the bibtex file is parsed
|
// for sake of performance, once the bibtex file is parsed
|
||||||
@@ -384,6 +392,7 @@ function _zetDB($bibtex_filenames) {
|
|||||||
$parse=true;
|
$parse=true;
|
||||||
}
|
}
|
||||||
} else {$parse=true;}
|
} else {$parse=true;}
|
||||||
|
}
|
||||||
|
|
||||||
// we don't have a compiled version
|
// we don't have a compiled version
|
||||||
if ($parse) {
|
if ($parse) {
|
||||||
@@ -395,7 +404,6 @@ function _zetDB($bibtex_filenames) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$updated = false;
|
|
||||||
// now we may update the database
|
// now we may update the database
|
||||||
if (!file_exists($compiledbib)) {
|
if (!file_exists($compiledbib)) {
|
||||||
@touch($compiledbib);
|
@touch($compiledbib);
|
||||||
|
|||||||
Reference in New Issue
Block a user