コード例 #1
0
        throw new Exception('PHP Mongodb extension library is not installed yet!');
    } else {
        $Mongo = new MongoClient();
        // select index
        $biblio = $Mongo->slims->biblio;
    }
}
/* main content */
if (isset($_POST['detail']) or isset($_GET['action']) and $_GET['action'] == 'detail') {
    if (!($can_read and $can_write)) {
        die('<div class="errorBox">' . __('You don\'t have enough privileges to view this section') . '</div>');
    }
    /* empty table */
    if ($_GET['detail'] == 'empty') {
        $indexer = new biblio_indexer($dbs);
        $empty = $indexer->emptyingIndex();
        if ($empty) {
            $message = __('Index table truncated!');
        } else {
            $message = __('Index table FAILED to truncated, probably because of database query error!');
        }
        $_SESSION['message'] = $message;
    }
    /* Update table */
    if ($_GET['detail'] == 'update') {
        set_time_limit(0);
        $indexer = new biblio_indexer($dbs);
        $indexer->updateFullIndex();
        $finish_minutes = $indexer->indexing_time / 60;
        $finish_sec = $indexer->indexing_time % 60;
        // message