From 27c95af26d825e33eda09f1a863443252f16e1ae Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Wed, 20 Jul 2022 13:41:44 +0200 Subject: clarify conditions and variables in the documentation --- doc/source/config.rst | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'doc/source/config.rst') diff --git a/doc/source/config.rst b/doc/source/config.rst index d7f7f24..ac8aef1 100644 --- a/doc/source/config.rst +++ b/doc/source/config.rst @@ -78,7 +78,7 @@ Miscellaneous conditions ^^^^^^^^^^ -It's possible to use conditions to have configuration portables accross +It's possible to use conditions to have configuration portable across several setups. :: @@ -88,6 +88,30 @@ several setups. # some other rules @end_condition; +Conditions accept variables and the special function ``extension_loadod()``. + +:: + @condition extension_loaded("sqlite3"); + sp.ini.key("sqlite3.extension_dir").ro(); + @end_condition; + +Conditions cannot be nested, but arithmetic and logical operations can be applied. + +:: + @condition extension_loaded("session") && PHP_VERSION_ID <= 80200; + set whitelist "my_fun,cos" + sp.eval_whitelist.list(whitelist).simulation().dump("/tmp/dump_result/"); + @end_condition; + +variables +^^^^^^^^^ + +You may set a configuration variable using the ``set`` keyword (or ``@set``) and use it instead of arguments. + +:: + @set CMD "ls" + sp.disable_function.function("system").pos("0").value(CMD).allow(); + global ^^^^^^ -- cgit v1.3