mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 03:56:21 +05:30
Update files
This commit is contained in:
parent
b024bcf662
commit
e0cd34b5cf
4 changed files with 34 additions and 15 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue