Configuration file

Exemplary of file is included in distribution package (see auto.p).

This is the cornerstone of class
MAIN. It may contain configuration method, which will be executed first, before method auto, to set vital system parameters.

After configuration method is executed, output charset and code charset may be specified (default charset in both cases is
UTF-8).

Recommended code:
@auto[]
#source/client charsets
$request:charset[windows-1251]
$response:charset[windows-1251]
$response:content-type[
   $.value[text/html]
   $.charset[$response:charset]
]

Note: if you want methods
upper and lower (class string) to work with languages other than English correctly, you will need to correctly specify $request:charset.

It is also recommended that you specify path to classes used at your site here:
$CLASS_PATH[/../classes]

…as well as connect string for SQL-server you are going to use (example for ODBC):
$SQL.connect-string[odbc://DSN=www_mydomain_ru^;UID=user^;PWD=password]

Note: it will be used in your code like…
^connect[$SQL.connect-string]{…} 

It is recommended that you also define method unhandled_exception, which will output error messages on problems at your site.

Note: configuration file is definitely optional. You can place your configuration method in file
auto.p in your web-space root. Configurations, however, will most probably be different for different hosting locations (for example: debug and production servers). That is why it would be more comfortable to keep these differences in a separate file outside web-space.


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 28.01.2021