Index
enviroment
This object provides information about the system environment, creating the env object for this purpose.
Internal Values
Internally, it uses a variety of constant data, with the exception of the hash_default variable, which stores the data retrieved from the database as default data.
The constants used are:
- WEBDOMAIN
- Public server URL.
- WEBPATH
- Physical path to the public server content.
- USRDOMAIN
- Url of the user's administrative control panel.
- USRPATH
- Physical path to the user's content.
- IP
- Client IP
- ADMURL
- Root URL of the administrative/private user. Not available in the public version.
- WEBURL
- Root URL of the public website
- USRURL
- Root URL of the public user of the site. Default is the same as above.
- AVAILABLELANGS
- Available languages
- LANG
- Default language
- HOME
- Physical path of the system web user directory. May change depending on the web server used. Configurable.
- TMP
- Physical path of the temporary file storage directory. May change depending on the web server used. Configurable
- HTDOCS
- Physical path where the HTML files are located. This may vary depending on the web server used. Configurable
- TEMP
- Relational path where temporary files visible on the web will be stored.
Functions/Methods
Function and procedure names are preceded by the prefix env, which is the same name as the returned connector object.
(initialization)
Retrieves configuration stored in the database, modifying pseudoconstants such as the IP address. It also retrieves default language data (first language in array)
envSecCode
Returns the security code SECCODE. This string is used for secure information exchange and is created when the system is installed and must match the one used to display data and execute scripts.
envDir
Receives the type of directory searched for and returns the physical directory value.
envPath
According to the parameter, returns the value of the requested relative directory, adding two values, cgi and script, which would be the path to the directories containing the CGI or scripts.
envGet
Receives a parameter indicating the value to return.
In the case of constant values (ip) or those specified with an additional parameter (domain), it returns the value itself;
in the case of the remaining values, these are derived from the JSON values stored in the database.
In the case of arrays, returns the entire array unless the element index is specified.
In the case of hashes or alphanumeric key arrays, it can return the entire array, the specified key,
or if it is equivalent to key, returns the keys of that array.
envParam
In the case of forms, returns the value specified in a GET or POST, but not present as a cookie.
envCookie
Returns the value of the specified cookie
envDefault
Based on a parameter, returns the default value stored in the database, table config.