Пример #1
0
function updatecache($array = '')
{
    if (empty($array) || !is_array($array)) {
        updatecache_i(1);
        if (R_P == D_P || !file_exists(D_P . 'data/bbscache/config.php') || !file_exists(D_P . 'data/bbscache/dbreg.php')) {
            updatecache_c();
        }
        updatecache_p(1);
        updatecache_w();
        updatecache_sy();
        updatecache_g();
        updatecache_bk();
        updatecache_df();
        updatecache_ol();
        updatecache_mddb(1);
        updatecache_ml();
        updatecache_f(1);
        updatecache_l(1);
        updatecache_gr(1);
        updatecache_inv();
        updatecache_plan();
        updatecache_ftp();
        updatecache_field(1);
        updatecache_form();
        updatecache_help();
        cache_read();
        updatecache_hotforum();
        updatecache_openforum();
        updatecache_topic();
        updatecache_postcate();
        updateCacheActivity();
        updatecache_conf('nf', false, 'newinfo_config.php');
        //updateStampCache();
        //updateBlockCache();
    } else {
        foreach ($array as $value) {
            $value();
        }
    }
}
Пример #2
0
                    $vtype = 'array';
                    $value = serialize($value);
                }
                $configdb[$var] = array($var, $vtype, $value);
            }
        }
    }
    if (!empty($configdb)) {
        $names = array_keys($configdb);
        $query = $db->query('SELECT db_name,vtype,db_value FROM pw_config WHERE db_name IN (' . pwImplode($names, false) . ')');
        while ($rt = $db->fetch_array($query)) {
            if (isset($configdb[$rt['db_name']])) {
                if ($rt['db_value'] != $configdb[$rt['db_name']]) {
                    $db->update("UPDATE pw_config SET " . pwSqlSingle(array('db_value' => $configdb[$rt['db_name']][2], 'vtype' => $configdb[$rt['db_name']][1])) . ' WHERE db_name=' . pwEscape($rt['db_name']));
                }
                $configdb[$rt['db_name']] = '';
            }
        }
        $db->free_result($query);
        $pwSqlMulti = pwSqlMulti($configdb);
        $pwSqlMulti && $db->update('INSERT INTO pw_config (db_name,vtype,db_value) VALUES' . $pwSqlMulti);
        updatecache_c();
        if (!empty($ftp)) {
            updatecache_ftp();
        }
        if (!empty($mail)) {
            updatecache_ml();
        }
    }
    adminmsg('operate_success');
}