php-doc-en/reference/ifx/ini.xml
2005-02-22 17:36:12 +00:00

396 lines
11 KiB
XML

<?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
-->