Browse Source

Update files

pull/674/head
danpros 1 year ago
parent
commit
e0cd34b5cf
4 changed files with 34 additions and 15 deletions
  1. +2
    -3
      cache/installedVersion.json
  2. +20
    -0
      system/admin/views/update.html.php
  3. +5
    -5
      system/includes/dispatch.php
  4. +7
    -7
      system/includes/functions.php

+ 2
- 3
cache/installedVersion.json View File

@ -1,4 +1,3 @@
{
"id": 133359767,
"tag_name": "v2.8.9"
}
"tag_name": "v2.8.9"
}

+ 20
- 0
system/admin/views/update.html.php View File

@ -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 '<h2>'.i18n('Update').'</h2><hr>';
echo "Can't check Github server for latest version. You are probably offline.";


+ 5
- 5
system/includes/dispatch.php View File

@ -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);
}
}


+ 7
- 7
system/includes/functions.php View File

@ -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);
}


Loading…
Cancel
Save