Exemple #1
0
 if (!count($datas)) {
     $error = true;
     $sysmsg[] = __('pls_select_target');
 }
 if (!$error) {
     if ($datas['tpl'] == 'tpl') {
         del_cache(PHPDISK_ROOT . 'system/' . $user_tpl_dir);
         del_cache(PHPDISK_ROOT . 'system/' . $admin_tpl_dir);
         tpl_cache();
         $sysmsg[] = __('tpl_cache_update_success');
     }
     if ($datas['cache'] == 'cache') {
         del_cache(PHPDISK_ROOT . 'system/global/', 'cache_settings.inc.php');
         settings_cache();
         lang_cache();
         plugin_cache();
         group_settings_cache();
         $stats['user_folders_count'] = (int) @$db->result_first("select count(*) from {$tpf}folders");
         $stats['user_files_count'] = (int) @$db->result_first("select count(*) from {$tpf}files");
         $stats['users_count'] = (int) @$db->result_first("select count(*) from {$tpf}users ");
         $stats['users_locked_count'] = (int) @$db->result_first("select count(*) from {$tpf}users where is_locked=1");
         $stats['all_files_count'] = (int) @$db->result_first("select count(*) from {$tpf}files");
         $storage_count_tmp = (double) @$db->result_first("select sum(file_size) from {$tpf}files");
         $stats['user_storage_count'] = get_size($storage_count_tmp);
         $stats['total_storage_count'] = get_size($storage_count_tmp);
         $stats['users_open_count'] = $stats['users_count'] - $stats['users_locked_count'];
         $stats['stat_time'] = $timestamp;
         stats_cache($stats);
         $sysmsg[] = __('data_cache_update_success');
     }
     redirect(urr(ADMINCP, "item=cache&menu=tool&action={$action}"), $sysmsg);
Exemple #2
0
function syn_plugins()
{
    global $db, $tpf;
    $dirs = scandir(PD_PLUGINS_DIR);
    sort($dirs);
    for ($i = 0; $i < count($dirs); $i++) {
        if (check_plugin($dirs[$i])) {
            $arr[] = $dirs[$i];
        }
    }
    if (count($arr)) {
        $q = $db->query("select * from {$tpf}plugins where actived=1");
        while ($rs = $db->fetch_array($q)) {
            if (check_plugin($rs['plugin_name'])) {
                $active_plugins .= $rs['plugin_name'] . ',';
                $active_time[$rs['plugin_name']] = $rs['action_time'];
                $plugin_in_shortcut[$rs['plugin_name']] = $rs['in_shortcut'];
            }
        }
        $db->free($q);
        unset($rs);
        if (trim(substr($active_plugins, 0, -1))) {
            $active_arr = explode(',', $active_plugins);
        }
        for ($i = 0; $i < count($arr); $i++) {
            if (@in_array($arr[$i], $active_arr)) {
                $sql_do .= "('" . $db->escape($arr[$i]) . "','1','" . $active_time[$arr[$i]] . "','" . $plugin_in_shortcut[$arr[$i]] . "'),";
            } else {
                $sql_do .= "('" . $db->escape($arr[$i]) . "','0','0','0'),";
            }
        }
        $sql_do = substr($sql_do, 0, -1);
        $db->query_unbuffered("truncate table {$tpf}plugins;");
        $db->query_unbuffered("replace into {$tpf}plugins(plugin_name,actived,action_time,in_shortcut) values {$sql_do} ;");
        plugin_cache();
        return true;
    }
}
Exemple #3
0
    error_reporting(0);
    @ini_set('display_errors', 'Off');
}
$charset = $configs['charset'];
$charset_arr = array('gbk' => 'gbk', 'utf-8' => 'utf8');
$db_charset = $charset_arr[strtolower($configs['charset'])];
header("Content-Type: text/html; charset={$charset}");
require_once PHPDISK_ROOT . 'includes/core/core.phpdisk.php';
phpdisk_core::init_core();
$db = phpdisk_core::init_db_connect();
$setting_file = PHPDISK_ROOT . 'system/settings.inc.php';
file_exists($setting_file) ? require_once $setting_file : settings_cache();
//init base env
require_once PHPDISK_ROOT . 'system/adminset.inc.php';
$file = PHPDISK_ROOT . 'system/global/plugin_settings.inc.php';
file_exists($file) ? require_once $file : plugin_cache();
$file = PHPDISK_ROOT . 'system/global/group_settings.inc.php';
file_exists($file) ? require_once $file : group_settings_cache();
$file = PHPDISK_ROOT . 'system/global/stats.inc.php';
file_exists($file) ? require_once $file : stats_cache();
unset($file);
// debug
$settings[open_cache] = 1;
//(int)$settings[open_cache];
//
require PHPDISK_ROOT . 'includes/class/cache_file.class.php';
$C['gz']['open'] = $settings['gzipcompress'];
phpdisk_core::gzcompress_open();
$arr = phpdisk_core::init_lang_tpl();
$user_tpl_dir = $arr['user_tpl_dir'];
$admin_tpl_dir = $arr['admin_tpl_dir'];