diff --git a/cache/installedVersion.json b/cache/installedVersion.json index c654cda..7296cb6 100644 --- a/cache/installedVersion.json +++ b/cache/installedVersion.json @@ -1,4 +1,3 @@ { - "id": 133359767, - "tag_name": "v2.8.9" -} + "tag_name": "v2.8.9" +} \ No newline at end of file diff --git a/system/admin/views/update.html.php b/system/admin/views/update.html.php index e57d685..821417e 100644 --- a/system/admin/views/update.html.php +++ b/system/admin/views/update.html.php @@ -10,6 +10,26 @@ $updater = new HubUpdater(array( 'prerelease' => !!config("prerelease"), )); +$dir = 'cache/'; +if (!is_dir($dir)) { + mkdir($dir, 0775, true); +} +if (defined("JSON_PRETTY_PRINT")) { + file_put_contents( + 'cache/installedVersion.json', + json_encode(array( + "tag_name" => constant('HTMLY_VERSION') + ), JSON_PRETTY_PRINT) + ); +} else { + file_put_contents( + 'cache/installedVersion.json', + json_encode(array( + "tag_name" => constant('HTMLY_VERSION') + )) + ); +} + if (empty($updater->getNewestInfo())) { echo '

'.i18n('Update').'


'; echo "Can't check Github server for latest version. You are probably offline."; diff --git a/system/includes/dispatch.php b/system/includes/dispatch.php index 5758f2d..fcc5d6a 100644 --- a/system/includes/dispatch.php +++ b/system/includes/dispatch.php @@ -184,15 +184,15 @@ function delete_cookie() setcookie($ck, '', -10, '/'); } -// if we have APC loaded, enable cache functions -if (extension_loaded('apc')) { +// if we have APCu loaded, enable cache functions +if (extension_loaded('apcu')) { function cache($key, $func, $ttl = 0) { - if (($data = apc_fetch($key)) === false) { + if (($data = apcu_fetch($key)) === false) { $data = call_user_func($func); if ($data !== null) { - apc_store($key, $data, $ttl); + apcu_store($key, $data, $ttl); } } return $data; @@ -201,7 +201,7 @@ if (extension_loaded('apc')) { function cache_invalidate() { foreach (func_get_args() as $key) { - apc_delete($key); + apcu_delete($key); } } diff --git a/system/includes/functions.php b/system/includes/functions.php index afaeb7b..b577891 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -255,7 +255,7 @@ function rebuilt_cache($type = null) $category_cache = array(); $draft_cache = array(); - if (is_dir($dir) === false) { + if (!is_dir($dir)) { mkdir($dir, 0775, true); } @@ -1001,7 +1001,7 @@ function category_list($custom = null) { $cat = array(); $list = array(); - if (is_dir($dir) === false) { + if (!is_dir($dir)) { mkdir($dir, 0775, true); } @@ -1455,7 +1455,7 @@ function recent_posts($custom = null, $count = null) $tmp = array(); $posts = array(); - if (is_dir($dir) === false) { + if (!is_dir($dir)) { mkdir($dir, 0775, true); } @@ -1502,7 +1502,7 @@ function recent_type($type, $custom = null, $count = null) $tmp = array(); $posts = array(); - if (is_dir($dir) === false) { + if (!is_dir($dir)) { mkdir($dir, 0775, true); } @@ -1572,7 +1572,7 @@ function popular_posts($custom = null, $count = null) $ar = array(); $posts = array(); - if (is_dir($dir) === false) { + if (!is_dir($dir)) { mkdir($dir, 0775, true); } @@ -1631,7 +1631,7 @@ function archive_list($custom = null) $filename = "cache/widget/archive.cache"; $ar = array(); - if (is_dir($dir) === false) { + if (!is_dir($dir)) { mkdir($dir, 0775, true); } @@ -1738,7 +1738,7 @@ function tag_cloud($custom = null) $filename = "cache/widget/tags.cache"; $tg = array(); - if (is_dir($dir) === false) { + if (!is_dir($dir)) { mkdir($dir, 0775, true); }