<?php
declare(strict_types=1);

// No network/database call: prove the mirrored private package can load all classes.
$vendor = (string)getenv('CDX_AI_VENDOR_AUTOLOAD');
if ($vendor === '' || !is_file($vendor)) {
    throw new RuntimeException('Explicit public vendor autoload path required');
}
require_once $vendor;
require_once __DIR__ . '/../parallel-odbc-app-connector/PrivateOdbcDm.php';

$connection = new PrivateOdbcDm([
    'hostname' => '127.0.0.1',
    'hostport' => 5238,
    'database' => 'AIZHCT_APP',
    'username' => '',
    'password' => '',
]);
if (!$connection instanceof \app\common\database\Dm
    || $connection->getBuilderClass() !== \app\common\database\DmBuilder::class
    || $connection->getPdo() !== false
    || !class_exists(TypedStatement::class)
    || !class_exists(TypedFetchNormalizer::class)) {
    throw new RuntimeException('Private package class or no-connection gate failed');
}
echo 'ODBC_PRIVATE_PACKAGE_LOAD_PASS: no PDO connection, SQL, DDL or DML', PHP_EOL;
