Exceptions
5 days ago
apache.php
5 days ago
apcu.php
5 days ago
array.php
5 days ago
bzip2.php
5 days ago
calendar.php
5 days ago
classobj.php
5 days ago
com.php
5 days ago
cubrid.php
5 days ago
curl.php
5 days ago
datetime.php
5 days ago
dir.php
5 days ago
eio.php
5 days ago
errorfunc.php
5 days ago
exec.php
5 days ago
fileinfo.php
5 days ago
filesystem.php
5 days ago
filter.php
5 days ago
fpm.php
5 days ago
ftp.php
5 days ago
funchand.php
5 days ago
functionsList.php
5 days ago
gmp.php
5 days ago
gnupg.php
5 days ago
hash.php
5 days ago
ibase.php
5 days ago
ibmDb2.php
5 days ago
iconv.php
5 days ago
image.php
5 days ago
imap.php
5 days ago
info.php
5 days ago
ingres-ii.php
5 days ago
inotify.php
5 days ago
json.php
5 days ago
ldap.php
5 days ago
libxml.php
5 days ago
lzf.php
5 days ago
mailparse.php
5 days ago
mbstring.php
5 days ago
misc.php
5 days ago
msql.php
5 days ago
mysql.php
5 days ago
mysqli.php
5 days ago
mysqlndMs.php
5 days ago
mysqlndQc.php
5 days ago
network.php
5 days ago
oci8.php
5 days ago
opcache.php
5 days ago
openssl.php
5 days ago
outcontrol.php
5 days ago
password.php
5 days ago
pcntl.php
5 days ago
pcre.php
5 days ago
pdf.php
5 days ago
pgsql.php
5 days ago
posix.php
5 days ago
ps.php
5 days ago
pspell.php
5 days ago
readline.php
5 days ago
rpminfo.php
5 days ago
rrd.php
5 days ago
sem.php
5 days ago
session.php
5 days ago
shmop.php
5 days ago
simplexml.php
5 days ago
sockets.php
5 days ago
sodium.php
5 days ago
solr.php
5 days ago
spl.php
5 days ago
sqlsrv.php
5 days ago
ssdeep.php
5 days ago
ssh2.php
5 days ago
stream.php
5 days ago
strings.php
5 days ago
swoole.php
5 days ago
uodbc.php
5 days ago
uopz.php
5 days ago
url.php
5 days ago
var.php
5 days ago
xdiff.php
5 days ago
xml.php
5 days ago
xmlrpc.php
5 days ago
yaml.php
5 days ago
yaz.php
5 days ago
zip.php
5 days ago
zlib.php
5 days ago
ibase.php
587 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\Safe; |
| 4 | |
| 5 | use ProfilePressVendor\Safe\Exceptions\IbaseException; |
| 6 | /** |
| 7 | * This function will discard a BLOB if it has not yet been closed by |
| 8 | * fbird_blob_close. |
| 9 | * |
| 10 | * @param resource $blob_handle A BLOB handle opened with fbird_blob_create. |
| 11 | * @throws IbaseException |
| 12 | * |
| 13 | */ |
| 14 | function fbird_blob_cancel($blob_handle): void |
| 15 | { |
| 16 | error_clear_last(); |
| 17 | $result = \fbird_blob_cancel($blob_handle); |
| 18 | if ($result === \false) { |
| 19 | throw IbaseException::createFromPhpError(); |
| 20 | } |
| 21 | } |
| 22 | /** |
| 23 | * |
| 24 | * |
| 25 | * @param resource $service_handle The handle on the database server service. |
| 26 | * @param string $user_name The login name of the new database user. |
| 27 | * @param string $password The password of the new user. |
| 28 | * @param string $first_name The first name of the new database user. |
| 29 | * @param string $middle_name The middle name of the new database user. |
| 30 | * @param string $last_name The last name of the new database user. |
| 31 | * @throws IbaseException |
| 32 | * |
| 33 | */ |
| 34 | function ibase_add_user($service_handle, string $user_name, string $password, string $first_name = null, string $middle_name = null, string $last_name = null): void |
| 35 | { |
| 36 | error_clear_last(); |
| 37 | if ($last_name !== null) { |
| 38 | $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name); |
| 39 | } elseif ($middle_name !== null) { |
| 40 | $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name); |
| 41 | } elseif ($first_name !== null) { |
| 42 | $result = \ibase_add_user($service_handle, $user_name, $password, $first_name); |
| 43 | } else { |
| 44 | $result = \ibase_add_user($service_handle, $user_name, $password); |
| 45 | } |
| 46 | if ($result === \false) { |
| 47 | throw IbaseException::createFromPhpError(); |
| 48 | } |
| 49 | } |
| 50 | /** |
| 51 | * This function passes the arguments to the (remote) database server. There it starts a new backup process. Therefore you |
| 52 | * won't get any responses. |
| 53 | * |
| 54 | * @param resource $service_handle A previously opened connection to the database server. |
| 55 | * @param string $source_db The absolute file path to the database on the database server. You can also use a database alias. |
| 56 | * @param string $dest_file The path to the backup file on the database server. |
| 57 | * @param int $options Additional options to pass to the database server for backup. |
| 58 | * The options parameter can be a combination |
| 59 | * of the following constants: |
| 60 | * IBASE_BKP_IGNORE_CHECKSUMS, |
| 61 | * IBASE_BKP_IGNORE_LIMBO, |
| 62 | * IBASE_BKP_METADATA_ONLY, |
| 63 | * IBASE_BKP_NO_GARBAGE_COLLECT, |
| 64 | * IBASE_BKP_OLD_DESCRIPTIONS, |
| 65 | * IBASE_BKP_NON_TRANSPORTABLE or |
| 66 | * IBASE_BKP_CONVERT. |
| 67 | * Read the section about for further information. |
| 68 | * @param bool $verbose Since the backup process is done on the database server, you don't have any chance |
| 69 | * to get its output. This argument is useless. |
| 70 | * @return mixed Returns TRUE on success. |
| 71 | * |
| 72 | * Since the backup process is done on the (remote) server, this function just passes the arguments to it. |
| 73 | * While the arguments are legal, you won't get FALSE. |
| 74 | * @throws IbaseException |
| 75 | * |
| 76 | */ |
| 77 | function ibase_backup($service_handle, string $source_db, string $dest_file, int $options = 0, bool $verbose = \false) |
| 78 | { |
| 79 | error_clear_last(); |
| 80 | $result = \ibase_backup($service_handle, $source_db, $dest_file, $options, $verbose); |
| 81 | if ($result === \false) { |
| 82 | throw IbaseException::createFromPhpError(); |
| 83 | } |
| 84 | return $result; |
| 85 | } |
| 86 | /** |
| 87 | * This function will discard a BLOB if it has not yet been closed by |
| 88 | * ibase_blob_close. |
| 89 | * |
| 90 | * @param resource $blob_handle A BLOB handle opened with ibase_blob_create. |
| 91 | * @throws IbaseException |
| 92 | * |
| 93 | */ |
| 94 | function ibase_blob_cancel($blob_handle): void |
| 95 | { |
| 96 | error_clear_last(); |
| 97 | $result = \ibase_blob_cancel($blob_handle); |
| 98 | if ($result === \false) { |
| 99 | throw IbaseException::createFromPhpError(); |
| 100 | } |
| 101 | } |
| 102 | /** |
| 103 | * ibase_blob_create creates a new BLOB for filling with |
| 104 | * data. |
| 105 | * |
| 106 | * @param resource $link_identifier An InterBase link identifier. If omitted, the last opened link is |
| 107 | * assumed. |
| 108 | * @return resource Returns a BLOB handle for later use with |
| 109 | * ibase_blob_add. |
| 110 | * @throws IbaseException |
| 111 | * |
| 112 | */ |
| 113 | function ibase_blob_create($link_identifier = null) |
| 114 | { |
| 115 | error_clear_last(); |
| 116 | $result = \ibase_blob_create($link_identifier); |
| 117 | if ($result === \false) { |
| 118 | throw IbaseException::createFromPhpError(); |
| 119 | } |
| 120 | return $result; |
| 121 | } |
| 122 | /** |
| 123 | * This function returns at most len bytes from a BLOB |
| 124 | * that has been opened for reading by ibase_blob_open. |
| 125 | * |
| 126 | * @param resource $blob_handle A BLOB handle opened with ibase_blob_open. |
| 127 | * @param int $len Size of returned data. |
| 128 | * @return string Returns at most len bytes from the BLOB. |
| 129 | * @throws IbaseException |
| 130 | * |
| 131 | */ |
| 132 | function ibase_blob_get($blob_handle, int $len): string |
| 133 | { |
| 134 | error_clear_last(); |
| 135 | $result = \ibase_blob_get($blob_handle, $len); |
| 136 | if ($result === \false) { |
| 137 | throw IbaseException::createFromPhpError(); |
| 138 | } |
| 139 | return $result; |
| 140 | } |
| 141 | /** |
| 142 | * Closes the link to an InterBase database that's associated with |
| 143 | * a connection id returned from ibase_connect. |
| 144 | * Default transaction on link is committed, other transactions are |
| 145 | * rolled back. |
| 146 | * |
| 147 | * @param resource $connection_id An InterBase link identifier returned from |
| 148 | * ibase_connect. If omitted, the last opened link |
| 149 | * is assumed. |
| 150 | * @throws IbaseException |
| 151 | * |
| 152 | */ |
| 153 | function ibase_close($connection_id = null): void |
| 154 | { |
| 155 | error_clear_last(); |
| 156 | $result = \ibase_close($connection_id); |
| 157 | if ($result === \false) { |
| 158 | throw IbaseException::createFromPhpError(); |
| 159 | } |
| 160 | } |
| 161 | /** |
| 162 | * Commits a transaction without closing it. |
| 163 | * |
| 164 | * @param resource $link_or_trans_identifier If called without an argument, this function commits the default |
| 165 | * transaction of the default link. If the argument is a connection |
| 166 | * identifier, the default transaction of the corresponding connection |
| 167 | * will be committed. If the argument is a transaction identifier, the |
| 168 | * corresponding transaction will be committed. The transaction context |
| 169 | * will be retained, so statements executed from within this transaction |
| 170 | * will not be invalidated. |
| 171 | * @throws IbaseException |
| 172 | * |
| 173 | */ |
| 174 | function ibase_commit_ret($link_or_trans_identifier = null): void |
| 175 | { |
| 176 | error_clear_last(); |
| 177 | $result = \ibase_commit_ret($link_or_trans_identifier); |
| 178 | if ($result === \false) { |
| 179 | throw IbaseException::createFromPhpError(); |
| 180 | } |
| 181 | } |
| 182 | /** |
| 183 | * Commits a transaction. |
| 184 | * |
| 185 | * @param resource $link_or_trans_identifier If called without an argument, this function commits the default |
| 186 | * transaction of the default link. If the argument is a connection |
| 187 | * identifier, the default transaction of the corresponding connection |
| 188 | * will be committed. If the argument is a transaction identifier, the |
| 189 | * corresponding transaction will be committed. |
| 190 | * @throws IbaseException |
| 191 | * |
| 192 | */ |
| 193 | function ibase_commit($link_or_trans_identifier = null): void |
| 194 | { |
| 195 | error_clear_last(); |
| 196 | $result = \ibase_commit($link_or_trans_identifier); |
| 197 | if ($result === \false) { |
| 198 | throw IbaseException::createFromPhpError(); |
| 199 | } |
| 200 | } |
| 201 | /** |
| 202 | * Establishes a connection to an Firebird/InterBase server. |
| 203 | * |
| 204 | * In case a second call is made to ibase_connect with |
| 205 | * the same arguments, no new link will be established, but instead, the link |
| 206 | * identifier of the already opened link will be returned. The link to the |
| 207 | * server will be closed as soon as the execution of the script ends, unless |
| 208 | * it's closed earlier by explicitly calling ibase_close. |
| 209 | * |
| 210 | * @param string $database The database argument has to be a valid path to |
| 211 | * database file on the server it resides on. If the server is not local, |
| 212 | * it must be prefixed with either 'hostname:' (TCP/IP), 'hostname/port:' |
| 213 | * (TCP/IP with interbase server on custom TCP port), '//hostname/' |
| 214 | * (NetBEUI), depending on the connection |
| 215 | * protocol used. |
| 216 | * @param string $username The user name. Can be set with the |
| 217 | * ibase.default_user php.ini directive. |
| 218 | * @param string $password The password for username. Can be set with the |
| 219 | * ibase.default_password php.ini directive. |
| 220 | * @param string $charset charset is the default character set for a |
| 221 | * database. |
| 222 | * @param int $buffers buffers is the number of database buffers to |
| 223 | * allocate for the server-side cache. If 0 or omitted, server chooses |
| 224 | * its own default. |
| 225 | * @param int $dialect dialect selects the default SQL dialect for any |
| 226 | * statement executed within a connection, and it defaults to the highest |
| 227 | * one supported by client libraries. |
| 228 | * @param string $role Functional only with InterBase 5 and up. |
| 229 | * @param int $sync |
| 230 | * @return resource Returns an Firebird/InterBase link identifier on success. |
| 231 | * @throws IbaseException |
| 232 | * |
| 233 | */ |
| 234 | function ibase_connect(string $database = null, string $username = null, string $password = null, string $charset = null, int $buffers = null, int $dialect = null, string $role = null, int $sync = null) |
| 235 | { |
| 236 | error_clear_last(); |
| 237 | if ($sync !== null) { |
| 238 | $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync); |
| 239 | } elseif ($role !== null) { |
| 240 | $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role); |
| 241 | } elseif ($dialect !== null) { |
| 242 | $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect); |
| 243 | } elseif ($buffers !== null) { |
| 244 | $result = \ibase_connect($database, $username, $password, $charset, $buffers); |
| 245 | } elseif ($charset !== null) { |
| 246 | $result = \ibase_connect($database, $username, $password, $charset); |
| 247 | } elseif ($password !== null) { |
| 248 | $result = \ibase_connect($database, $username, $password); |
| 249 | } elseif ($username !== null) { |
| 250 | $result = \ibase_connect($database, $username); |
| 251 | } elseif ($database !== null) { |
| 252 | $result = \ibase_connect($database); |
| 253 | } else { |
| 254 | $result = \ibase_connect(); |
| 255 | } |
| 256 | if ($result === \false) { |
| 257 | throw IbaseException::createFromPhpError(); |
| 258 | } |
| 259 | return $result; |
| 260 | } |
| 261 | /** |
| 262 | * |
| 263 | * |
| 264 | * @param resource $service_handle The handle on the database server service. |
| 265 | * @param string $user_name The login name of the user you want to delete from the database. |
| 266 | * @throws IbaseException |
| 267 | * |
| 268 | */ |
| 269 | function ibase_delete_user($service_handle, string $user_name): void |
| 270 | { |
| 271 | error_clear_last(); |
| 272 | $result = \ibase_delete_user($service_handle, $user_name); |
| 273 | if ($result === \false) { |
| 274 | throw IbaseException::createFromPhpError(); |
| 275 | } |
| 276 | } |
| 277 | /** |
| 278 | * This functions drops a database that was opened by either ibase_connect |
| 279 | * or ibase_pconnect. The database is closed and deleted from the server. |
| 280 | * |
| 281 | * @param resource $connection An InterBase link identifier. If omitted, the last opened link is |
| 282 | * assumed. |
| 283 | * @throws IbaseException |
| 284 | * |
| 285 | */ |
| 286 | function ibase_drop_db($connection = null): void |
| 287 | { |
| 288 | error_clear_last(); |
| 289 | $result = \ibase_drop_db($connection); |
| 290 | if ($result === \false) { |
| 291 | throw IbaseException::createFromPhpError(); |
| 292 | } |
| 293 | } |
| 294 | /** |
| 295 | * This function causes the registered event handler specified by |
| 296 | * event to be cancelled. The callback function will |
| 297 | * no longer be called for the events it was registered to handle. |
| 298 | * |
| 299 | * @param resource $event An event resource, created by |
| 300 | * ibase_set_event_handler. |
| 301 | * @throws IbaseException |
| 302 | * |
| 303 | */ |
| 304 | function ibase_free_event_handler($event): void |
| 305 | { |
| 306 | error_clear_last(); |
| 307 | $result = \ibase_free_event_handler($event); |
| 308 | if ($result === \false) { |
| 309 | throw IbaseException::createFromPhpError(); |
| 310 | } |
| 311 | } |
| 312 | /** |
| 313 | * Frees a prepared query. |
| 314 | * |
| 315 | * @param resource $query A query prepared with ibase_prepare. |
| 316 | * @throws IbaseException |
| 317 | * |
| 318 | */ |
| 319 | function ibase_free_query($query): void |
| 320 | { |
| 321 | error_clear_last(); |
| 322 | $result = \ibase_free_query($query); |
| 323 | if ($result === \false) { |
| 324 | throw IbaseException::createFromPhpError(); |
| 325 | } |
| 326 | } |
| 327 | /** |
| 328 | * Frees a result set. |
| 329 | * |
| 330 | * @param resource $result_identifier A result set created by ibase_query or |
| 331 | * ibase_execute. |
| 332 | * @throws IbaseException |
| 333 | * |
| 334 | */ |
| 335 | function ibase_free_result($result_identifier): void |
| 336 | { |
| 337 | error_clear_last(); |
| 338 | $result = \ibase_free_result($result_identifier); |
| 339 | if ($result === \false) { |
| 340 | throw IbaseException::createFromPhpError(); |
| 341 | } |
| 342 | } |
| 343 | /** |
| 344 | * |
| 345 | * |
| 346 | * @param resource $service_handle |
| 347 | * @param string $db |
| 348 | * @param int $action |
| 349 | * @param int $argument |
| 350 | * @throws IbaseException |
| 351 | * |
| 352 | */ |
| 353 | function ibase_maintain_db($service_handle, string $db, int $action, int $argument = 0): void |
| 354 | { |
| 355 | error_clear_last(); |
| 356 | $result = \ibase_maintain_db($service_handle, $db, $action, $argument); |
| 357 | if ($result === \false) { |
| 358 | throw IbaseException::createFromPhpError(); |
| 359 | } |
| 360 | } |
| 361 | /** |
| 362 | * |
| 363 | * |
| 364 | * @param resource $service_handle The handle on the database server service. |
| 365 | * @param string $user_name The login name of the database user to modify. |
| 366 | * @param string $password The user's new password. |
| 367 | * @param string $first_name The user's new first name. |
| 368 | * @param string $middle_name The user's new middle name. |
| 369 | * @param string $last_name The user's new last name. |
| 370 | * @throws IbaseException |
| 371 | * |
| 372 | */ |
| 373 | function ibase_modify_user($service_handle, string $user_name, string $password, string $first_name = null, string $middle_name = null, string $last_name = null): void |
| 374 | { |
| 375 | error_clear_last(); |
| 376 | if ($last_name !== null) { |
| 377 | $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name); |
| 378 | } elseif ($middle_name !== null) { |
| 379 | $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name); |
| 380 | } elseif ($first_name !== null) { |
| 381 | $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name); |
| 382 | } else { |
| 383 | $result = \ibase_modify_user($service_handle, $user_name, $password); |
| 384 | } |
| 385 | if ($result === \false) { |
| 386 | throw IbaseException::createFromPhpError(); |
| 387 | } |
| 388 | } |
| 389 | /** |
| 390 | * This function assigns a name to a result set. This name can be used later in |
| 391 | * UPDATE|DELETE ... WHERE CURRENT OF name statements. |
| 392 | * |
| 393 | * @param resource $result An InterBase result set. |
| 394 | * @param string $name The name to be assigned. |
| 395 | * @throws IbaseException |
| 396 | * |
| 397 | */ |
| 398 | function ibase_name_result($result, string $name): void |
| 399 | { |
| 400 | error_clear_last(); |
| 401 | $result = \ibase_name_result($result, $name); |
| 402 | if ($result === \false) { |
| 403 | throw IbaseException::createFromPhpError(); |
| 404 | } |
| 405 | } |
| 406 | /** |
| 407 | * Opens a persistent connection to an InterBase database. |
| 408 | * |
| 409 | * ibase_pconnect acts very much like |
| 410 | * ibase_connect with two major differences. |
| 411 | * |
| 412 | * First, when connecting, the function will first try to find a (persistent) |
| 413 | * link that's already opened with the same parameters. If one is found, an |
| 414 | * identifier for it will be returned instead of opening a new connection. |
| 415 | * |
| 416 | * Second, the connection to the InterBase server will not be closed when the |
| 417 | * execution of the script ends. Instead, the link will remain open for |
| 418 | * future use (ibase_close will not close links |
| 419 | * established by ibase_pconnect). This type of link is |
| 420 | * therefore called 'persistent'. |
| 421 | * |
| 422 | * @param string $database The database argument has to be a valid path to |
| 423 | * database file on the server it resides on. If the server is not local, |
| 424 | * it must be prefixed with either 'hostname:' (TCP/IP), '//hostname/' |
| 425 | * (NetBEUI) or 'hostname@' (IPX/SPX), depending on the connection |
| 426 | * protocol used. |
| 427 | * @param string $username The user name. Can be set with the |
| 428 | * ibase.default_user php.ini directive. |
| 429 | * @param string $password The password for username. Can be set with the |
| 430 | * ibase.default_password php.ini directive. |
| 431 | * @param string $charset charset is the default character set for a |
| 432 | * database. |
| 433 | * @param int $buffers buffers is the number of database buffers to |
| 434 | * allocate for the server-side cache. If 0 or omitted, server chooses |
| 435 | * its own default. |
| 436 | * @param int $dialect dialect selects the default SQL dialect for any |
| 437 | * statement executed within a connection, and it defaults to the highest |
| 438 | * one supported by client libraries. Functional only with InterBase 6 |
| 439 | * and up. |
| 440 | * @param string $role Functional only with InterBase 5 and up. |
| 441 | * @param int $sync |
| 442 | * @return resource Returns an InterBase link identifier on success. |
| 443 | * @throws IbaseException |
| 444 | * |
| 445 | */ |
| 446 | function ibase_pconnect(string $database = null, string $username = null, string $password = null, string $charset = null, int $buffers = null, int $dialect = null, string $role = null, int $sync = null) |
| 447 | { |
| 448 | error_clear_last(); |
| 449 | if ($sync !== null) { |
| 450 | $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync); |
| 451 | } elseif ($role !== null) { |
| 452 | $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role); |
| 453 | } elseif ($dialect !== null) { |
| 454 | $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect); |
| 455 | } elseif ($buffers !== null) { |
| 456 | $result = \ibase_pconnect($database, $username, $password, $charset, $buffers); |
| 457 | } elseif ($charset !== null) { |
| 458 | $result = \ibase_pconnect($database, $username, $password, $charset); |
| 459 | } elseif ($password !== null) { |
| 460 | $result = \ibase_pconnect($database, $username, $password); |
| 461 | } elseif ($username !== null) { |
| 462 | $result = \ibase_pconnect($database, $username); |
| 463 | } elseif ($database !== null) { |
| 464 | $result = \ibase_pconnect($database); |
| 465 | } else { |
| 466 | $result = \ibase_pconnect(); |
| 467 | } |
| 468 | if ($result === \false) { |
| 469 | throw IbaseException::createFromPhpError(); |
| 470 | } |
| 471 | return $result; |
| 472 | } |
| 473 | /** |
| 474 | * This function passes the arguments to the (remote) database server. There it starts a new restore process. Therefore you |
| 475 | * won't get any responses. |
| 476 | * |
| 477 | * @param resource $service_handle A previously opened connection to the database server. |
| 478 | * @param string $source_file The absolute path on the server where the backup file is located. |
| 479 | * @param string $dest_db The path to create the new database on the server. You can also use database alias. |
| 480 | * @param int $options Additional options to pass to the database server for restore. |
| 481 | * The options parameter can be a combination |
| 482 | * of the following constants: |
| 483 | * IBASE_RES_DEACTIVATE_IDX, |
| 484 | * IBASE_RES_NO_SHADOW, |
| 485 | * IBASE_RES_NO_VALIDITY, |
| 486 | * IBASE_RES_ONE_AT_A_TIME, |
| 487 | * IBASE_RES_REPLACE, |
| 488 | * IBASE_RES_CREATE, |
| 489 | * IBASE_RES_USE_ALL_SPACE, |
| 490 | * IBASE_PRP_PAGE_BUFFERS, |
| 491 | * IBASE_PRP_SWEEP_INTERVAL, |
| 492 | * IBASE_RES_CREATE. |
| 493 | * Read the section about for further information. |
| 494 | * @param bool $verbose Since the restore process is done on the database server, you don't have any chance |
| 495 | * to get its output. This argument is useless. |
| 496 | * @return mixed Returns TRUE on success. |
| 497 | * |
| 498 | * Since the restore process is done on the (remote) server, this function just passes the arguments to it. |
| 499 | * While the arguments are legal, you won't get FALSE. |
| 500 | * @throws IbaseException |
| 501 | * |
| 502 | */ |
| 503 | function ibase_restore($service_handle, string $source_file, string $dest_db, int $options = 0, bool $verbose = \false) |
| 504 | { |
| 505 | error_clear_last(); |
| 506 | $result = \ibase_restore($service_handle, $source_file, $dest_db, $options, $verbose); |
| 507 | if ($result === \false) { |
| 508 | throw IbaseException::createFromPhpError(); |
| 509 | } |
| 510 | return $result; |
| 511 | } |
| 512 | /** |
| 513 | * Rolls back a transaction without closing it. |
| 514 | * |
| 515 | * @param resource $link_or_trans_identifier If called without an argument, this function rolls back the default |
| 516 | * transaction of the default link. If the argument is a connection |
| 517 | * identifier, the default transaction of the corresponding connection |
| 518 | * will be rolled back. If the argument is a transaction identifier, the |
| 519 | * corresponding transaction will be rolled back. The transaction context |
| 520 | * will be retained, so statements executed from within this transaction |
| 521 | * will not be invalidated. |
| 522 | * @throws IbaseException |
| 523 | * |
| 524 | */ |
| 525 | function ibase_rollback_ret($link_or_trans_identifier = null): void |
| 526 | { |
| 527 | error_clear_last(); |
| 528 | $result = \ibase_rollback_ret($link_or_trans_identifier); |
| 529 | if ($result === \false) { |
| 530 | throw IbaseException::createFromPhpError(); |
| 531 | } |
| 532 | } |
| 533 | /** |
| 534 | * Rolls back a transaction. |
| 535 | * |
| 536 | * @param resource $link_or_trans_identifier If called without an argument, this function rolls back the default |
| 537 | * transaction of the default link. If the argument is a connection |
| 538 | * identifier, the default transaction of the corresponding connection |
| 539 | * will be rolled back. If the argument is a transaction identifier, the |
| 540 | * corresponding transaction will be rolled back. |
| 541 | * @throws IbaseException |
| 542 | * |
| 543 | */ |
| 544 | function ibase_rollback($link_or_trans_identifier = null): void |
| 545 | { |
| 546 | error_clear_last(); |
| 547 | $result = \ibase_rollback($link_or_trans_identifier); |
| 548 | if ($result === \false) { |
| 549 | throw IbaseException::createFromPhpError(); |
| 550 | } |
| 551 | } |
| 552 | /** |
| 553 | * |
| 554 | * |
| 555 | * @param string $host The name or ip address of the database host. You can define the port by adding |
| 556 | * '/' and port number. If no port is specified, port 3050 will be used. |
| 557 | * @param string $dba_username The name of any valid user. |
| 558 | * @param string $dba_password The user's password. |
| 559 | * @return resource Returns a Interbase / Firebird link identifier on success. |
| 560 | * @throws IbaseException |
| 561 | * |
| 562 | */ |
| 563 | function ibase_service_attach(string $host, string $dba_username, string $dba_password) |
| 564 | { |
| 565 | error_clear_last(); |
| 566 | $result = \ibase_service_attach($host, $dba_username, $dba_password); |
| 567 | if ($result === \false) { |
| 568 | throw IbaseException::createFromPhpError(); |
| 569 | } |
| 570 | return $result; |
| 571 | } |
| 572 | /** |
| 573 | * |
| 574 | * |
| 575 | * @param resource $service_handle A previously created connection to the database server. |
| 576 | * @throws IbaseException |
| 577 | * |
| 578 | */ |
| 579 | function ibase_service_detach($service_handle): void |
| 580 | { |
| 581 | error_clear_last(); |
| 582 | $result = \ibase_service_detach($service_handle); |
| 583 | if ($result === \false) { |
| 584 | throw IbaseException::createFromPhpError(); |
| 585 | } |
| 586 | } |
| 587 |