Source for file create_firebird_database.php
Documentation is available at create_firebird_database.php
V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Set tabs to 4 for best viewing.
Added by Lester Caine to provide an in-line generation of Firebird(/Interbase) database
Firebird requires the database to exist before it can be connected to as part of it's
Still need to be extended to allow selection of OS tmp directory,
and path to Firebird bin directory
$sql = 'CREATE DATABASE "'. $host. ':'. $dbalias. '"';
$sql .= ' USER "'. $user. '"';
$sql .= ' PASSWORD "'. $pass. '"';
$sql .= ' PAGE_SIZE = 16384';
// if ($s_create_charset != 'NONE') {
// NONE is the default character set
// $sql .= ' DEFAULT CHARACTER SET '.$s_create_charset;
if( isset ($_ENV["TMP"])) {
$tmp_name = $_ENV["TMP"]. '/'. uniqid(''). '.sql';
$tmp_name = '/tmp/'. uniqid(''). '.sql';
if ($fp = fopen ($tmp_name, 'a')) {
$command = sprintf('"%s" -i %s', $fbpath, $tmp_name );
$result = exec($command);
|