Annotation of embedaddon/php/ext/oci8/tests/details.inc, revision 1.1.1.1
1.1 misho 1: <?php
2:
3: /*
4: * Please change $user, $password and $dbase to match your configuration.
5: *
6: * Set $test_drcp to TRUE if you want to run the Oracle Database
7: * Resident Connection Pooling (DRCP) tests. For these tests to run
8: * successfully, you need a server and client which is Oracle 11g or
9: * greater, and $dbase should be set to the tnsnames.ora entry
10: * corresponding to the POOLED server instance or an Easy Connect
11: * string like hostname:port/service_name:POOLED
12: */
13:
14: if (file_exists(dirname(__FILE__)."/details_local.inc")) {
15: include(dirname(__FILE__)."/details_local.inc"); // this file is not part of the source distribution; make it your own local variant of details.inc
16: } else {
17: if (false !== getenv('PHP_OCI8_TEST_DB')) {
18: $user = getenv('PHP_OCI8_TEST_USER'); // Database username for tests
19: $password = getenv('PHP_OCI8_TEST_PASS'); // Password for $user
20: $dbase = getenv('PHP_OCI8_TEST_DB'); // Database connection string
21: $test_drcp = getenv('PHP_OCI8_TEST_DRCP');
22: if (false !== $test_drcp && 0 == strcasecmp($test_drcp,'TRUE')) {
23: $test_drcp = TRUE;
24: } else {
25: $test_drcp = FALSE;
26: }
27: } else {
28: $user = "system";
29: $password = "oracle";
30: $dbase = "localhost/XE";
31: $test_drcp = FALSE;
32: }
33:
34: /*
35: * Common object names for scripts to use
36: */
37:
38: $table_name = "tb".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5);
39: $type_name = strtoupper("tp".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5));
40: $schema = '';
41: }
42:
43:
44: /*
45: * Used for creating/dropping schema objects used by a test
46: */
47:
48: function oci8_test_sql_execute($c, $stmtarray)
49: {
50: foreach ($stmtarray as $stmt) {
51: $s = oci_parse($c, $stmt);
52: if (!$s) {
53: $m = oci_error($c);
54: echo $stmt . PHP_EOL . $m['message'] . PHP_EOL;
55: }
56: else {
57: $r = @oci_execute($s);
58: if (!$r) {
59: $m = oci_error($s);
60: if (!in_array($m['code'], array( // ignore expected errors
61: 942 // table or view does not exist
62: , 1918 // user does not exist
63: , 2024 // database link not found
64: , 2289 // sequence does not exist
65: , 4080 // trigger does not exist
66: , 38802 // edition does not exist
67: ))) {
68: echo $stmt . PHP_EOL . $m['message'] . PHP_EOL;
69: }
70: }
71: }
72: }
73: }
74:
75: ?>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>