Heads Up!
The following methods DO NOT return an "Answer" table.
log¶
coronium.log( string, string2, stringN )
Print out debugging messages to the cloud.log file.
Examples
coronium.log( "something happened" )
coronium.log( "something happened", t.user, "again" )
utils.mysqlString¶
coronium.utils.mysqlString( string )
Makes a string safe for MySQL.
Parameters
Name | Details |
---|---|
string | The string to make safe. (String, required) |
Returns
MySQL safe string.
Examples
local sql_safe_str = coronium.utils.mysqlString( str )
utils.encode_b64¶
coronium.utils.encode_b64( string )
Encode a Base64 string.
Parameters
Name | Details |
---|---|
string | A string to Base64 encode. (String, required) |
Returns
A Base64 encoded string.
Examples
local encodedb64 = coronium.utils.encode_b64( str )
utils.decode_b64¶
coronium.utils.decode_b64( base64_str )
Decode a Base64 string.
Parameters
Name | Details |
---|---|
string | A Base64 string to decode. (String, required) |
Returns
A Base64 decoded string.
Examples
local decoded = coronium.utils.decode_b64( base64_str )
utils.escape¶
coronium.utils.escape( string )
Encodes a URI string.
Parameters
Name | Details |
---|---|
string | A string to escape. (String, required) |
Returns
An encoded string.
Examples
local encoded_uri = coronium.utils.escape( unescaped_uri )
utils.unescape¶
coronium.utils.unescape( string )
Decodes a URI string.
Parameters
Name | Details |
---|---|
string | A string to unescape. (String, required) |
Returns
An encoded string.
Examples
local decoded_uri = coronium.utils.unescape( escaped_uri )
utils.encode_args¶
coronium.utils.encode_args( args_tbl )
Encodes arugments into a URI string from a table.
Parameters
Name | Details |
---|---|
table | A table of arguments. (Table, required) |
Returns
An encoded string.
Examples
local arg_str = coronium.utils.encode_args( args_tbl )
utils.decode_args¶
coronium.utils.decode_args( args_str )
Parses arugments from a URI string to a table.
Parameters
Name | Details |
---|---|
args_str | A URI string arguments. (String, required) |
Returns
An table with the parsed string.
Examples
local args_tbl = coronium.utils.decode_args( args_str )
utils.md5¶
coronium.utils.md5( string )
Create a MD5 hash.
Parameters
Name | Details |
---|---|
string | A string to MD5. (String, required) |
Returns
A MD5 hash.
Examples
local hashmd5 = coronium.utils.md5( str )
globals¶
coronium.globals
A global space to store information that will be available to all cloud code pages.
Examples
-- set a global coronium.globals.some_data = some_data -- get a global local some_data = coronium.globals.some_data
asJson¶
coronium.asJson( table )
Converts a Lua table to a JSON string. Useful for log output.
Parameters
Name | Details |
---|---|
table | A Lua table to convert to JSON. (Table, required) |
Returns
A JSON string object based on the input table.
Examples
coronium.log( coronium.asJson( table ) )