Skip to content

Commit

Permalink
refs #1798 : modify - version query now uses Setting model.
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Jun 6, 2015
1 parent d60af93 commit 334520b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions library/model/blog/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
define('__TEXTCUBE_CHECKUP_FILE__', __TEXTCUBE_CACHE_DIR__ . '/CHECKUP');

function getBlogVersion() {
global $database;
if (defined('__TEXTCUBE_GAE__')) {
$query = "SELECT value FROM {$database['prefix']}ServiceSettings WHERE name = 'blogVersion'";
$version = POD::queryCell($query);
$version = Setting::getServiceSetting('blogVersion',null,true);
if (is_null($version)) {
$version = '0';
}
Expand All @@ -22,13 +20,9 @@ function getBlogVersion() {
}

function setBlogVersion() {
global $database;
$version = TEXTCUBE_VERSION_ID;
if (defined('__TEXTCUBE_GAE__')) {
$query = "INSERT into {$database['prefix']}ServiceSettings " .
" (name, value) VALUES ('blogVersion', '{$version}')" .
" ON DUPLICATE KEY UPDATE value=VALUES(value)";
POD::execute($query);
Setting::setServiceSetting('blogVersion',$version,true);
return;
}
$fp = fopen(__TEXTCUBE_CHECKUP_FILE__, 'w');
Expand Down

0 comments on commit 334520b

Please sign in to comment.