コード例 #1
0
ファイル: cache.php プロジェクト: sherlockhouse/aliyun
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
ファイル: task.php プロジェクト: sherlockhouse/aliyun
!function_exists('readover') && exit('Forbidden');
@set_time_limit(600);
@ignore_user_abort(TRUE);
$query = $db->query("SELECT * FROM pw_plan WHERE ifopen='1' AND nexttime<" . S::sqlEscape($timestamp));
while ($plan = $db->fetch_array($query)) {
    if (file_exists(R_P . 'require/plan/' . $plan['filename'] . '.php')) {
        $nexttime = nexttime($plan);
        require_once S::escapePath(R_P . 'require/plan/' . $plan['filename'] . '.php');
        $db->update("UPDATE pw_plan SET" . S::sqlSingle(array('usetime' => $timestamp, 'nexttime' => $nexttime), false) . "WHERE id=" . S::sqlEscape($plan['id'], false));
    }
}
$db->free_result($query);
unset($plan);
require_once R_P . 'admin/cache.php';
updatecache_plan();
function nexttime($plan)
{
    global $timestamp, $db_timedf;
    $t = gmdate('G', $timestamp + $db_timedf * 3600);
    $timenow = (int) (floor($timestamp / 3600) - $t) * 3600;
    $minute = (int) get_date($timestamp, 'i');
    $hour = get_date($timestamp, 'G');
    $day = get_date($timestamp, 'j');
    $month = get_date($timestamp, 'n');
    $year = get_date($timestamp, 'Y');
    $week = get_date($timestamp, 'w');
    $week == 0 && ($week = 7);
    if (is_numeric($plan['month'])) {
        $timenow += (min($plan['month'], DaysInMouth($month)) - $day) * 86400;
    } elseif (is_numeric($plan['week'])) {