Pregunta

Where can I find a full list of the Tritium variables (such as $host, $path, $content_type, etc.)?

¿Fue útil?

Solución

You can find all the accessible environment variables by looking at your tmp/messages/.../final-env.json file.

According to the doc:

All the environment variables available are listed in the final-env.json file. This file can be found in the {Moovweb Project Path}/tmp/messages/{Folder ID} directory. To use one of these environment variables in Tritium, you need to add a dollar sign before it: $variable.

They provide a sample final-env.json file there:

{
 "0": "https://www.dropbox.com",
 "1": "https://www.dropbox.com",
 "2": "SAMEORIGIN",
 "3": "HTTP/1.0",
 "Content-Type-Charset": "UTF-8",
 "__catch_all__": ".moovapp.com",
 "accept_encoding": "gzip,deflate",
 "asset_host": "http://localhost:3003/",
 "body": "true",
 "body_length": "1195",
 "cache_control": "no-cache",
 "canonical_found": "false",
 "charset_determined": "UTF-8",
 "connection": "close",
 "content_type": "text/html; charset=utf-8",
 "cookie": "gvc=Mjg1NjE0NTk0MjAxMDUyNjY4MTc1NjYyMDE3OTAxNjU0NDk4NTc2",
 "date": "Fri, 07 Sep 2012 01:57:35 GMT",
 "device_stylesheet": "main",
 "found_conn": "true",
 "header_hh": "Host: ",
 "host": "mlocal.dropbox.com",
 "host_hh": "https://mlocal.dropbox.com",
 "key": "x_frame_options",
 "location": "https://www.dropbox.com/",
 "method": "GET",
 "path": "/",
 "pragma": "no-cache",
 "rewriter_url": "false",
 "secure": "false",
 "server": "nginx/1.0.14",
 "set_cookie": "flash=; Domain=dropbox.com; expires=Fri, 07-Sep-2012 01:57:35 GMT; Path=/; httponly",
 "slash_path": "/",
 "source_host": "www.dropbox.com",
 "status": "302",
 "use_global_replace_vars": "true",
 "user_agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.54.16 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1",
 "value": "SAMEORIGIN",
 "x_frame_options": "SAMEORIGIN"
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top