1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<section id="ifx.configuration">
&reftitle.runtime;
&extension.runtime;
<note>
<para>
Make sure that the Informix environment variables INFORMIXDIR and
INFORMIXSERVER are available to the PHP ifx driver, and that the
INFORMIX bin directory is in the PATH. Check this by running a
script that contains a call to <function>phpinfo</function>
before you start testing. The <function>phpinfo</function>
output should list these environment variables. This is true for
both CGI php and Apache mod_php. You may have to set these
environment variables in your Apache startup script.
</para>
<para>
The Informix shared libraries should also be available to the
loader (check LD_LIBRARY_PATH or ld.so.conf/ldconfig).
</para>
</note>
<note>
<title>
Some notes on the use of BLOBs (TEXT and BYTE columns)
</title>
<para>
BLOBs are normally addressed by BLOB identifiers. Select queries
return a "blob id" for every BYTE and TEXT column. You can get
at the contents with "string_var = ifx_get_blob($blob_id);" if
you choose to get the BLOBs in memory (with:
"ifx_blobinfile(0);"). If you prefer to receive the content of
BLOB columns in a file, use "ifx_blobinfile(1);", and
"ifx_get_blob($blob_id);" will get you the filename. Use normal
file I/O to get at the blob contents.
</para>
<para>
For insert/update queries you must create these "blob id's"
yourself with "<function>ifx_create_blob</function>;". You then
plug the blob id's into an array, and replace the blob columns
with a question mark (?) in the query string. For
updates/inserts, you are responsible for setting the blob
contents with <function>ifx_update_blob</function>.
</para>
<para>
The behaviour of BLOB columns can be altered by configuration
variables that also can be set at runtime:
</para>
<para>
configuration variable: ifx.textasvarchar
</para>
<para>
configuration variable: ifx.byteasvarchar
</para>
<para>
runtime functions:
</para>
<para>
ifx_textasvarchar(0): use blob id's for select queries with TEXT
columns
</para>
<para>
ifx_byteasvarchar(0): use blob id's for select queries with BYTE
columns
</para>
<para>
ifx_textasvarchar(1): return TEXT columns as if they were
VARCHAR columns, so that you don't need to use blob id's for
select queries.
</para>
<para>
ifx_byteasvarchar(1): return BYTE columns as if they were
VARCHAR columns, so that you don't need to use blob id's for
select queries.
</para>
<para>
configuration variable: ifx.blobinfile
</para>
<para>
runtime function:
</para>
<para>
ifx_blobinfile_mode(0): return BYTE columns in memory, the blob
id lets you get at the contents.
</para>
<para>
ifx_blobinfile_mode(1): return BYTE columns in a file, the blob
id lets you get at the file name.
</para>
<para>
If you set ifx_text/byteasvarchar to 1, you can use TEXT and BYTE
columns in select queries just like normal (but rather long)
VARCHAR fields. Since all strings are "counted" in PHP, this
remains "binary safe". It is up to you to handle this
correctly. The returned data can contain anything, you are
responsible for the contents.
</para>
<para>
If you set ifx_blobinfile to 1, use the file name returned by
ifx_get_blob(..) to get at the blob contents. Note that in this
case YOU ARE RESPONSIBLE FOR DELETING THE TEMPORARY FILES CREATED
BY INFORMIX when fetching the row. Every new row fetched will
create new temporary files for every BYTE column.
</para>
<para>
The location of the temporary files can be influenced by the
environment variable "blobdir", default is "." (the current
directory). Something like: putenv(blobdir=tmpblob"); will ease
the cleaning up of temp files accidentally left behind (their
names all start with "blb").
</para>
</note>
<note>
<title>Automatically trimming "char" (SQLCHAR and SQLNCHAR) data</title>
<para>
This can be set with the configuration variable
</para>
<para>
ifx.charasvarchar: if set to 1 trailing spaces will be
automatically trimmed, to save you some "chopping".
</para>
</note>
<note>
<title>&null; values</title>
<para>
The configuration variable ifx.nullformat (and the runtime
function <function>ifx_nullformat</function>) when set to &true;
will return &null; columns as the string "&null;", when set to &false;
they return the empty string. This allows you to discriminate
between &null; columns and empty columns.
</para>
</note>
<para>
<table>
<title>Informix configuration options</title>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Default</entry>
<entry>Changeable</entry>
<entry>Changelog</entry>
</row>
</thead>
<tbody>
<row>
<entry>ifx.allow_persistent</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry>ifx.max_persistent</entry>
<entry>"-1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry>ifx.max_links</entry>
<entry>"-1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry>ifx.default_host</entry>
<entry>NULL</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry>ifx.default_user</entry>
<entry>NULL</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry>ifx.default_password</entry>
<entry>NULL</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry>ifx.blobinfile</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>ifx.textasvarchar</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>ifx.byteasvarchar</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>ifx.charasvarchar</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry>ifx.nullformat</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
&ini.php.constants;
</para>
&ini.descriptions.title;
<para>
<variablelist>
<varlistentry id="ini.ifx.allow-persistent">
<term>
<parameter>ifx.allow_persistent</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Whether to allow persistent Informix connections.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.max-persistent">
<term>
<parameter>ifx.max_persistent</parameter>
<type>integer</type>
</term>
<listitem>
<para>
The maximum number of persistent Informix connections per
process.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.max-links">
<term>
<parameter>ifx.max_links</parameter>
<type>integer</type>
</term>
<listitem>
<para>
The maximum number of Informix connections per process, including
persistent connections.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.default-host">
<term>
<parameter>ifx.default_host</parameter>
<type>string</type>
</term>
<listitem>
<para>
The default host to connect to when no host is specified
in <function>ifx_connect</function> or
<function>ifx_pconnect</function>. Doesn't apply in
&safemode;.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.default-user">
<term>
<parameter>ifx.default_user</parameter>
<type>string</type>
</term>
<listitem>
<para>
The default user id to use when none is specified
in <function>ifx_connect</function> or
<function>ifx_pconnect</function>. Doesn't apply in
&safemode;.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.default-password">
<term>
<parameter>ifx.default_password</parameter>
<type>string</type>
</term>
<listitem>
<para>
The default password to use when none is specified
in <function>ifx_connect</function> or
<function>ifx_pconnect</function>. Doesn't apply in
&safemode;.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.blobinfile">
<term>
<parameter>ifx.blobinfile</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Set to &true; if you want to return blob columns
in a file, &false; if you want them in memory. You can
override the setting at runtime
with <function>ifx_blobinfile_mode</function>.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.textasvarchar">
<term>
<parameter>ifx.textasvarchar</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Set to &true; if you want to return TEXT columns
as normal strings in select statements,
&false; if you want to use blob id parameters. You can
override the setting at runtime with
<function>ifx_textasvarchar</function>.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.byteasvarchar">
<term>
<parameter>ifx.byteasvarchar</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Set to &true; if you want to return BYTE columns
as normal strings in select queries,
&false; if you want to use blob id parameters. You can
override the setting at runtime with
<function>ifx_textasvarchar</function>.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.charasvarchar">
<term>
<parameter>ifx.charasvarchar</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Set to &true; if you want to trim trailing spaces
from CHAR columns when fetching them.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.ifx.nullformat">
<term>
<parameter>ifx.nullformat</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Set to &true; if you want to return &null; columns
as the literal string "&null;", &false; if you want
them returned as the empty string "". You can
override this setting at runtime with
<function>ifx_nullformat</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|