summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conf_validation.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-06-07 16:17:32 +0300
committerValentin Bartenev <vbart@nginx.com>2018-06-07 16:17:32 +0300
commit8f278a5fedaa570398318dcec77eea7d8c856796 (patch)
tree11ef82720ad11d643dd9f1615cdd85a2d3f39246 /src/nxt_conf_validation.c
parent388390888bc0c2a3589b71e5b3dc57408a5f4c44 (diff)
downloadunit-8f278a5fedaa570398318dcec77eea7d8c856796.tar.gz
unit-8f278a5fedaa570398318dcec77eea7d8c856796.tar.bz2
PHP: added setting of individual configuration options.
Diffstat (limited to '')
-rw-r--r--src/nxt_conf_validation.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nxt_conf_validation.c b/src/nxt_conf_validation.c
index 6cbd8f22..7d9c9631 100644
--- a/src/nxt_conf_validation.c
+++ b/src/nxt_conf_validation.c
@@ -69,6 +69,8 @@ static nxt_int_t nxt_conf_vldt_environment(nxt_conf_validation_t *vldt,
nxt_str_t *name, nxt_conf_value_t *value);
static nxt_int_t nxt_conf_vldt_argument(nxt_conf_validation_t *vldt,
nxt_conf_value_t *value);
+static nxt_int_t nxt_conf_vldt_php_option(nxt_conf_validation_t *vldt,
+ nxt_str_t *name, nxt_conf_value_t *value);
static nxt_conf_vldt_object_t nxt_conf_vldt_root_members[] = {
@@ -207,6 +209,16 @@ static nxt_conf_vldt_object_t nxt_conf_vldt_php_options_members[] = {
NULL,
NULL },
+ { nxt_string("admin"),
+ NXT_CONF_VLDT_OBJECT,
+ &nxt_conf_vldt_object_iterator,
+ (void *) &nxt_conf_vldt_php_option },
+
+ { nxt_string("user"),
+ NXT_CONF_VLDT_OBJECT,
+ &nxt_conf_vldt_object_iterator,
+ (void *) &nxt_conf_vldt_php_option },
+
NXT_CONF_VLDT_END
};
@@ -841,3 +853,21 @@ nxt_conf_vldt_argument(nxt_conf_validation_t *vldt, nxt_conf_value_t *value)
return NXT_OK;
}
+
+
+static nxt_int_t
+nxt_conf_vldt_php_option(nxt_conf_validation_t *vldt, nxt_str_t *name,
+ nxt_conf_value_t *value)
+{
+ if (name->length == 0) {
+ return nxt_conf_vldt_error(vldt,
+ "The PHP option name must not be empty.");
+ }
+
+ if (nxt_conf_type(value) != NXT_CONF_STRING) {
+ return nxt_conf_vldt_error(vldt, "The \"%V\" PHP option must be "
+ "a string.", name);
+ }
+
+ return NXT_OK;
+}