当前位置: 首页>>代码示例>>PHP>>正文


PHP dbstuff::version方法代码示例

本文整理汇总了PHP中dbstuff::version方法的典型用法代码示例。如果您正苦于以下问题:PHP dbstuff::version方法的具体用法?PHP dbstuff::version怎么用?PHP dbstuff::version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dbstuff的用法示例。


在下文中一共展示了dbstuff::version方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: splitsql

    }
    $get['volume']++;
    $next_dumpfile = preg_replace('/^(\\d+)\\_(\\w+)\\-(\\d+)\\.sql$/', '\\1_\\2-' . $get['volume'] . '.sql', $get['dumpfile']);
    if (!is_file(BACKUP_DIR . $get['sqlpath'] . '/' . $get['dumpfile'])) {
        if (is_file(BACKUP_DIR . $get['sqlpath'] . '/' . $next_dumpfile)) {
            api_msg('bak_file_lose', $get['dumpfile']);
        } else {
            api_msg('import_success', 'import_success');
        }
    }
    $sqldump = file_get_contents(BACKUP_DIR . $get['sqlpath'] . '/' . $get['dumpfile']);
    $sqlquery = splitsql($sqldump);
    unset($sqldump);
    foreach ($sqlquery as $sql) {
        //note 兼容SQL建表格式,調整為當前版本和字符集合適的建表語句
        $sql = syntablestruct(trim($sql), $db->version() > '4.1', $dbcharset);
        if ($sql != '') {
            $db->query($sql, 'SILENT');
            if (($sqlerror = $db->error()) && $db->errno() != 1062) {
                $db->halt('MySQL Query Error', $sql);
            }
        }
    }
    $cur_file = $get['dumpfile'];
    $get['dumpfile'] = $next_dumpfile;
    auto_next($get, BACKUP_DIR . $get['sqlpath'] . '/' . $cur_file);
} elseif ($get['method'] == 'ping') {
    //note 探測某個指定目錄下是否有備份數據
    if ($get['dir'] && is_dir(BACKUP_DIR . $get['dir'])) {
        echo "1";
        exit;
开发者ID:pan289091315,项目名称:Discuz,代码行数:31,代码来源:dbbak.php

示例2: TINYINT

     $curr_tpl_writeable = $lang['unwriteable'];
     $msg .= "<font color=\"#FF0000\">{$lang['unwriteable_template']}</font>\t";
 }
 if (dir_writeable('./gamedata')) {
     $curr_data_writeable = $lang['writeable'];
 } else {
     $curr_data_writeable = $lang['unwriteable'];
     $msg .= "<font color=\"#FF0000\">{$lang['unwriteable_gamedata']}</font>\t";
 }
 if (strstr($tablepre, '.')) {
     $msg .= "<font color=\"#FF0000\">{$lang['tablepre_invalid']}</font>\t";
     $quit = TRUE;
 }
 $db->select_db($dbname);
 if ($db->error()) {
     if ($db->version() > '4.1') {
         $db->query("CREATE DATABASE IF NOT EXISTS {$dbname} DEFAULT CHARACTER SET {$dbcharset}");
     } else {
         $db->query("CREATE DATABASE IF NOT EXISTS {$dbname}");
     }
     if ($db->error()) {
         $msg .= "<font color=\"#FF0000\">{$lang['db_invalid']}</font>\t";
         $quit = TRUE;
     } else {
         $db->select_db($dbname);
         $msg .= "{$lang['db_auto_created']}\t";
     }
 }
 $query = $db->query("CREATE TABLE bra_test (test TINYINT (3) UNSIGNED)", 'SILENT');
 if ($db->error()) {
     $dbpriv_createtable = '<font color="#FF0000">' . $lang['no'] . '</font>';
开发者ID:winddramon,项目名称:dts,代码行数:31,代码来源:install.php

示例3: fread

         $sqldump .= fread($fp, filesize($datafile));
     }
     fclose($fp);
 } else {
     if (getgpc('autoimport', 'G')) {
         touch($lock_file);
         show_msg('database_import_multivol_succeed', '', 'message', 1);
     } else {
         show_msg('database_import_file_illegal');
     }
 }
 if ($dumpinfo['method'] == 'multivol') {
     $sqlquery = splitsql($sqldump);
     unset($sqldump);
     foreach ($sqlquery as $sql) {
         $sql = syntablestruct(trim($sql), $db->version() > '4.1', DBCHARSET);
         if ($sql != '') {
             $db->query($sql, 'SILENT');
             if (($sqlerror = $db->error()) && $db->errno() != 1062) {
                 $db->halt('MySQL Query Error', $sql);
             }
         }
     }
     $delunzip = getgpc('delunzip', 'G');
     if ($delunzip) {
         @unlink($datafile);
     }
     $datafile_next = preg_replace("/-({$dumpinfo['volume']})(\\..+)\$/", "-" . ($dumpinfo['volume'] + 1) . "\\2", $datafile);
     $datafile_next = urlencode($datafile_next);
     if ($dumpinfo['volume'] == 1) {
         show_msg(lang('database_import_multivol_redirect', TRUE, array('volume' => $dumpinfo['volume'])), $siteurl . "restore.php?operation=import&datafile_server={$datafile_next}&autoimport=yes&importsubmit=yes&confirm=yes" . (!empty($delunzip) ? '&delunzip=yes' : ''), 'redirect');
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:restore.php

示例4: stripslashes

				$customtablesnew = stripslashes($_POST['customtables']);
				$tables = unserialize($customtablesnew);
			}else{
				$customtables = $_POST['customtables'];
				$customtablesnew = empty($customtables)? '' : serialize($customtables);
				$tables = & $customtables;
			}
			if( !is_array($tables) || empty($tables)) {
				cpmsg('您至少需要选择一个数据表进行备份,请返回修改。');
			}
		}

		$volume = intval($volume) + 1;
		$idstring = '# Identify: '.base64_encode(time().",$version,$type,$method,$volume")."\n";
		$dumpcharset = $sqlcharset ? $sqlcharset : str_replace('-', '', $dbcharset?$dbcharset:"gbk");
		$setnames = ($sqlcharset && $db->version() > '4.1' && (!$sqlcompat || $sqlcompat == 'MYSQL41')) ? "SET NAMES '$dumpcharset';\n\n" : '';
		if($db->version() > '4.1') {
			if($sqlcharset) {
				$db->query("SET NAMES '".$sqlcharset."';\n\n");
			}
			if($sqlcompat == 'MYSQL40') {
				$db->query("SET SQL_MODE='MYSQL40'");
			} elseif($sqlcompat == 'MYSQL41') {
				$db->query("SET SQL_MODE=''");
			}
		}

		$backupfilename = './data/'.str_replace(array('/', '\\', '.'), '', $filename);
		if($usezip) {
			require_once './zip.func.php';
		}
开发者ID:xl7dev,项目名称:WebShell,代码行数:31,代码来源:index.php


注:本文中的dbstuff::version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。