예제 #1
0
<?php

/**
 * easy4php
 *
 * check the database 
 *
 * @copyright	Copyright (c) 2013 - 2018
 * @link		http://www.easy4php.com
 * @author		kuishui
 * @version		1.0
 */
require_once 'init.php';
importClass('DB_Factory');
$dbFac = new DB_Factory($_POST);
list($result, $msg) = $dbFac->dbCheck();
if ($result === true) {
    importClass('File');
    $file = md5(implode(',', $_POST));
    File::writeFile(TMP . 'config_' . $file . '.php', serialize($msg), 'w');
    $return = 'succ|' . $file;
} else {
    $return = 'fail|' . $msg;
}
header('Content-Type: text/html; charset=gbk');
exit($return);
?>

예제 #2
0
<?php

require_once 'init.php';
if ($_POST['params']) {
    $dbUnique = $_POST['u'];
    $dbConfig = getConfigByUnique($dbUnique);
    importClass('DB_Factory');
    $dbFac = new DB_Factory($dbConfig);
    $bakDir = 'e:/0501';
    $bakFileSize = 2024;
    list($startRow, $goOn, $tableId, $fileId, $loop, $bakFixPrefix) = explode('|', $_POST['params']);
    $bakTables = explode('|', trim($_POST['tables'], '|'));
    $dbBak = $dbFac->getBackup($bakDir, $bakFileSize, $bakTables, $bakFixPrefix);
    $result = $dbBak->begin($startRow, $goOn, $tableId, $fileId, $loop);
    if ($result === true) {
        exit('succ');
    } else {
        exit(implode('|', $result));
    }
} else {
    $dbUnique = $_GET['u'];
    $dict = getDictByConfig($dbUnique);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<?php 
echo URL;
?>
"  />
<?php

require_once 'init.php';
$dbUnique = $_GET['u'];
$dbConfig = getConfigByUnique($dbUnique);
importClass('DB_Factory');
$dbFac = new DB_Factory($dbConfig);
$bakDir = 'e:/0501/';
$dbRecover = $dbFac->getRecover($bakDir);
$allBakTables = $dbRecover->getBakTables();
if ($_GET['tables']) {
    $recover = explode('|', $_GET['tables']);
    $dbRecover->recoverPartsTables($recover);
    exit('ok');
}
//V($allBakTables);
//$recover = array('user_report') ;
//$dbRecover->recoverPartsTables($recover) ;
//exit;
//$result = $dbRecover->recoverAllFiles()  ;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<?php 
echo URL;
?>
"  />
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $_HERO['charset'];
?>
예제 #4
0
 *
 * @copyright	Copyright (c) 2013 - 2018
 * @link		http://www.easy4php.com
 * @author		keshuichong
 * @version		1.0
 */
require_once 'init.php';
$ope = $_GET['ope'];
$dbUnique = $_GET['u'];
ob_start();
importClass('File');
$dbConfig = getConfigByUnique($dbUnique);
$tmpDict = TMP . 'dict_' . $dbUnique . '.php';
if (!file_exists($tmpDict) || $ope == 'refresh' || $ope == 'init') {
    importClass('DB_Factory');
    $dbFac = new DB_Factory($dbConfig);
    $dict = $dbFac->getDict();
    $serialized_object = serialize($dict);
    $safe_object = str_replace("", "~~NULL_BYTE~~", $serialized_object);
    File::writeFile($tmpDict, $safe_object, 'w');
} else {
    $dict = getDictByConfig($dbUnique);
}
$msg = ob_get_contents();
ob_end_clean();
//V($msg);
if ($ope == 'init') {
    if ($msg) {
        exit('fail');
    }
    exit('succ');