diff options
| author | Ben Fuhrmannek | 2022-07-20 13:41:44 +0200 |
|---|---|---|
| committer | Ben Fuhrmannek | 2022-07-20 13:41:44 +0200 |
| commit | 27c95af26d825e33eda09f1a863443252f16e1ae (patch) | |
| tree | 0ca89faebc81b636ea47baf40cc1a6f35dcd17ed | |
| parent | 2aed4220c2d019cc9b46fec70cfd79d249498e14 (diff) | |
clarify conditions and variables in the documentation
| -rw-r--r-- | doc/source/config.rst | 26 |
1 files changed, 25 insertions, 1 deletions
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 | |||
| 78 | conditions | 78 | conditions |
| 79 | ^^^^^^^^^^ | 79 | ^^^^^^^^^^ |
| 80 | 80 | ||
| 81 | It's possible to use conditions to have configuration portables accross | 81 | It's possible to use conditions to have configuration portable across |
| 82 | several setups. | 82 | several setups. |
| 83 | 83 | ||
| 84 | :: | 84 | :: |
| @@ -88,6 +88,30 @@ several setups. | |||
| 88 | # some other rules | 88 | # some other rules |
| 89 | @end_condition; | 89 | @end_condition; |
| 90 | 90 | ||
| 91 | Conditions accept variables and the special function ``extension_loadod()``. | ||
| 92 | |||
| 93 | :: | ||
| 94 | @condition extension_loaded("sqlite3"); | ||
| 95 | sp.ini.key("sqlite3.extension_dir").ro(); | ||
| 96 | @end_condition; | ||
| 97 | |||
| 98 | Conditions cannot be nested, but arithmetic and logical operations can be applied. | ||
| 99 | |||
| 100 | :: | ||
| 101 | @condition extension_loaded("session") && PHP_VERSION_ID <= 80200; | ||
| 102 | set whitelist "my_fun,cos" | ||
| 103 | sp.eval_whitelist.list(whitelist).simulation().dump("/tmp/dump_result/"); | ||
| 104 | @end_condition; | ||
| 105 | |||
| 106 | variables | ||
| 107 | ^^^^^^^^^ | ||
| 108 | |||
| 109 | You may set a configuration variable using the ``set`` keyword (or ``@set``) and use it instead of arguments. | ||
| 110 | |||
| 111 | :: | ||
| 112 | @set CMD "ls" | ||
| 113 | sp.disable_function.function("system").pos("0").value(CMD).allow(); | ||
| 114 | |||
| 91 | global | 115 | global |
| 92 | ^^^^^^ | 116 | ^^^^^^ |
| 93 | 117 | ||
