get-app
Purpose:
Obtain data that describes the application.
Syntax:
get-app \
name | directory | trace-directory | file-directory \
| db-vendor <database configuration> | upload-size \
| path \
to [ define ] <variable>
Description:
Application-related variables can be obtained with get-app statement. The following application variables can be obtained (they are all strings except upload-size):
- "name" returns the name of your application, as specified when created (see vf).
- "directory" is the directory where your application resides, i.e. the application home directory (see how_vely_works).
- "trace-directory" is the directory where your application trace files are written (if enabled, see how_vely_works).
- "file-directory" is the directory where Vely file storage system is, i.e. file_storage.
- "db-vendor" is the database vendor name of database given by <database configuration> (as used for example in run-query). You can use it to create database specific conditions. The database vendor name can be compared against predefined string constants VV_MARIADB (for MariaDB database), VV_POSTGRES (for Postgres database) and VV_SQLITE (for SQLite database).
- "path" is the leading path of the URL request that can be used to build web forms and links leading back to your application. It returns the same value as p-path.
- "upload-size" is the maximum allowed size of an uploaded file - this is a number.
Note that all these values are constants.
Examples:
Get the name of Vely application:
get-app name to define appname
Get the vendor of database db:
get-app db-vendor db to define dbv
if (!strcmp (dbv, VV_POSTGRES)) {
}
See also: