summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-01-13 22:03:42 +0300
committerAndrew Dolgov <[email protected]>2010-01-13 22:03:42 +0300
commit199db684f3e90903f6605e2b8bd088e0ba34b551 (patch)
tree21af4aa4fe5d42b541cd87ee7d51a53d1aa6e668 /functions.php
parent5eee1b4247922352b1eca819d9fc981e937e4a22 (diff)
get_schema_version: add nocache parameter
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/functions.php b/functions.php
index 507595e77..3d09e0f69 100644
--- a/functions.php
+++ b/functions.php
@@ -2054,9 +2054,15 @@
return "even";
}
- function get_schema_version($link) {
- $result = db_query($link, "SELECT schema_version FROM ttrss_version");
- return (int) db_fetch_result($result, 0, "schema_version");
+ function get_schema_version($link, $nocache = false) {
+ if (!$_SESSION["schema_version"] || $nocache) {
+ $result = db_query($link, "SELECT schema_version FROM ttrss_version");
+ $version = db_fetch_result($result, 0, "schema_version");
+ $_SESSION["schema_version"] = $version;
+ return $version;
+ } else {
+ return $_SESSION["schema_version"];
+ }
}
function sanity_check($link) {