当前位置: 首页>>代码示例>>PHP>>正文


PHP CacheEngine::CacheCommonWords方法代码示例

本文整理汇总了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;
}
开发者ID:Cythral,项目名称:futurebb,代码行数:23,代码来源:search.php

示例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');
开发者ID:Cythral,项目名称:futurebb,代码行数:10,代码来源:clearcache.php


注:本文中的CacheEngine::CacheCommonWords方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。