コード例 #1
0
ファイル: pagelinks.php プロジェクト: ahastudio/moniwiki
 *
 * @since 2012/05/17
 * @license GPLv2
 */
define('INC_MONIWIKI', 1);
include_once "wiki.php";
# Start Main
$Config = getConfig("config.php");
require_once "wikilib.php";
require_once "lib/win32fix.php";
require_once "lib/wikiconfig.php";
require_once "lib/cache.text.php";
require_once "lib/timer.php";
$Config = wikiConfig($Config);
$DBInfo = new WikiDB($Config);
$p = $DBInfo->getPage('FrontPage');
$formatter = new Formatter($p);
if (empty($formatter->wordrule)) {
    $formatter->set_wordrule();
}
$options = array();
if (class_exists('Timer')) {
    $timing = new Timer();
    $options['timer'] =& $timing;
    $options['timer']->Check("load");
}
$handle = opendir($DBInfo->text_dir);
if (!is_resource($handle)) {
    echo "Can't open {$DBInfo->text_dir}\n";
    exit;
}
コード例 #2
0
ファイル: redirects.php プロジェクト: ahastudio/moniwiki
 * @license GPLv2
 */
define('INC_MONIWIKI', 1);
$topdir = realpath(dirname(__FILE__) . '/../');
include_once $topdir . "/wiki.php";
// Start Main
$Config = getConfig($topdir . '/config.php');
require_once $topdir . '/wikilib.php';
require_once $topdir . '/lib/win32fix.php';
require_once $topdir . '/lib/wikiconfig.php';
require_once $topdir . '/lib/cache.text.php';
require_once $topdir . '/lib/timer.php';
include_once dirname(__FILE__) . '/utils.php';
$Config = wikiConfig($Config);
$DBInfo = new WikiDB($Config);
$p = $DBInfo->getPage('FrontPage');
$formatter = new Formatter($p);
if (empty($formatter->wordrule)) {
    $formatter->set_wordrule();
}
$params = array();
if (class_exists('Timer')) {
    $timing = new Timer();
    $params['timer'] =& $timing;
    $params['timer']->Check("load");
}
$options = array();
$options[] = array('f', '', "force update redirect caches");
$options[] = array('d', '', "debug");
$short_opts = '';
// list of short options.
コード例 #3
0
ファイル: indexer.php プロジェクト: ahastudio/moniwiki
}
$indexer = new Indexer_DBA('fullsearch', 'w', $DBInfo->dba_type, 'new');
#$indexer->test();
#exit;
$handle = opendir($DBInfo->text_dir);
if (!is_resource($handle)) {
    echo "Can't open {$DBInfo->text_dir}\n";
    exit;
}
$ii = 1;
while (($file = readdir($handle)) !== false) {
    if (is_dir($DBInfo->text_dir . "/" . $file)) {
        continue;
    }
    $pagename = $DBInfo->keyToPagename($file);
    $p = $DBInfo->getPage($pagename);
    print "* [{$ii}] {$pagename} ";
    $ii++;
    if (!$p->exists()) {
        continue;
    }
    $raw = $p->_get_raw_body();
    $words = getTokens($raw);
    print ' ' . count($words) . "\n";
    $indexer->addWordCache($pagename, $words);
    if (count($indexer->wordcache) > 10000) {
        $indexer->flushWordCache(false);
    }
    #$indexer->addWords($pagename, $words);
}
$indexer->flushWordCache();