You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[`header_register_callback`](https://www.php.net/manual/en/function.header-register-callback.php) with an additional `replace` keyword argument to register multiple callbacks
59
+
-[`setcookie`](https://www.php.net/manual/en/function.setcookie.php) with an additional `samesite` keyword argument
60
+
-[`setrawcookie`](https://www.php.net/manual/en/function.setrawcookie.php) also with an additional `samesite` keyword argument
61
+
-[`register_shutdown_function`](https://www.php.net/manual/en/function.register-shutdown-function) with reversed callback execution order (LIFO)
62
+
-[`opcache_compile_file`](https://www.php.net/manual/en/function.opcache-compile-file) which raises Exceptions instead of returning `False` when compilation fails
- is looked for in these locations (no merging takes place, the first file wins):
64
71
- the path given by the `-c` or `--config` cli argument
65
72
- the path pointed to by the `PYHPCONFIG` environment variable
66
73
-`~/.config/pyhp.toml`
67
74
-`/etc/pyhp.toml`
68
-
- raises a `RuntimeError` if not found
75
+
- raises a [`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError) if not found
69
76
70
77
### Backends
71
78
@@ -90,11 +97,74 @@ A script is called either by the configuration of the web server or a shebang an
90
97
1. execute `debian/build_deb.sh` in the root directory of the project.
91
98
2. Done! You can now install the debian package with `sudo dpkg -i python3-pyhp-core_{version}-1_all.deb`
92
99
93
-
- Optional: check if the recommended packages `python3-toml` and `python3-werkzeug` are installed to use the CLI commands
100
+
- Optional: check if the recommended packages [`python3-toml`](https://packages.debian.org/search?keywords=python3-toml) and [`python3-werkzeug`](https://packages.debian.org/search?keywords=python3-werkzeug) are installed to use the CLI commands
94
101
- Important: `pyhp-backend clear` will be executed on uninstall or upgrade if the backend is a cache, remember this when using paths containing `~` for the file cache
95
102
96
103
### Manually
97
104
1. install the *pyhp-core* python package
98
105
2. set the `PYHPCONFIG` environ variable or copy *pyhp.toml* to one of the config file locations
99
106
3. Done! You can now use the `pyhp-*` commands
100
107
108
+
## WSGI Example
109
+
110
+
### Manually
111
+
112
+
```python
113
+
import sys
114
+
import re
115
+
import tempfile
116
+
from wsgiref.simple_server import make_server
117
+
from pyhp.compiler import parsers, util, generic
118
+
from pyhp.backends.files import Directory
119
+
from pyhp.wsgi.apps import ConcurrentWSGIApp
120
+
from pyhp.wsgi.proxys import LocalStackProxy
121
+
from pyhp.wsgi.interfaces.php import PHPWSGIInterfaceFactory
122
+
from pyhp.wsgi.interfaces.phputils import UploadStreamFactory
0 commit comments