} } array_push($GLOBALS['vars']['amountRabbit'], $amountRabbit); array_push($GLOBALS['vars']['amountWolf'], $amountWolf); array_push($GLOBALS['vars']['amountCarrot'], count(getPrize())); /* Loading screen counter */ if (getTime() % 5 == 0) { if (($loadingFile = fopen("../resources/log/loading_" . $GLOBALS["sessionId"] . ".txt", "w")) == true) { fwrite($loadingFile, getTime() . ' - ' . round(getTime() / getLength() * 100, 2) . " %"); fclose($loadingFile); } } } closeFile('Log'); closeFile('WorldDraw'); closeFile('Debug'); // closeFile('Conf'); $memory = memory_get_usage(true); $timeFinish = microtime(true); //session_start(); // World // Size $_SESSION['row'] = getSizeWorld()['row']; $_SESSION['col'] = getSizeWorld()['col']; // Memory and execution time $_SESSION['memory'] = $memory / 1024 / 1024; $_SESSION['time'] = round($timeFinish - $timeStart, 2); // Statistics // Weather $_SESSION['weather'] = $GLOBALS['vars']['countWeather']; // Population of elements
private function BatchBackupTable($tablenames) { if (!empty($tablenames)) { $theverifycode = substr(md5(rand(0, 9999)), 6, 12); $filename = TABLE_PREFIX . $theverifycode . '_' . date("ymd") . '.sql'; $path = $this->backupDir . $filename; $fp = openFileWrite($path); if ($fp) { for ($i = 0; $i < count($tablenames); $i++) { $msg = $msg . $this->BackupTable($tablenames[$i], $fp); } closeFile($fp); } $msg .= '<span class=note>数据已备份到文件: ' . $this->backupUrl . $filename . Iif(function_exists('gzopen'), '.gz') . '</span>'; } return $msg; }
function resetFile(&$file, &$handle) { closeFile($handle); openFile($file, $handle); }