logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

get-app - (application-information)

Description

Application-related variables can be obtained with get-app statement. The following application variables can be obtained (they are all strings unless indicated otherwise): • "name" returns the name of your application, as specified when created (see mgrg). • "directory" is the directory where your application resides, i.e. the application home directory (see directories). • "trace-directory" is the directory where your application trace files are written, if enabled (see directories). • "root-directory" is the Golf's root directory (i.e. where Golf is installed, see directories). • "is-service" is a boolean variable that is true if your code is running as a service, or false if it is running as a command-line program. • "file-directory" is the directory where Golf 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 GG_MARIADB (for MariaDB database), GG_POSTGRES (for Postgres database) and GG_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 used in print-path before <request path> is appended. • "upload-size" is the maximum allowed size of an uploaded file - this is a number (see gg for setting this value).

Examples

Get the name of Golf application: get-app name to appname Get the vendor of database db: get-app db-vendor db to dbv if-true dbv equal GG_POSTGRES // do something Postgres specific end-if

Name

get-app - (application-information)

Purpose

Obtain data that describes the application.

See Also

Application information get-app See all documentation $DATE $VERSION GOLF(2gg)

Syntax

get-app \ name | directory | trace-directory | file-directory | root-directory \ | db-vendor <database configuration> | upload-size \ | path | is-service \ to <variable>

See Also