PHP8 ibase_restore

2024-04-03 09:36 更新

(PHP 5、PHP 7 < 7.4.0)

ibase_restore — 在服務(wù)管理器中啟動(dòng)還原任務(wù)并立即返回

說(shuō)明

ibase_restore(
    resource $service_handle,
    string $source_file,
    string $dest_db,
    int $options = 0,
    bool $verbose = false
): mixed

此函數(shù)將參數(shù)傳遞給(遠(yuǎn)程)數(shù)據(jù)庫(kù)服務(wù)器。在那里,它開(kāi)始一個(gè)新的還原過(guò)程。因此,您 不會(huì)得到任何回應(yīng)。

參數(shù) 

service_handle

以前打開(kāi)的與數(shù)據(jù)庫(kù)服務(wù)器的連接。

source_file

備份文件所在的服務(wù)器上的絕對(duì)路徑。

dest_db

在服務(wù)器上創(chuàng)建新數(shù)據(jù)庫(kù)的路徑。還可以使用數(shù)據(jù)庫(kù)別名。

options

要傳遞到數(shù)據(jù)庫(kù)服務(wù)器進(jìn)行還原的其他選項(xiàng)。 參數(shù)可以是組合 以下常量:IBASE_RES_DEACTIVATE_IDX、IBASE_RES_NO_SHADOWIBASE_RES_NO_VALIDITY、IBASE_RES_ONE_AT_A_TIME、IBASE_RES_REPLACEIBASE_RES_CREATE、IBASE_RES_USE_ALL_SPACE、IBASE_PRP_PAGE_BUFFERSIBASE_PRP_SWEEP_INTERVAL、IBASE_RES_CREATE。 有關(guān)詳細(xì)信息,請(qǐng)閱讀有關(guān)預(yù)定義常量的部分。options

verbose

由于還原過(guò)程是在數(shù)據(jù)庫(kù)服務(wù)器上完成的,因此您沒(méi)有任何機(jī)會(huì) 以獲取其輸出。這個(gè)論點(diǎn)是沒(méi)有用的。

返回值 

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。

由于還原過(guò)程是在(遠(yuǎn)程)服務(wù)器上完成的,因此此函數(shù)只是將參數(shù)傳遞給它。 雖然這些論點(diǎn)是合法的,但你不會(huì)得到錯(cuò)誤。

示例 

示例 #1 ibase_restore() example

<?php

// Attach to database server by ip address and port
$service = ibase_service_attach ('10.1.11.200/3050', 'sysdba', 'masterkey');

// Start the restore process on database server
// Restore employee backup to the new emps.fdb database
// Don't use any special arguments
ibase_restore($service, '/srv/backup/employees.fbk', '/srv/firebird/emps.fdb');

// Free the attached connection
ibase_service_detach ($service);
?>

示例 #2 ibase_restore() example with arguments

<?php

// Attach to database server by name and default port
$service = ibase_service_attach ('fb-server.contoso.local', 'sysdba', 'masterkey');

// Start the restore process on database server
// Restore to employee database using alias.
// Restore without indixes. Replace existing database.
ibase_restore($service, '/srv/backup/employees.fbk', 'employees.fdb', IBASE_RES_DEACTIVATE_IDX | IBASE_RES_REPLACE);

// Free the attached connection
ibase_service_detach ($service);
?>

參見(jiàn) 

  • ibase_backup() - 在服務(wù)管理器中啟動(dòng)備份任務(wù)并立即返回


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)