1<?php 2 3if (false !== getenv('PDO_DBLIB_TEST_DSN')) 4 $dsn = getenv('PDO_DBLIB_TEST_DSN'); 5else 6 $dsn = 'dblib:host=localhost;dbname=test'; 7 8if (false !== getenv('PDO_DBLIB_TEST_USER')) 9 $user = getenv('PDO_DBLIB_TEST_USER'); 10else 11 $user = 'php'; 12 13 14if (false !== getenv('PDO_DBLIB_TEST_PASS')) 15 $pass = getenv('PDO_DBLIB_TEST_PASS'); 16else 17 $pass = 'password'; 18 19try { 20 $db = new PDO($dsn, $user, $pass); 21 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 22 $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); 23} catch (PDOException $e) { 24 die('skip ' . $e->getMessage()); 25} 26?> 27