| Current File : /home/mmdealscpanel/yummmdeals.com/alt-php84-pecl-oci8_3.4.0-1.el8.tar |
tests/extauth_03.phpt 0000644 00000007270 15041220541 0010567 0 ustar 00 --TEST--
Test External Authentication errors with oci_pconnect
--EXTENSIONS--
oci8
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip feature not available on Windows platforms");
die("skip random CI timeouts caused by Oracle Instant Client, see https://github.com/php/php-src/pull/9524#issuecomment-1244409815");
?>
--INI--
oci8.privileged_connect=1
--FILE--
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
// Run Test
echo "Test 1\n";
$c = oci_pconnect('/', 'notemtpy', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 2\n";
$c = oci_pconnect('notemtpy', 'notemtpy', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 3\n";
$c = oci_pconnect('notemtpy', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 4\n";
$c = oci_pconnect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 5\n";
$c = oci_pconnect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 6\n";
$c = oci_pconnect('', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 7\n";
$c = oci_pconnect('/', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 8\n";
$c = oci_pconnect('/', null, 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 9\n";
$c = oci_pconnect('/', '', 'd', null, OCI_SYSDBA+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 10\n";
$c = oci_pconnect('/', '', 'd', null, OCI_SYSOPER+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
?>
--EXPECTF--
Test 1
Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 2
Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 3
Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 4
Warning: oci_pconnect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d
bool(false)
bool(false)
Test 5
Warning: oci_pconnect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d
bool(false)
bool(false)
Test 6
Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 7
Warning: oci_pconnect(): ORA-12154: %s in %s on line %d
array(4) {
["code"]=>
int(12154)
["message"]=>
string(%d) "ORA-12154: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 8
Warning: oci_pconnect(): ORA-12154: %s in %s on line %d
array(4) {
["code"]=>
int(12154)
["message"]=>
string(%d) "ORA-12154: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 9
Warning: oci_pconnect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r in %s on line %d
array(4) {
["code"]=>
int(%d)
["message"]=>
string(%d) "ORA-%d: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 10
Warning: oci_pconnect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r in %s on line %d
array(4) {
["code"]=>
int(%d)
["message"]=>
string(%d) "ORA-%d: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
tests/drcp_connection_class.phpt 0000644 00000001315 15041220541 0013131 0 ustar 00 --TEST--
DRCP: oci8.connection_class with ini_get() and ini_set()
--EXTENSIONS--
oci8
--SKIPIF--
<?php
preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
if (!(isset($matches[0]) && $matches[0] >= 11)) {
die("skip works only with Oracle 11g or greater version of Oracle client libraries");
}
?>
--INI--
oci8.connection_class=test
--FILE--
<?php
echo "Setting a new connection class now\n";
ini_set('oci8.connection_class',"New cc");
// Get the New connection class name. Should return New CC
$new_cc = ini_get('oci8.connection_class');
echo "The New oci8.connection_class is $new_cc\n";
echo "Done\n";
?>
--EXPECT--
Setting a new connection class now
The New oci8.connection_class is New cc
Done
tests/error1.phpt 0000644 00000000766 15041220541 0010020 0 ustar 00 --TEST--
oci_error() when oci_connect() fails
--EXTENSIONS--
oci8
--FILE--
<?php
putenv('ORA_SUPPRESS_ERROR_URL=TRUE'); // suppress Oracle Database 23ai error message URLs
var_dump(oci_connect("some", "some", "some"));
var_dump(oci_error());
echo "Done\n";
?>
--EXPECTF--
Warning: oci_connect(): ORA-12154: %s in %s on line %d
bool(false)
array(4) {
["code"]=>
int(12154)
["message"]=>
string(%d) "ORA-12154: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
Done
tests/ini_1.phpt 0000644 00000006242 15041220541 0007600 0 ustar 00 --TEST--
Test OCI8 php.ini settings
--EXTENSIONS--
oci8
--SKIPIF--
<?php
preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
if (!(isset($matches[0]) && $matches[0] >= 11)) {
die("skip works only with Oracle 11g or greater version of Oracle client libraries");
}
?>
--INI--
oci8.privileged_connect = On
oci8.max_persistent = 111
oci8.persistent_timeout = 222
oci8.ping_interval = 333
oci8.connection_class = MyCC
oci8.events = On
oci8.statement_cache_size = 444
oci8.default_prefetch = 555
oci8.old_oci_close_semantics = On
--FILE--
<?php
echo "Test 1 - check initialization\n";
echo 'oci8.privileged_connect = ' . ini_get('oci8.privileged_connect') . "\n";
echo 'oci8.max_persistent = ' . ini_get('oci8.max_persistent') . "\n";
echo 'oci8.persistent_timeout = ' . ini_get('oci8.persistent_timeout') . "\n";
echo 'oci8.ping_interval = ' . ini_get('oci8.ping_interval') . "\n";
echo 'oci8.connection_class = ' . ini_get('oci8.connection_class') . "\n";
echo 'oci8.events = ' . ini_get('oci8.events') . "\n";
echo 'oci8.statement_cache_size = ' . ini_get('oci8.statement_cache_size') . "\n";
echo 'oci8.default_prefetch = ' . ini_get('oci8.default_prefetch') . "\n";
echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') . "\n";
echo "Test 2 - check what can be changed at runtime\n";
var_dump(ini_set('oci8.privileged_connect', 'Off'));
echo 'oci8.privileged_connect = ' . ini_get('oci8.privileged_connect') . "\n";
var_dump(ini_set('oci8.max_persistent', '999'));
echo 'oci8.max_persistent = ' . ini_get('oci8.max_persistent') . "\n";
var_dump(ini_set('oci8.persistent_timeout', '888'));
echo 'oci8.persistent_timeout = ' . ini_get('oci8.persistent_timeout') . "\n";
var_dump(ini_set('oci8.ping_interval', '777'));
echo 'oci8.ping_interval = ' . ini_get('oci8.ping_interval') . "\n";
var_dump(ini_set('oci8.connection_class', 'OtherCC'));
echo 'oci8.connection_class = ' . ini_get('oci8.connection_class') . "\n";
var_dump(ini_set('oci8.events', 'Off'));
echo 'oci8.events = ' . ini_get('oci8.events') . "\n";
var_dump(ini_set('oci8.statement_cache_size', '666'));
echo 'oci8.statement_cache_size = ' . ini_get('oci8.statement_cache_size') . "\n";
var_dump(ini_set('oci8.default_prefetch', '111'));
echo 'oci8.default_prefetch = ' . ini_get('oci8.default_prefetch') . "\n";
var_dump(ini_set('oci8.old_oci_close_semantics', 'Off'));
echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') . "\n";
?>
--EXPECTF--
Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s
Test 1 - check initialization
oci8.privileged_connect = 1
oci8.max_persistent = 111
oci8.persistent_timeout = 222
oci8.ping_interval = 333
oci8.connection_class = MyCC
oci8.events = 1
oci8.statement_cache_size = 444
oci8.default_prefetch = 555
oci8.old_oci_close_semantics = 1
Test 2 - check what can be changed at runtime
bool(false)
oci8.privileged_connect = 1
bool(false)
oci8.max_persistent = 111
bool(false)
oci8.persistent_timeout = 222
bool(false)
oci8.ping_interval = 333
string(4) "MyCC"
oci8.connection_class = OtherCC
bool(false)
oci8.events = 1
bool(false)
oci8.statement_cache_size = 444
bool(false)
oci8.default_prefetch = 555
bool(false)
oci8.old_oci_close_semantics = 1
tests/extauth_01.phpt 0000644 00000007243 15041220541 0010565 0 ustar 00 --TEST--
Test External Authentication errors with oci_connect
--EXTENSIONS--
oci8
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip feature not available on Windows platforms");
die("skip random CI timeouts caused by Oracle Instant Client, see https://github.com/php/php-src/pull/9524#issuecomment-1244409815");
?>
--INI--
oci8.privileged_connect=1
--FILE--
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
// Run Test
echo "Test 1\n";
$c = oci_connect('/', 'notemtpy', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 2\n";
$c = oci_connect('notemtpy', 'notemtpy', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 3\n";
$c = oci_connect('notemtpy', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 4\n";
$c = oci_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 5\n";
$c = oci_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 6\n";
$c = oci_connect('', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 7\n";
$c = oci_connect('/', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 8\n";
$c = oci_connect('/', null, 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 9\n";
$c = oci_connect('/', '', 'd', null, OCI_SYSDBA+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 10\n";
$c = oci_connect('/', '', 'd', null, OCI_SYSOPER+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
?>
--EXPECTF--
Test 1
Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 2
Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 3
Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 4
Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d
bool(false)
bool(false)
Test 5
Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d
bool(false)
bool(false)
Test 6
Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 7
Warning: oci_connect(): ORA-12154: %s in %s on line %d
array(4) {
["code"]=>
int(12154)
["message"]=>
string(%d) "ORA-12154: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 8
Warning: oci_connect(): ORA-12154: %s in %s on line %d
array(4) {
["code"]=>
int(12154)
["message"]=>
string(%d) "ORA-12154: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 9
Warning: oci_connect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r in %s on line %d
array(4) {
["code"]=>
int(%d)
["message"]=>
string(%d) "ORA-%d: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 10
Warning: oci_connect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r in %s on line %d
array(4) {
["code"]=>
int(%d)
["message"]=>
string(%d) "ORA-%d: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
tests/clientversion.phpt 0000644 00000000202 15041220541 0011453 0 ustar 00 --TEST--
oci_client_version()
--EXTENSIONS--
oci8
--FILE--
<?php
echo oci_client_version(), "\n";
?>
--EXPECTF--
%d.%d.%d.%d.%d
tests/lob_aliases.phpt 0000644 00000002357 15041220542 0011062 0 ustar 00 --TEST--
LOB method aliases
--EXTENSIONS--
oci8
--FILE--
<?php
// Function existence
echo "Test 1\n";
var_dump(function_exists('oci_lob_load'));
var_dump(function_exists('oci_lob_tell'));
var_dump(function_exists('oci_lob_truncate'));
var_dump(function_exists('oci_lob_erase'));
var_dump(function_exists('oci_lob_flush'));
var_dump(function_exists('ocisetbufferinglob'));
var_dump(function_exists('ocigetbufferinglob'));
var_dump(function_exists('oci_lob_rewind'));
var_dump(function_exists('oci_lob_read'));
var_dump(function_exists('oci_lob_eof'));
var_dump(function_exists('oci_lob_seek'));
var_dump(function_exists('oci_lob_write'));
var_dump(function_exists('oci_lob_append'));
var_dump(function_exists('oci_lob_size'));
var_dump(function_exists('oci_lob_export'));
var_dump(function_exists('oci_lob_export'));
var_dump(function_exists('oci_lob_import'));
var_dump(function_exists('oci_lob_save'));
var_dump(function_exists('oci_lob_import'));
var_dump(function_exists('oci_free_descriptor'));
echo "Done\n";
?>
--EXPECT--
Test 1
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
Done
tests/extauth_02.phpt 0000644 00000007361 15041220542 0010570 0 ustar 00 --TEST--
Test External Authentication errors with oci_new_connect
--EXTENSIONS--
oci8
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip feature not available on Windows platforms");
die("skip random CI timeouts caused by Oracle Instant Client, see https://github.com/php/php-src/pull/9524#issuecomment-1244409815");
?>
--INI--
oci8.privileged_connect=1
--FILE--
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
// Run Test
echo "Test 1\n";
$c = oci_new_connect('/', 'notemtpy', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 2\n";
$c = oci_new_connect('notemtpy', 'notemtpy', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 3\n";
$c = oci_new_connect('notemtpy', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 4\n";
$c = oci_new_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 5\n";
$c = oci_new_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 6\n";
$c = oci_new_connect('', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 7\n";
$c = oci_new_connect('/', '', 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 8\n";
$c = oci_new_connect('/', null, 'anything', null, OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 9\n";
$c = oci_new_connect('/', '', 'd', null, OCI_SYSDBA+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
echo "Test 10\n";
$c = oci_new_connect('/', '', 'd', null, OCI_SYSOPER+OCI_CRED_EXT);
if (!$c) {
$m = oci_error();
var_dump($m);
}
var_dump($c);
?>
--EXPECTF--
Test 1
Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 2
Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 3
Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 4
Warning: oci_new_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d
bool(false)
bool(false)
Test 5
Warning: oci_new_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d
bool(false)
bool(false)
Test 6
Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
bool(false)
bool(false)
Test 7
Warning: oci_new_connect(): ORA-12154: %s in %s on line %d
array(4) {
["code"]=>
int(12154)
["message"]=>
string(%d) "ORA-12154: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 8
Warning: oci_new_connect(): ORA-12154: %s in %s on line %d
array(4) {
["code"]=>
int(12154)
["message"]=>
string(%d) "ORA-12154: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 9
Warning: oci_new_connect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r %s on line %d
array(4) {
["code"]=>
int(%d)
["message"]=>
string(%d) "ORA-%d: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
Test 10
Warning: oci_new_connect(): ORA-%d: %r(TNS:%s|Cannot connect to database\. Cannot find alias d)%r %s on line %d
array(4) {
["code"]=>
int(%d)
["message"]=>
string(%d) "ORA-%d: %s"
["offset"]=>
int(0)
["sqltext"]=>
string(0) ""
}
bool(false)
tests/minfo.phpt 0000644 00000000405 15041220542 0007705 0 ustar 00 --TEST--
Code coverage for PHP_MINFO_FUNCTION(oci)
--EXTENSIONS--
oci8
--FILE--
<?php
ob_start();
phpinfo(INFO_MODULES);
$v = ob_get_clean();
$r = preg_match('/OCI8 Support .* enabled/', $v);
if ($r !== 1)
var_dump($r);
echo "Done\n";
?>
--EXPECT--
Done