本文整理汇总了PHP中CacheControl::flushAll方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheControl::flushAll方法的具体用法?PHP CacheControl::flushAll怎么用?PHP CacheControl::flushAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheControl
的用法示例。
在下文中一共展示了CacheControl::flushAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearCache
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;
}
示例2:
<?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);
}
示例3: writeSkinHtml
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;
}
}
示例4: clearCache
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;
}
示例5: array
<?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);
示例6: writeSkinHtml
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;
}
}