get-app
Purpose: Obtain data that describes the application.
get-app \
name | directory | trace-directory | file-directory \
| db-vendor <database configuration> | upload-size \
| path | process-data \
to [ define ] <variable>
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.
- "process-data" obtains the pointer to global_process_data.
- "upload-size" is the maximum allowed size of an uploaded file - this is a number.
Note that all the string values above (except "process-data") should be treated as constants - do not change them as that may cause program to malfunction. If you want to alter any of these values, make a copy first (see
copy-string).
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
Application information (
get-app set-app )
SEE ALL (
documentation)