Пример #1
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('type' => array('int'), 'ajaxcall' => array('any', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.trash");
requireStrictRoute();
if ($_GET['type'] == 1) {
    emptyTrash(true);
} else {
    if ($_GET['type'] == 2) {
        emptyTrash(false);
    } else {
        Respond::NotFoundPage();
    }
}
if (array_key_exists('ajaxcall', $_GET)) {
    Respond::ResultPage(0);
} else {
    if ($_GET['type'] == 1) {
        header("Location: " . $context->getProperty('uri.blog') . '/owner/communication/trash/comment');
    } else {
        if ($_GET['type'] == 2) {
            header("Location: " . $context->getProperty('uri.blog') . '/owner/communication/trash/trackback');
        }
    }
}
Пример #2
0
function clearCache()
{
    global $database, $changed, $errorlog, $memcache;
    static $isCleared = false;
    $context = Model_Context::getInstance();
    if ($isCleared == true) {
        return;
    }
    if (!is_null($blogids = POD::queryColumn("SELECT blogid FROM {$database['prefix']}PageCacheLog"))) {
        $changed = true;
        $errorlog = false;
        echo '<li>', _textf('페이지 캐시를 초기화합니다.'), ': ';
        foreach ($blogids as $ids) {
            if (CacheControl::flushAll($ids) == false) {
                $errorlog = true;
            }
        }
        if ($errorlog == false) {
            echo '<span class="result success">', _text('성공'), '</span></li>';
        } else {
            echo '<span class="result fail">', _text('실패'), '</span></li>';
        }
    }
    if ($context->getProperty('service.codecache', false)) {
        $changed = true;
        $errorlog = false;
        echo '<li>', _textf('코드 캐시를 초기화합니다.'), ': ';
        $code = new CodeCache();
        $code->flush();
        if ($errorlog == false) {
            echo '<span class="result success">', _text('성공'), '</span></li>';
        } else {
            echo '<span class="result fail">', _text('실패'), '</span></li>';
        }
    }
    if (!is_null($memcache)) {
        echo '<li>', _textf('Memcached 캐시를 초기화합니다.'), ': ';
        if ($memcache->flush()) {
            echo '<span class="result success">', _text('성공'), '</span></li>';
        } else {
            echo '<span class="result fail">', _text('실패'), '</span></li>';
        }
    }
    echo '<li>', _textf('공지사항 캐시를 초기화합니다.'), ': ';
    if (POD::execute("DELETE FROM {$database['prefix']}ServiceSettings WHERE name like 'TextcubeNotice%'")) {
        echo '<span class="result success">', _text('성공'), '</span></li>';
    } else {
        echo '<span class="result fail">', _text('실패'), '</span></li>';
    }
    if (!is_null($blogids = POD::queryColumn("SELECT DISTINCT blogid FROM {$database['prefix']}BlogSettings"))) {
        $changed = true;
        $errorlog = false;
        echo '<li>', _textf('댓글 및 트랙백 휴지통을 비웁니다.'), ': ';
        foreach ($blogids as $ids) {
            emptyTrash(true, $ids);
            emptyTrash(false, $ids);
        }
        if ($errorlog == false) {
            echo '<span class="result success">', _text('성공'), '</span></li>';
        } else {
            echo '<span class="result fail">', _text('실패'), '</span></li>';
        }
    }
    $isCleared = true;
}