Beispiel #1
0
function clearCache()
{
    global $database, $changed, $errorlog, $memcache;
    static $isCleared = false;
    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 (!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>';
    }
    $isCleared = true;
}
Beispiel #2
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)
require ROOT . '/library/preprocessor.php';
if (CacheControl::flushAll(getBlogId())) {
    Respond::ResultPage(0);
} else {
    Respond::ResultPage(-1);
}
Beispiel #3
0
function writeSkinHtml($blogid, $contents, $mode, $file)
{
    $context = Model_Context::getInstance();
    global $skinSetting;
    // Legacy global support. TODO: DELETE THIS LINE AFTER CHECK EVERY REFERENCES IN WHOLE SOURCE
    importlib('blogskin');
    if ($mode != 'skin' && $mode != 'skin_keyword' && $mode != 'style') {
        return _t('실패했습니다.');
    }
    if ($context->getProperty('skin.skin') != "customize/{$blogid}") {
        if (!@file_exists(getSkinPath("customize/{$blogid}"))) {
            if (!@mkdir(getSkinPath("customize/{$blogid}"))) {
                return _t('권한이 없습니다.');
            }
            @chmod(getSkinPath("customize/{$blogid}"), 0777);
        }
        deltree(getSkinPath("customize/{$blogid}"));
        copyRecusive(getSkinPath($context->getProperty('skin.skin')), getSkinPath("customize/{$blogid}"));
    }
    $skinSetting['skin'] = "customize/{$blogid}";
    // Legacy global support. TODO: DELETE THIS LINE AFTER CHECK EVERY REFERENCES IN WHOLE SOURCE
    $context->setProperty('skin.skin', "customize/" . $blogid);
    if (!Setting::setSkinSetting('skin', $context->getProperty('skin.skin'), $blogid)) {
        return _t('실패했습니다.');
    }
    //if ($mode == 'style')
    //	$file = $mode . '.css';
    //else
    //	$file = $mode . '.html';
    if (!is_writable(getSkinPath("customize/{$blogid}") . "/{$file}")) {
        return $file . _t('권한이 없습니다.') . " -> /skin/blog/customize/{$blogid}/{$file}";
    }
    $handler = fopen(getSkinPath("customize/{$blogid}") . "/{$file}", 'w');
    if (fwrite($handler, $contents) === false) {
        fclose($handler);
        return _t('실패했습니다.');
    } else {
        fclose($handler);
        @chmod(getSkinPath("customize/{$blogid}") . "/{$file}", 0666);
        CacheControl::flushAll();
        CacheControl::flushSkin();
        return true;
    }
}
Beispiel #4
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;
}
Beispiel #5
0
<?php

/// Copyright (c) 2004-2015, 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('POST' => array('confirmativePassword' => array('string', 'mandatory' => false), 'removeAttachments' => array(array('0', '1'), 'dafault' => null)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (empty($_POST['confirmativePassword']) || !User::confirmPassword(User::getBlogOwner(getBlogId()), $_POST['confirmativePassword'])) {
    Respond::ResultPage(1);
}
DataMaintenance::removeAll(Validator::getBool(@$_POST['removeAttachments']));
CacheControl::flushAll();
Respond::ResultPage(0);
Beispiel #6
0
function writeSkinHtml($blogid, $contents, $mode, $file)
{
    global $database;
    global $skinSetting;
    requireComponent('Needlworks.Cache.PageCache');
    requireLibrary('blog.skin');
    if ($mode != 'skin' && $mode != 'skin_keyword' && $mode != 'style') {
        return _t('실패했습니다.');
    }
    if ($skinSetting['skin'] != "customize/{$blogid}") {
        if (!@file_exists(ROOT . "/skin/blog/customize/{$blogid}")) {
            if (!@mkdir(ROOT . "/skin/blog/customize/{$blogid}")) {
                return _t('권한이 없습니다.');
            }
            @chmod(ROOT . "/skin/blog/customize/{$blogid}", 0777);
        }
        deltree(ROOT . "/skin/blog/customize/{$blogid}");
        copyRecusive(ROOT . "/skin/blog/{$skinSetting['skin']}", ROOT . "/skin/blog/customize/{$blogid}");
    }
    $skinSetting['skin'] = "customize/{$blogid}";
    Setting::setSkinSetting('skin', $skinSetting['skin'], $blogid);
    if (!Setting::setSkinSetting('skin', $skinSetting['skin'], $blogid)) {
        return _t('실패했습니다.');
    }
    //if ($mode == 'style')
    //	$file = $mode . '.css';
    //else
    //	$file = $mode . '.html';
    if (!is_writable(ROOT . "/skin/blog/customize/{$blogid}/{$file}")) {
        return ROOT . _t('권한이 없습니다.') . " -> /skin/blog/customize/{$blogid}/{$file}";
    }
    $handler = fopen(ROOT . "/skin/blog/customize/{$blogid}/{$file}", 'w');
    if (fwrite($handler, $contents) === false) {
        fclose($handler);
        return _t('실패했습니다.');
    } else {
        fclose($handler);
        @chmod(ROOT . "/skin/blog/customize/{$blogid}/{$file}", 0666);
        CacheControl::flushAll();
        CacheControl::flushSkin();
        return true;
    }
}