.\" This man page is automatically generated using .\" kayadoc2man from the Kaya development tools and the -xmldocs compile .\" option. Editing it directly is not encouraged. .\" It is under the same license as the source .k file that it was .\" generated from. .TH "System.getEnv" "3kaya" "August 2014" "Kaya" "Kaya module reference" .SH "NAME" System::getEnv \- Get the value of an environment variable. .SH "SYNOPSIS" .B String getEnv( \fIString env\fP .B ")" .SH "ARGUMENTS" .PP .B "env" The name of the environment variable .SH "DESCRIPTION" .PP Retrieves the value of an environment variable. .PP This is often necessary in a web application as the web server will set environment variables in the program. Some of these headers are set by the server environment, others are set based on the current request (and so may be trivially forged by the user's browser). .IP "" -4 ua = getEnv("HTTP_USER_AGENT"); // Contents of User-Agent header host = getEnv("HTTP_HOST"); // the IP address of the web server user = getEnv("REMOTE_USER"); // the username under HTTP authentication ip = getEnv("REMOTE_ADDR"); // the client's IP address .PP Environment variables are also useful for command-line programs .IP "" -4 home = getEnv("HOME"); // The user's home directory on Posix systems proxy = getEnv("HTTP_PROXY"); // The HTTP proxy to use for outgoing connections .PP If the environment variable is not set, the empty String will be returned. .SH "AUTHORS" Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/ .SH LICENSE The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation. .SH "RELATED" .PD 0 .PP .B "System.getArgs"(3kaya) .PP .B "System.getPID"(3kaya) .PD 0.4v