本文整理汇总了PHP中CacheEngine::CacheCommonWords方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheEngine::CacheCommonWords方法的具体用法?PHP CacheEngine::CacheCommonWords怎么用?PHP CacheEngine::CacheCommonWords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheEngine
的用法示例。
在下文中一共展示了CacheEngine::CacheCommonWords方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: split_into_words
function split_into_words($text, $idx = false)
{
//this function is copied from FluxBB
if (!file_exists(FORUM_ROOT . '/app_config/cache/commonwords.php')) {
CacheEngine::CacheCommonWords();
}
include FORUM_ROOT . '/app_config/cache/commonwords.php';
// Remove BBCode
$text = preg_replace('%\\[/?(b|i|u|url)\\]%', ' ', $text);
// Remove any apostrophes or dashes which aren't part of words
$text = substr(preg_replace('%((?<=[^\\p{L}\\p{N}])[\'\\-]|[\'\\-](?=[^\\p{L}\\p{N}]))%u', '', ' ' . $text . ' '), 1, -1);
// Remove punctuation and symbols (actually anything that isn't a letter or number), allow apostrophes and dashes (and % * if we aren't indexing)
$text = preg_replace('%(?![\'\\-' . ($idx ? '' : '\\%\\*') . '])[^\\p{L}\\p{N}]+%u', ' ', $text);
// Replace multiple whitespace or dashes
$text = preg_replace('%(\\s){2,}%u', '\\1', $text);
// Fill an array with all the words
$words = explode(' ', $text);
//filter out common words
$words = array_filter($words, function ($word) use($common_words) {
return !in_array(strtolower($word), $common_words);
});
return $words;
}
示例2: array
<?php
$page_title = 'Clear cache';
$breadcrumbs = array(translate('administration') => 'admin', translate('interface') => 'admin/interface', 'Clear cache' => 'admin/interface/clearcache');
CacheEngine::CacheHeader();
CacheEngine::CacheLanguage();
CacheEngine::CacheAdminPages();
CacheEngine::CachePages();
CacheEngine::CacheCommonWords();
redirect($base_config['baseurl'] . '/admin/interface');