diff options
author | Christopher Jones <sixd@php.net> | 2013-07-24 15:33:22 -0700 |
---|---|---|
committer | Christopher Jones <sixd@php.net> | 2013-07-24 15:33:22 -0700 |
commit | bfc3c223dac2a5ebd5c2614c9c39b594ab393f4f (patch) | |
tree | 82f8350b79c81240dfcfb8ff854bfad66b23b072 /ext/oci8/tests/conn_attr.inc | |
parent | 86064e0701888877ea04ea35bf87bc96e1bf3ed8 (diff) | |
download | php-git-bfc3c223dac2a5ebd5c2614c9c39b594ab393f4f.tar.gz |
Initial PHP OCI8 2.0.0-dev commit.
Includes Oracle Database 12c Implicit Result Set support, DTrace
support, and various code cleanups.
See package.xml for details.
Diffstat (limited to 'ext/oci8/tests/conn_attr.inc')
-rw-r--r-- | ext/oci8/tests/conn_attr.inc | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/ext/oci8/tests/conn_attr.inc b/ext/oci8/tests/conn_attr.inc index 220e688210..2edc1c9552 100644 --- a/ext/oci8/tests/conn_attr.inc +++ b/ext/oci8/tests/conn_attr.inc @@ -2,30 +2,28 @@ require(dirname(__FILE__)."/connect.inc"); -$sv = oci_server_version($c); -$sv = preg_match('/Release (11\.2|12)\./', $sv, $matches); -if ($sv == 1) { +preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); +if ((isset($matches[1]) && $matches[1] >= 11)) { // Server is Oracle 11.2+ $stmtarray = array( - "drop user testuser cascade", - "create user testuser identified by testuser", - "grant connect,resource,dba to testuser", - "alter user testuser enable editions", - "drop edition myedition1", - "drop edition myedition", - "grant create any edition to testuser", + "drop user $testuser cascade", + "create user $testuser identified by $testpassword", // $testuser should be set by the file that includes conn_attr.inc + "grant connect,resource,dba to $testuser", + "alter user $testuser enable editions", + "drop edition myedition1 cascade", + "drop edition myedition cascade", + "grant create any edition to $testuser", "create edition myedition", "create edition myedition1 as child of myedition", - "grant use on edition myedition to testuser", - "grant use on edition myedition1 to testuser", + "grant use on edition myedition to $testuser", + "grant use on edition myedition1 to $testuser", ); -} -else { +} else { // Server is Pre 11.2 $stmtarray = array( - "drop user testuser cascade", - "create user testuser identified by testuser", - "grant connect,resource,dba to testuser", + "drop user $testuser cascade", + "create user $testuser identified by $testpassword", + "grant connect,resource,dba to $testuser", ); } @@ -68,8 +66,8 @@ function get_attr($conn,$attr) function get_conn($conn_type) { - $user = 'testuser'; - $password = 'testuser'; + $user = $GLOBALS['testuser']; + $password = $GLOBALS['testpassword']; $dbase = $GLOBALS['dbase']; switch($conn_type) { case 1: @@ -139,9 +137,9 @@ function get_sys_attr($conn,$attr) function clean_up($c) { $stmtarray = array( - "drop user testuser cascade", - "drop edition myedition1", - "drop edition myedition", + "drop edition myedition1 cascade", + "drop edition myedition cascade", + "drop user " . $GLOBALS['testuser'] . " cascade", ); foreach ($stmtarray as $stmt) { |