function Sammlung($twResult) { $wordListIndex = $wordList = array(); foreach ($twResult->entry as $entry) { $content = $entry->content; $uuid = uniqid(); $contentTempFile = makeTempFile("content_{$uuid}", $content); $contentMeCabResult = parseMeCab($contentTempFile); foreach ($contentMeCabResult as $val) { $contentWord = parseMeCabResult($val); if (!isset($contentWord[1])) { $contentWord[1] = ""; } if (!isset($contentWord[9]) or $contentWord[9] == "*") { $contentWord[9] = ""; } $wordLastChar = getLastChar($contentWord[9]); if (preg_match("/^(名詞)+\$/u", $contentWord[1]) == 1 and !empty($contentWord[9]) and preg_match("/^(ん|ー|ぁ|ぃ|ぅ|ぇ|ぉ|っ|ゃ|ゅ|ょ)+\$/iu", $wordLastChar) == 0) { if (array_search($contentWord[0], $wordListIndex) === FALSE) { // 新規単語 $wordList["{$contentWord[0]}"] = array('word' => $contentWord[0], 'hinshi' => $contentWord[1], 'yomi' => $contentWord[9]); $wordListIndex[] = $contentWord[0]; } } } } return $wordList; }
} $display .= checkInstallDir(); $urls = array(array('db-config.php', 'db-config.php'), array('logs/error.log', 'logs ' . $LANG_SECTEST['directory']), array('plugins/staticpages/functions.inc', 'plugins ' . $LANG_SECTEST['directory']), array('system/lib-security.php', 'system ' . $LANG_SECTEST['directory'])); foreach ($urls as $toCheck) { $display .= doTest($url, $toCheck[0], $toCheck[1]); } // Note: We're not testing the 'sql' and 'language' directories. if (isset($_CONF['allow_mysqldump']) && $_CONF['allow_mysqldump'] == 1 && $_DB_dbms === 'mysql') { if (makeTempFile($_CONF['backup_path'] . 'test.txt')) { $display .= doTest($url, 'backups/test.txt', 'backups ' . $LANG_SECTEST['directory']); @unlink($_CONF['backup_path'] . 'test.txt'); } else { $display .= '<li>' . sprintf($LANG_SECTEST['failed_tmp'], 'backups') . '</li>'; } } if (makeTempFile($_CONF['path_data'] . 'test.txt')) { $display .= doTest($url, 'data/test.txt', 'data directory'); @unlink($_CONF['path_data'] . 'test.txt'); } else { $display .= '<li>' . sprintf($LANG_SECTEST['failed_tmp'], 'data') . '</li>'; } $display .= checkDefaultPassword(); $display .= '</ol>'; } else { $resultInstallDirCheck = checkInstallDir(); $resultPasswordCheck = checkDefaultPassword(); if ($failed_tests == 0) { $display .= '<p>' . $LANG_SECTEST['okay'] . '</p>'; } else { $display .= '<ol>' . $resultInstallDirCheck . LB . $resultPasswordCheck . '</ol>'; }