OpenResty::Util - Utility functions for OpenResty
This module exports a set of utility functions used for other OpenResty server components.
This module exports the following functions by default:
$value = _IDENT($value)
$value is an well-formed identifier in OpenResty's sense.
Essentially it's specified by the following Perl regex:
_IDENT returns the input argument if it's well-formed; undef otherwise.
$quoted = Q($value)
Quotes the value as if it's a SQL value literal. Basically,
foo's bar will become
$quoted = QI($value)
Quotes the value as if it's a SQL identifier literal. Basically,
foo will become
$bool = check_password($password)
Checks whether the given password (
$password) is well-formed. 1 if true, undef otherwise.
$content = slurp($filename)
Returns all the content of the file specified by
$cgi = new_mocked_cgi($url, $content)
Returns a mocked-up CGI object from URL (specified by
$url) and the HTTP request content (specified by
Agent Zhang (agentzh)