xref: /PHP-7.2/ext/oci8/tests/ini_1.phpt (revision bdd67d81)
1--TEST--
2Test OCI8 php.ini settings
3--SKIPIF--
4<?php
5if (!extension_loaded('oci8')) die ("skip no oci8 extension");
6preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
7if (!(isset($matches[0]) && $matches[0] >= 11)) {
8    die("skip works only with Oracle 11g or greater version of Oracle client libraries");
9}
10?>
11--INI--
12oci8.privileged_connect = On
13oci8.max_persistent = 111
14oci8.persistent_timeout = 222
15oci8.ping_interval = 333
16oci8.connection_class = MyCC
17oci8.events = On
18oci8.statement_cache_size = 444
19oci8.default_prefetch = 555
20oci8.old_oci_close_semantics = On
21--FILE--
22<?php
23
24echo "Test 1 - check initialization\n";
25echo 'oci8.privileged_connect = ' . ini_get('oci8.privileged_connect') . "\n";
26echo 'oci8.max_persistent = ' . ini_get('oci8.max_persistent') . "\n";
27echo 'oci8.persistent_timeout = ' . ini_get('oci8.persistent_timeout') . "\n";
28echo 'oci8.ping_interval = ' . ini_get('oci8.ping_interval') . "\n";
29echo 'oci8.connection_class = ' . ini_get('oci8.connection_class') . "\n";
30echo 'oci8.events = ' . ini_get('oci8.events') . "\n";
31echo 'oci8.statement_cache_size = ' . ini_get('oci8.statement_cache_size') . "\n";
32echo 'oci8.default_prefetch = ' . ini_get('oci8.default_prefetch') . "\n";
33echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') . "\n";
34
35echo "Test 2 - check what can be changed at runtime\n";
36var_dump(ini_set('oci8.privileged_connect', 'Off'));
37echo 'oci8.privileged_connect = ' . ini_get('oci8.privileged_connect') . "\n";
38var_dump(ini_set('oci8.max_persistent', '999'));
39echo 'oci8.max_persistent = ' . ini_get('oci8.max_persistent') . "\n";
40var_dump(ini_set('oci8.persistent_timeout', '888'));
41echo 'oci8.persistent_timeout = ' . ini_get('oci8.persistent_timeout') . "\n";
42var_dump(ini_set('oci8.ping_interval', '777'));
43echo 'oci8.ping_interval = ' . ini_get('oci8.ping_interval') . "\n";
44var_dump(ini_set('oci8.connection_class', 'OtherCC'));
45echo 'oci8.connection_class = ' . ini_get('oci8.connection_class') . "\n";
46var_dump(ini_set('oci8.events', 'Off'));
47echo 'oci8.events = ' . ini_get('oci8.events') . "\n";
48var_dump(ini_set('oci8.statement_cache_size', '666'));
49echo 'oci8.statement_cache_size = ' . ini_get('oci8.statement_cache_size') . "\n";
50var_dump(ini_set('oci8.default_prefetch', '111'));
51echo 'oci8.default_prefetch = ' . ini_get('oci8.default_prefetch') . "\n";
52var_dump(ini_set('oci8.old_oci_close_semantics', 'Off'));
53echo 'oci8.old_oci_close_semantics = ' . ini_get('oci8.old_oci_close_semantics') . "\n";
54
55?>
56===DONE===
57<?php exit(0); ?>
58--EXPECT--
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===DONE===
89