大网数据广告活动
PHP 语言与运行手册

ibase_restore · Initiates a restore task in the service manager and returns immediately

· 52CE 我爱测

ibase_restore — Initiates a restore task in the service manager and returns immediately

ibase_restore

(PHP 5, PHP 7 < 7.4.0)

ibase_restore — Initiates a restore task in the service manager and returns immediately

说明

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

This function passes the arguments to the (remote) database server. There it starts a new restore process. Therefore you won't get any responses.

参数

service_handle

A previously opened connection to the database server.

source_file

The absolute path on the server where the backup file is located.

dest_db

The path to create the new database on the server. You can also use database alias.

options

Additional options to pass to the database server for restore. The options parameter can be a combination of the following constants: IBASE_RES_DEACTIVATE_IDX, IBASE_RES_NO_SHADOW, IBASE_RES_NO_VALIDITY, IBASE_RES_ONE_AT_A_TIME, IBASE_RES_REPLACE, IBASE_RES_CREATE, IBASE_RES_USE_ALL_SPACE, IBASE_PRP_PAGE_BUFFERS, IBASE_PRP_SWEEP_INTERVAL, IBASE_RES_CREATE. Read the section about 预定义常量 for further information.

verbose

Since the restore process is done on the database server, you don't have any chance to get its output. This argument is useless.

返回值

成功时返回 true, 或者在失败时返回 false。

Since the restore process is done on the (remote) server, this function just passes the arguments to it. While the arguments are legal, you won't get false.

示例

示例 #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);
?>

参见

  • ibase_backup() - Initiates a backup task in the service manager and returns immediately

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。