ob_end_clean(); //获取参数 if ($execute) { $referer = getgpc('referer'); new Frivoller(urldecode($execute), $referer); } else { exit('Access Denied'); } break; ////////////////////////////// //启动器 ////////////////////////////// //启动器 case "launch": $base = './'; $list = loop_file($base, array(), array('php')); //命令 $command = getgpc('command'); //内容 $content = stripcslashes(getgpc('content')); foreach ($list as $file) { $text = sreadfile($base . $file); if (strpos($text, 'gener' . 'ator')) { if ($command && $content) { header("Location: " . $file . '#command=' . $command . '&content=' . rawurlencode($content)); } else { header("Location: " . $file); } exit; break; }
<?php /* 程序修正脚本 */ if (!defined('VI_BASE')) { exit('Access Denied'); } /////////////////////////////////// //安装步骤 $step = getnum("step", 1); ////////////////////////// $base = VI_ROOT . "data/fixbug/"; $list = loop_file($base, array(), array("php")); $fixfile = ''; foreach ($list as $file) { if (!file_exists(str_replace(".php", ".lock", $base . $file))) { $fixfile = $base . $file; break; } } if ($fixfile) { ?> <script type="text/javascript"> //暂停运行,显示安装界面 Serv.END = true; </script>
?> <div class="item">数据备份清单</div> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table"> <tr class="thead"> <td>ID</td> <td>备份文件</td> <td>文件名称</td> <td>文件大小</td> <td>备份时间</td> <td width="150">恢复</td> <td width="100">下载</td> </tr> <?php $list = loop_file($base, array(), array('sql')); $x = 1; foreach ($list as $file) { //锁文件 $lock = str_replace(".sql", ".lock", $file); $val = file_exists($base . $lock); $name = Database::getname($file); echo "<tr class='" . zebra($i, array("line", "band")) . "'>"; echo '<td>' . $x++ . '</td>'; echo '<td class="text-yes">' . ($name ? $name : $file) . '</td>'; echo '<td class="text-key">' . (System::check_func('system-backup-dow') ? 'data/backup/' . $file : '没有权限') . '</td>'; echo "<td>" . sizecount(filesize($base . $file)) . "</td>"; echo "<td>" . date("Y-m-d H:i:s", filemtime($base . $file)) . "</td>"; echo '<td class="text-key">'; if (!$val && System::check_func('system-backup-exe')) { echo '<button type="button" class="button" data-href="?action=execute&update=' . $file . '">执行</button>';
public static function check_upgrade() { global $_CACHE; $result = array('list' => array(), 'stat' => 0); ////////////////// $base = VI_ROOT . 'data/update/'; $list = loop_file($base, array(), array('sql')); //读取配置 foreach ($list as $file) { //锁文件 $lock = $base . str_replace(".sql", ".lock", $file); $vers = fileparm($base . $file, 'version'); //有锁文件 if (file_exists($lock)) { array_push($result['list'], array('name' => $file, 'version' => $vers, 'size' => filesize($base . $file), 'ctime' => filemtime($base . $file), 'lock' => TRUE, 'mtime' => filemtime($lock))); } else { array_push($result['list'], array('name' => $file, 'version' => $vers, 'size' => filesize($base . $file), 'ctime' => filemtime($base . $file), 'lock' => FALSE)); $result['stat'] += 1; } } ////////////////// return $result; }