HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //opt/remi/php56/root/usr/share/tests/pear/MDB2/tests/import.schema.php
<?php
require_once 'MDB2/Schema.php';

$dsn = array(
    'phptype'  => 'mysql',
    'username' => 'username',
    'password' => 'password',
    'hostspec' => 'host',
);
$db_options = array();


$file = dirname(__FILE__).DIRECTORY_SEPARATOR.'driver_test.schema.xml';
$variables = array(
    'name'   => 'driver_test',
    'create' => true,
);

$options = array(
    'log_line_break'   => '<br />',
    'idxname_format'   => '%s',
    'debug'            => true,
    'quote_identifier' => true,
    'force_defaults'   => false,
    'portability'      => false
);
$options = array_merge($options, $db_options);

$schema =& MDB2_Schema::factory($dsn, $options);
if (PEAR::isError($schema)) {
    echo $schema->getMessage() . ' ' . $schema->getUserInfo();
    exit;
}

$definition = $schema->parseDatabaseDefinitionFile($file, $variables, true, true);
if (PEAR::isError($definition)) {
    echo $definition->getMessage() . ' - ' . $definition->getUserInfo();
} else {
    $operation = $schema->createDatabase($definition);
    if (PEAR::isError($operation)) {
        echo $operation->getMessage() . ' ' . $operation->getUserInfo();
    }
}
?>
DONE!