Configuration method

If configuration file contains method conf, this method will be executed first, before method auto, to set vital system parameters:
·Files defining character sets;  
·HTTP POST-request size limit;  
·file size limit   [3.4.5];  
· ñount of loops iterations and recoursion depth limit   [3.4.5];
·Mail-sending server/application;  
·SQL-drivers and their parameters;  
·Table to associate filename extension with its mime-type.  

We recommend that you place this method in in configuration file.

Method is defined like the following:

filespec is full name of file containing the method.

UTF-8, used in Parser by default, is always available and thus doesn't have to be loaded. To use other charsets, specify files defining them. This should be done in the following way:

See "Files defining character sets".

#Size limit for POST data, default is 10Mb:
#Size limit for files to be read into memory, default is 512Mb:
#Loops iterations limit, default is 20000:
#Recoursion depth limit, default is 1000:
#File lock wait timeout for reading or writing, default is 9.5 seconds:

max_file_size, max_loop, max_recoursion to zero value means 'unlimited'.

Parameters for mail-sending program (see

…under Windows and UNIX-SMTP-server address


…under UNIX:

in safe mode versions you can configure mail-sending program only if you compile Parser from source code, by yourself. Binary versions, which are available for download directly from, configure mail-sending in such a way:

   /usr/sbin/sendmail -i -t -f postmaster

It is only in unsafe-mode versions that you can specify mail-sending program by yourself:
   $.sendmail[/custom/mail/sending/program params]

…and by default Parser uses command…

   /usr/sbin/sendmail -t -i -f postmaster

…or command…

   /usr/lib/sendmail -t -i -f postmaster

…depending on system you use.

When a message is being sent, Parser will replace "
postmaster" with mail-sender's address from obligatory header field "from".

One can also provide a table of SQL-drivers:
[^table::create{protocol   driver   client
mysql   /full/disk/path/parser3mysql.dll   /full/disk/path/libmySQL.dll
odbc   /full/disk/path/parser3odbc.dll
pgsql /full/disk/path/parser3pgsql.dll   /full/disk/path/libpq.dll
sqlite /full/disk/path/parser3sqlite.dll   /full/disk/path/sqlite3.dll
oracle   /path/to/parser3oracle.dll   C:\Oracle\Ora81\BIN\oci.dll?PATH+=^;C:\Oracle\Ora81\bin
Column client of table drivers may contain parameters passed to client's library, delimited from file name with character ?. The whole construction will look like:
…as well as…
These variables will replace (=) or be appended to (+=) already existing value in program environment before the library is initialized. Such an approach is particularly useful when you add path to Oracle libraries, if this path has not been already specified in program's system environment.

Table to associate filename extension with its mime-type:

 file created with ^file::load[…],
 will specify this $response:content-type when output in $response:body
table::create{ext mime-type
7z   application/x-7z-compressed
zip   application/zip

File name extensions in this table should be given in lowercase. Table search is case-insensitive, so, for example, file FACE.GIF will acquire mime-type image/gif.

$STRICT-VARS(true) is specified every attempt to access to uninitialized variable will cause an exception.   [3.4.2]

$LOCALS(true) is specified, all the variables of the all methods of all the classes will be local.   [3.4.6]

Copyright © 1997–2021 Art. Lebedev Studio | Last updated: 27.01.2021