xref: /PHP-8.3/ext/oci8/tests/ini_1.phpt (revision 328a07da)
1--TEST--
2Test OCI8 php.ini settings
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
8if (!(isset($matches[0]) && $matches[0] >= 11)) {
9    die("skip works only with Oracle 11g or greater version of Oracle client libraries");
10}
11?>
12--INI--
13oci8.privileged_connect = On
14oci8.max_persistent = 111
15oci8.persistent_timeout = 222
16oci8.ping_interval = 333
17oci8.connection_class = MyCC
18oci8.events = On
19oci8.statement_cache_size = 444
20oci8.default_prefetch = 555
21oci8.old_oci_close_semantics = On
22--FILE--
23<?php
24
25echo "Test 1 - check initialization\n";
26echo 'oci8.privileged_connect = ' . ini_get('oci8.privileged_connect') . "\n";
27echo 'oci8.max_persistent = ' . ini_get('oci8.max_persistent') . "\n";
28echo 'oci8.persistent_timeout = ' . ini_get('oci8.persistent_timeout') . "\n";
29echo 'oci8.ping_interval = ' . ini_get('oci8.ping_interval') . "\n";
30echo 'oci8.connection_class = ' . ini_get('oci8.connection_class') . "\n";
31echo 'oci8.events = ' . ini_get('oci8.events') . "\n";
32echo 'oci8.statement_cache_size = ' . ini_get('oci8.statement_cache_size') . "\n";
33echo 'oci8.default_prefetch = ' . ini_get('oci8.default_prefetch') . "\n";
34echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') . "\n";
35
36echo "Test 2 - check what can be changed at runtime\n";
37var_dump(ini_set('oci8.privileged_connect', 'Off'));
38echo 'oci8.privileged_connect = ' . ini_get('oci8.privileged_connect') . "\n";
39var_dump(ini_set('oci8.max_persistent', '999'));
40echo 'oci8.max_persistent = ' . ini_get('oci8.max_persistent') . "\n";
41var_dump(ini_set('oci8.persistent_timeout', '888'));
42echo 'oci8.persistent_timeout = ' . ini_get('oci8.persistent_timeout') . "\n";
43var_dump(ini_set('oci8.ping_interval', '777'));
44echo 'oci8.ping_interval = ' . ini_get('oci8.ping_interval') . "\n";
45var_dump(ini_set('oci8.connection_class', 'OtherCC'));
46echo 'oci8.connection_class = ' . ini_get('oci8.connection_class') . "\n";
47var_dump(ini_set('oci8.events', 'Off'));
48echo 'oci8.events = ' . ini_get('oci8.events') . "\n";
49var_dump(ini_set('oci8.statement_cache_size', '666'));
50echo 'oci8.statement_cache_size = ' . ini_get('oci8.statement_cache_size') . "\n";
51var_dump(ini_set('oci8.default_prefetch', '111'));
52echo 'oci8.default_prefetch = ' . ini_get('oci8.default_prefetch') . "\n";
53var_dump(ini_set('oci8.old_oci_close_semantics', 'Off'));
54echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') . "\n";
55
56?>
57--EXPECTF--
58Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s
59Test 1 - check initialization
60oci8.privileged_connect = 1
61oci8.max_persistent = 111
62oci8.persistent_timeout = 222
63oci8.ping_interval = 333
64oci8.connection_class = MyCC
65oci8.events = 1
66oci8.statement_cache_size = 444
67oci8.default_prefetch = 555
68oci8.old_oci_close_semantics = 1
69Test 2 - check what can be changed at runtime
70bool(false)
71oci8.privileged_connect = 1
72bool(false)
73oci8.max_persistent = 111
74bool(false)
75oci8.persistent_timeout = 222
76bool(false)
77oci8.ping_interval = 333
78string(4) "MyCC"
79oci8.connection_class = OtherCC
80bool(false)
81oci8.events = 1
82bool(false)
83oci8.statement_cache_size = 444
84bool(false)
85oci8.default_prefetch = 555
86bool(false)
87oci8.old_oci_close_semantics = 1
88