Esempio n. 1
0
 private function __construct()
 {
     $this->sphinx = \Utility_SphinxClient::Connection('filter_comment');
     $this->db = new \JMDbMysqlReadWriteSplit();
     $this->redis = \JMRedis::getConnectionByName('filter_comment');
     $this->totalWordNum = $this->redis->get(COMMENT_WORDS_COUNTER);
 }
 * Email:  wenjun1055@gmail.com
 *
 * File:   comment_filter_check_everyday.php
 * Desc:   每天运行一次,纠正程序自动屏蔽评论的错误问题
 */
if (!defined('SHOWMONITORS')) {
    define('SHOWMONITORS', false);
}
require_once dirname(__FILE__) . '/../../Koubei/config.inc.php';
require_once JM_FRAMEWORK_ROOT . 'JMFrameworkConsole.php';
JMRegistry::set('serverConfig', $serverConfig);
JMRegistry::set('rpcServer', $rpcServer);
JMRegistry::set('monoLogger', $monoLogger);
$dbRW = new JMDbMysqlReadWriteSplit();
$dbRW->addMaster(JMDbMysql::GetConnection(DATABASE));
$redis = JMRedis::getConnectionByName('local');
$rpcClient = new JMRpcClient('filter_comment');
$rpcClient->_setClass('Comment');
$sphinx = Utility_SphinxClient::Connection();
$sphinx->ResetFilters();
$allWordCounter = 0;
$healthArray = array();
$spamArray = array();
$allArray = array();
function utfSubstr($str)
{
    for ($i = 0; $i < 30; $i++) {
        $tempStr = substr($str, 0, 1);
        if (ord($tempStr) > 127) {
            $i++;
            if ($i < 15) {