Date: Wednesday, December 1, 2021 @ 14:51:28
  Author: felixonmars
Revision: 1059417

archrelease: copy trunk to community-staging-x86_64

Added:
  uwsgi/repos/community-staging-x86_64/
  uwsgi/repos/community-staging-x86_64/PKGBUILD
    (from rev 1059403, uwsgi/trunk/PKGBUILD)
  uwsgi/repos/community-staging-x86_64/archlinux.ini
    (from rev 1059403, uwsgi/trunk/archlinux.ini)
  uwsgi/repos/community-staging-x86_64/emperor.ini
    (from rev 1059403, uwsgi/trunk/emperor.ini)
  uwsgi/repos/community-staging-x86_64/emperor.uwsgi.service
    (from rev 1059407, uwsgi/trunk/emperor.uwsgi.service)
  uwsgi/repos/community-staging-x86_64/emperor.uwsgi.socket
    (from rev 1059407, uwsgi/trunk/emperor.uwsgi.socket)
  uwsgi/repos/community-staging-x86_64/uwsgi-1.9.13-ruby2.0.patch
    (from rev 1059407, uwsgi/trunk/uwsgi-1.9.13-ruby2.0.patch)
  uwsgi/repos/community-staging-x86_64/uwsgi-2.0.19.1-php8.patch
    (from rev 1059407, uwsgi/trunk/uwsgi-2.0.19.1-php8.patch)
  uwsgi/repos/community-staging-x86_64/uwsgi.install
    (from rev 1059407, uwsgi/trunk/uwsgi.install)
  uwsgi/repos/community-staging-x86_64/uwsgi.logrotate
    (from rev 1059407, uwsgi/trunk/uwsgi.logrotate)
  uwsgi/repos/community-staging-x86_64/uwsgi.sysusers
    (from rev 1059407, uwsgi/trunk/uwsgi.sysusers)
  uwsgi/repos/community-staging-x86_64/uwsgi.tmpfiles
    (from rev 1059407, uwsgi/trunk/uwsgi.tmpfiles)
  uwsgi/repos/community-staging-x86_64/uwsgi_at.service
    (from rev 1059409, uwsgi/trunk/uwsgi_at.service)
  uwsgi/repos/community-staging-x86_64/uwsgi_at.socket
    (from rev 1059409, uwsgi/trunk/uwsgi_at.socket)

----------------------------+
 PKGBUILD                   |  240 ++++++++++++++++
 archlinux.ini              |    6 
 emperor.ini                |    2 
 emperor.uwsgi.service      |   15 +
 emperor.uwsgi.socket       |    9 
 uwsgi-1.9.13-ruby2.0.patch |   42 ++
 uwsgi-2.0.19.1-php8.patch  |  630 +++++++++++++++++++++++++++++++++++++++++++
 uwsgi.install              |    9 
 uwsgi.logrotate            |   10 
 uwsgi.sysusers             |    1 
 uwsgi.tmpfiles             |    1 
 uwsgi_at.service           |   15 +
 uwsgi_at.socket            |    9 
 13 files changed, 989 insertions(+)

Copied: uwsgi/repos/community-staging-x86_64/PKGBUILD (from rev 1059403, 
uwsgi/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD                           (rev 0)
+++ community-staging-x86_64/PKGBUILD   2021-12-01 14:51:28 UTC (rev 1059417)
@@ -0,0 +1,240 @@
+# Maintainer: Sven-Hendrik Haase <svenst...@gmail.com>
+# Maintainer: David Runge <dv...@archlinux.org>
+# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
+# Contributor: Valentin Hăloiu <vially.ichb+...@gmail.com>
+# Contributor: Angel Velasquez <an...@archlinux.org>
+# Contributor: Kevin Zuber <u...@knet.eu>
+# Contributor: Vsevolod Balashov <vsevo...@balashov.name>
+# Contributor: David Runge <d...@sleepmap.de>
+
+pkgbase=uwsgi
+pkgname=(
+  uwsgi
+  uwsgi-plugin-rack
+  uwsgi-plugin-psgi
+  uwsgi-plugin-cgi
+  uwsgi-plugin-python
+  uwsgi-plugin-pypy
+  uwsgi-plugin-php
+  uwsgi-plugin-php7
+  uwsgi-plugin-lua51
+  uwsgi-plugin-mono
+  uwsgi-plugin-webdav
+  uwsgi-plugin-zabbix
+  uwsgi-plugin-notfound
+)
+pkgver=2.0.20
+pkgrel=2
+pkgdesc="A full stack for building hosting services"
+arch=(x86_64)
+url="https://uwsgi-docs.readthedocs.io/en/latest/";
+license=(GPL2)
+makedepends=(
+  jansson
+  libxcrypt
+  libxml2
+  lua51
+  mono
+  openssl
+  pam
+  pcre
+  perl
+  php-embed
+  php7-embed
+  pypy
+  python
+  python-gevent
+  python-greenlet
+  ruby
+  systemd
+  util-linux
+  zlib
+)
+source=(
+  "https://projects.unbit.it/downloads/$pkgbase-$pkgver.tar.gz";
+  archlinux.ini
+  emperor.ini
+  emperor.uwsgi.service
+  emperor.uwsgi.socket
+  uwsgi_at.service
+  uwsgi_at.socket
+  uwsgi.logrotate
+  uwsgi.sysusers
+  uwsgi.tmpfiles
+  "${pkgbase}-1.9.13-ruby2.0.patch"
+)
+sha512sums=('22677a8ad1ea886e1a3a153f486474ce064a55e5b12515322345116980f699f4e2e73267f991c300d904284e06f265ea821e71ba3c97832b6f25705475b498ff'
+            
'51c474a5ae025c0fae17dec309bea29550a8ca39815b7495189394ae5ce30eb264f77a45f48f9f7529c59d907baf139cdf7c488d1b13fcb862cc7b9bdc268804'
+            
'd54c84838ddb2f389e115ebb81aa2583705c9e330f020e6583b496f9c271ed236b6820c2a065f2b55a79adbf13e262b9ff2428124a8044b8fa20ca29ca4930ac'
+            
'068ada6281fdeb504fed7e47dae2729d047ed810bb596e5268c1821ad275cd32110e801e93e7ba0ee2d92dbc39e1954180cf43d88d2990d42b802ceb54b50a9e'
+            
'592c85270f43b37e9c51aae126533830515b96fff9fcae969ee865fe173bd0550c7729530d5ff1e44ffee43cd5c78c96688ce091c677a4196379e24983c0180e'
+            
'29e51d3f441bd8af23c9378bca6cb38376bbbf31bb3b07f318a04ea5620cf25d35d7799ba4a8ecff12634dccd903eef27a6957b932370706e35549f8fbcd2455'
+            
'fb51a4d102a1bc7d9f7d4c4f310ee65076bcfbc94b47e2dafdf9b20e99a661c5f938185dcf698437d81409376f0276b966f09b13c8a29462c48612df43c3f3ef'
+            
'937878372aa1556f6ba62ad7148d1681288c94d6cff609368a9e861dd4d4524330006a08ae5993441f7d3101170e3a0a681a4c8b3c2c13b364b8b1f81cf25117'
+            
'9e9eab08199cf08810ec95b0697cd8817226986d1e3aeb54845c0140ea5887360580348f295060c0558fb2d6aaed26fec929ea36b28cfeaf2b3588ce40fec3df'
+            
'4def9dcd06cfc2c6ce554add9d9545a01f3bb2681f0a2a6fc4ba68f91011111803a955cc41b5e70832ca448b196109368fdf874e81b7ec0edee4b51f864e16f7'
+            
'162ca1be96282b32e8e6be919b6315bfd08954c491056958985bf99e7f5bdad3511665f059329d6cb6ef5d222f9aa11d4dc43c72e6a963ab941ada959fe8d964')
+b2sums=('b3bff3564206119dc25bd42f399ced724354452af3414bd8b1e1876c4915e8e4f651843c2fca3795ae195bd8f608013e0c8b41e0535e76e894a3fee9410a6c3b'
+        
'46f833e5d179d950bcbab51b539e6431959c9e3618c0d66b791a4b4d866b6195707704b394224b4fea97e1f65188b8b474499d70e5c2bb44da32c60447b80806'
+        
'835a1036422e9821cd52ffdf5a6053bdd59fc700d473600bda60b6730746f6c0750c30c85f4139d3ea81c6b6dd10d6849f9406decee3179861c51aca90da6161'
+        
'80aa3c4d3f0310f5029ac01690d2ba718d8c86fa49cd1b4f3fc1bd5ae9eadaed6562bf0a48a0fd611e92f100a8594e08fb4bae58e25765fc2eb648cdf1c60b35'
+        
'b6838c0c91811d4b677bf0f558134c69015708c308ef7080df328f12b0b0d58ae6cdebe277c29b6d11c20cfeb0847a4934e3a8924323e57ed661d6e9f6656a34'
+        
'6587282d48c53cff862951503c560fd3bfe2fbfe18d56af7b5fbf8299b2b99125101a866005ef1fbabe6af9640c200c5121949b3723865d8597a948ed3d650e8'
+        
'24c61581bb922f8065a6ea73164ca5d0b6c63ab4ca7c265660b2ec257b69ff9dd4b0349572ff20f54950961b4286c77da36c1d2778698c80943cfd6ed6531b10'
+        
'a8b7d003f66ed5c5b1b60d57c05339af3dcdcf346eab52760810086e17f6936dd29ed7fd26281657bc86ac6721c989cbfbaa8e81f97111c807bcd06baece3bf2'
+        
'82e03ea95995cfa78abc4d930bd0c250f22788d9ca4dc0921cfbb44a965c0f851cbcc7a855e36ec6e6aa5bf33fbd313b4fe68a2f1c4b7935c2b297be25895324'
+        
'9759827f7619358383bf0e68c955522c0054620f742f5122a59888fadfc0bc20bd587eab7a77bc73e8ee4d20cf8f02625c07f241462e8ab9c08f5af509daaef3'
+        
'0068763ca5a2f1b60782f53070cbff8cf930e1463d9199b156b02413026bcdb3d923bffcbba063a26d620b8e734bdbd26a4c22776532546ad8c8e5c0c73bd7d6')
+
+prepare() {
+  local _patch
+
+  cd "$pkgbase-$pkgver"
+
+  patch -Np1 -i "$srcdir"/uwsgi-1.9.13-ruby2.0.patch
+
+  # fix default lua pkgconfig name
+  sed -e 's/lua5.1/lua51/' -i plugins/lua/uwsgiplugin.py
+  # move ruby plugin to new location and fix its name
+  mv plugins/ruby{19,}
+  sed -e 's/ruby19/ruby/' -i plugins/ruby/uwsgiplugin.py
+  # duplicate the php plugin, so that we can modify it (and leave the php7
+  # version unmodified)
+  cp -av plugins/php{,7}
+  # remove the explicit lib version from the linking stage of the PHP plugin as
+  # we do not provide /usr/lib/libphp8.so
+  sed -e "s/ + php_version//" -i plugins/php/uwsgiplugin.py
+  # copy our custom build profile into place
+  cp -v ../archlinux.ini buildconf/
+}
+
+build() {
+  cd "$pkgbase-$pkgver"
+  python uwsgiconfig.py --verbose --build archlinux
+  # build php7 plugin separately and override php-config in use
+  UWSGICONFIG_PHPPATH='php-config7' \
+  python uwsgiconfig.py --verbose --plugin plugins/php7 archlinux php7
+}
+
+package_uwsgi() {
+  depends=('glibc' 'jansson' 'libcap.so' 'libcrypt.so' 'libpam.so' 'libxml2'
+  'libsystemd.so' 'libuuid.so' 'openssl' 'pcre' 'zlib')
+  backup=('etc/uwsgi/emperor.ini')
+  install=uwsgi.install
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 "${pkgbase}" -t "$pkgdir/usr/bin/"
+  install -vDm 644 ../uwsgi_at.service 
"$pkgdir"/usr/lib/systemd/system/uwsgi@.service
+  install -vDm 644 ../uwsgi_at.socket 
"$pkgdir"/usr/lib/systemd/system/uwsgi@.socket
+  install -vDm 644 ../emperor.uwsgi.service 
"$pkgdir"/usr/lib/systemd/system/emperor.uwsgi.service
+  install -vDm 644 ../emperor.uwsgi.socket 
"$pkgdir"/usr/lib/systemd/system/emperor.uwsgi.socket
+  install -vDm 644 ../emperor.ini -t "$pkgdir"/etc/uwsgi/
+  install -vDm 644 ../uwsgi.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/uwsgi.conf
+  install -vDm 644 ../uwsgi.logrotate "$pkgdir"/etc/logrotate.d/uwsgi
+  install -vDm 644 ../uwsgi.sysusers "$pkgdir"/usr/lib/sysusers.d/uwsgi.conf
+}
+
+package_uwsgi-plugin-cgi() {
+  pkgdesc+=" (CGI plugin)"
+  depends=('glibc' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 cgi_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-rack() {
+  depends=('glibc' 'ruby' 'uwsgi')
+  pkgdesc="Ruby rack plugin"
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 {rack,fiber,rbthreads}_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-psgi() {
+  pkgdesc+=" (Perl psgi plugin)"
+  depends=('glibc' 'perl' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 psgi_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-python() {
+  local site_packages=$(python -c "import site; 
print(site.getsitepackages()[0])")
+
+  pkgdesc+=" (Python plugin)"
+  depends=('glibc' 'python' 'python-gevent' 'python-greenlet' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 {asyncio,gevent,greenlet,python}_plugin.so -t 
"$pkgdir"/usr/lib/uwsgi/
+  install -vDm 644 uwsgidecorators.py -t "${pkgdir}${site_packages}"
+  python -m compileall "${pkgdir}${site_packages}"
+  python -O -m compileall "${pkgdir}${site_packages}"
+}
+
+package_uwsgi-plugin-pypy() {
+  pkgdesc+=" (PyPy plugin)"
+  depends=('glibc' 'pypy' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 pypy_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+  install -vDm 644 uwsgidecorators.py -t "$pkgdir"/opt/pypy/site-packages/
+  pypy -m compileall "$pkgdir"/opt/pypy/site-packages/
+  pypy -O -m compileall "$pkgdir"/opt/pypy/site-packages/
+}
+
+package_uwsgi-plugin-lua51() {
+  pkgdesc+=" (LUA plugin)"
+  depends=('glibc' 'lua51' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 lua_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-php() {
+  pkgdesc+=" (PHP plugin)"
+  depends=('glibc' 'php-embed' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 php_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-php7() {
+  pkgdesc+=" (PHP7 plugin)"
+  depends=('glibc' 'php7-embed' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 php7_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-mono() {
+  pkgdesc+=" (mono plugin)"
+  depends=('glibc' 'mono' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 plugins/mono/uwsgi.dll -t "$pkgdir"/usr/lib/mono/2.0/
+  install -vDm 755 mono_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-webdav() {
+  pkgdesc+=" (WebDav plugin)"
+  depends=('glibc' 'libxml2' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 webdav_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-zabbix() {
+  pkgdesc+=" (zabbix plugin)"
+  depends=('glibc' 'uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 zabbix_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}
+
+package_uwsgi-plugin-notfound() {
+  pkgdesc+=" (notfound plugin)"
+  depends=('uwsgi')
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 755 notfound_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
+}

Copied: uwsgi/repos/community-staging-x86_64/archlinux.ini (from rev 1059403, 
uwsgi/trunk/archlinux.ini)
===================================================================
--- community-staging-x86_64/archlinux.ini                              (rev 0)
+++ community-staging-x86_64/archlinux.ini      2021-12-01 14:51:28 UTC (rev 
1059417)
@@ -0,0 +1,6 @@
+[uwsgi]
+plugin_build_dir = .
+plugin_dir = /usr/lib/uwsgi
+plugins = asyncio, cgi, fiber, gevent, greenlet, php, lua, mono, notfound, 
psgi, pypy, python, rack, rbthreads, webdav, zabbix
+main_plugin = systemd_logger,pam
+inherit = base

Copied: uwsgi/repos/community-staging-x86_64/emperor.ini (from rev 1059403, 
uwsgi/trunk/emperor.ini)
===================================================================
--- community-staging-x86_64/emperor.ini                                (rev 0)
+++ community-staging-x86_64/emperor.ini        2021-12-01 14:51:28 UTC (rev 
1059417)
@@ -0,0 +1,2 @@
+[uwsgi]
+emperor = /etc/uwsgi/vassals

Copied: uwsgi/repos/community-staging-x86_64/emperor.uwsgi.service (from rev 
1059407, uwsgi/trunk/emperor.uwsgi.service)
===================================================================
--- community-staging-x86_64/emperor.uwsgi.service                              
(rev 0)
+++ community-staging-x86_64/emperor.uwsgi.service      2021-12-01 14:51:28 UTC 
(rev 1059417)
@@ -0,0 +1,15 @@
+[Unit]
+Description=uWSGI Emperor
+After=syslog.target
+
+[Service]
+ExecStart=/usr/bin/uwsgi --ini /etc/uwsgi/emperor.ini
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStop=/bin/kill -INT $MAINPID
+Restart=always
+Type=notify
+NotifyAccess=all
+KillSignal=SIGQUIT
+
+[Install]
+WantedBy=multi-user.target

Copied: uwsgi/repos/community-staging-x86_64/emperor.uwsgi.socket (from rev 
1059407, uwsgi/trunk/emperor.uwsgi.socket)
===================================================================
--- community-staging-x86_64/emperor.uwsgi.socket                               
(rev 0)
+++ community-staging-x86_64/emperor.uwsgi.socket       2021-12-01 14:51:28 UTC 
(rev 1059417)
@@ -0,0 +1,9 @@
+[Unit]
+Description=Socket for uWSGI Emperor
+
+[Socket]
+# Change this to your uwsgi application port or unix socket location
+ListenStream=/run/uwsgi/emperor.sock
+
+[Install]
+WantedBy=sockets.target

Copied: uwsgi/repos/community-staging-x86_64/uwsgi-1.9.13-ruby2.0.patch (from 
rev 1059407, uwsgi/trunk/uwsgi-1.9.13-ruby2.0.patch)
===================================================================
--- community-staging-x86_64/uwsgi-1.9.13-ruby2.0.patch                         
(rev 0)
+++ community-staging-x86_64/uwsgi-1.9.13-ruby2.0.patch 2021-12-01 14:51:28 UTC 
(rev 1059417)
@@ -0,0 +1,42 @@
+diff --git a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
+index 2375bc9..b908417 100644
+--- a/plugins/rack/uwsgiplugin.py
++++ b/plugins/rack/uwsgiplugin.py
+@@ -10,13 +10,14 @@ except:
+ rbconfig = 'Config'
+ 
+ version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
+-v = version.split('.')
+ 
+ GCC_LIST = ['rack_plugin', 'rack_api']
+ 
+-if (v[0] == '1' and v[1] == '9') or v[0] >= '2':
++if version >= '1.9':
+     CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print 
RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
+     CFLAGS.append('-DRUBY19')
++    if version >= '2.0':
++        CFLAGS.append('-DRUBY20')
+     CFLAGS.append('-Wno-unused-parameter')
+     rbconfig = 'RbConfig'      
+ else:
+diff --git a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
+index 4f35984..156018f 100644
+--- a/plugins/ruby19/uwsgiplugin.py
++++ b/plugins/ruby19/uwsgiplugin.py
+@@ -10,13 +10,14 @@ except:
+ rbconfig = 'Config'
+ 
+ version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
+-v = version.split('.')
+ 
+ GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api']
+ 
+-if v[0] == '1' and v[1] == '9':
++if version >= '1.9':
+     CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print 
RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
+     CFLAGS.append('-DRUBY19')
++    if version >= '2.0':
++        CFLAGS.append('-DRUBY20')
+     CFLAGS.append('-Wno-unused-parameter')
+     rbconfig = 'RbConfig'      
+ else:

Copied: uwsgi/repos/community-staging-x86_64/uwsgi-2.0.19.1-php8.patch (from 
rev 1059407, uwsgi/trunk/uwsgi-2.0.19.1-php8.patch)
===================================================================
--- community-staging-x86_64/uwsgi-2.0.19.1-php8.patch                          
(rev 0)
+++ community-staging-x86_64/uwsgi-2.0.19.1-php8.patch  2021-12-01 14:51:28 UTC 
(rev 1059417)
@@ -0,0 +1,630 @@
+diff --git c/plugins/php/common.h w/plugins/php/common.h
+index 9bf1c069..061b0b59 100644
+--- c/plugins/php/common.h
++++ w/plugins/php/common.h
+@@ -3,11 +3,6 @@
+ #include "php_main.h"
+ #include "php_variables.h"
+ 
+-#if (PHP_MAJOR_VERSION < 7)
+-#include "ext/standard/php_smart_str.h"
+-#else
+-#define UWSGI_PHP7
+-#endif
+ #include "ext/standard/info.h"
+ 
+ #include "ext/session/php_session.h"
+diff --git c/plugins/php/php_plugin.c w/plugins/php/php_plugin.c
+index 5cec7805..717d6317 100644
+--- c/plugins/php/php_plugin.c
++++ w/plugins/php/php_plugin.c
+@@ -4,6 +4,11 @@ extern struct uwsgi_server uwsgi;
+ 
+ static sapi_module_struct uwsgi_sapi_module;
+ 
++static int uwsgi_php_init(void);
++
++typedef size_t php_strlen_size;
++typedef zend_long php_long_size;
++
+ struct uwsgi_php {
+       struct uwsgi_string_list *allowed_docroot;
+       struct uwsgi_string_list *allowed_ext;
+@@ -17,7 +22,6 @@ struct uwsgi_php {
+       struct uwsgi_string_list *vars;
+       struct uwsgi_string_list *constants;
+       char *docroot;
+-      size_t docroot_len;
+       char *app;
+       char *app_qs;
+       char *fallback;
+@@ -32,7 +36,10 @@ struct uwsgi_php {
+       struct uwsgi_string_list *exec_after;
+ 
+       char *sapi_name;
++
++      int sapi_initialized;
+       HashTable user_config_cache;
++      struct uwsgi_dyn_dict *mountpoint;
+ } uphp;
+ 
+ void uwsgi_opt_php_ini(char *opt, char *value, void *foobar) {
+@@ -40,6 +47,10 @@ void uwsgi_opt_php_ini(char *opt, char *value, void 
*foobar) {
+         uwsgi_sapi_module.php_ini_ignore = 1;
+ }
+ 
++void uwsgi_opt_early_php(char *opt, char *value, void *foobar) {
++      uwsgi_php_init();
++}
++
+ struct uwsgi_option uwsgi_php_options[] = {
+ 
+         {"php-ini", required_argument, 0, "set php.ini path", 
uwsgi_opt_php_ini, NULL, 0},
+@@ -69,15 +80,15 @@ struct uwsgi_option uwsgi_php_options[] = {
+         {"php-exec-after", required_argument, 0, "run specified php code 
after the requested script", uwsgi_opt_add_string_list, &uphp.exec_after, 0},
+         {"php-exec-end", required_argument, 0, "run specified php code after 
the requested script", uwsgi_opt_add_string_list, &uphp.exec_after, 0},
+         {"php-sapi-name", required_argument, 0, "hack the sapi name (required 
for enabling zend opcode cache)", uwsgi_opt_set_str, &uphp.sapi_name, 0},
++
++        {"early-php", no_argument, 0, "initialize an early perl interpreter 
shared by all loaders", uwsgi_opt_early_php, NULL, UWSGI_OPT_IMMEDIATE},
++        {"early-php-sapi-name", required_argument, 0, "hack the sapi name 
(required for enabling zend opcode cache)", uwsgi_opt_set_str, &uphp.sapi_name, 
UWSGI_OPT_IMMEDIATE},
++        {"php-mount", required_argument, 0, "add a php mountpoint", 
uwsgi_opt_add_dyn_dict, &uphp.mountpoint, 0},
+       UWSGI_END_OF_OPTIONS
+ };
+ 
+ 
+-#ifdef UWSGI_PHP7
+-static size_t sapi_uwsgi_ub_write(const char *str, size_t str_length 
TSRMLS_DC)
+-#else
+-static int sapi_uwsgi_ub_write(const char *str, uint str_length TSRMLS_DC)
+-#endif
++static size_t sapi_uwsgi_ub_write(const char *str, size_t str_length)
+ {
+       struct wsgi_request *wsgi_req = (struct wsgi_request *) 
SG(server_context);
+ 
+@@ -89,7 +100,7 @@ static int sapi_uwsgi_ub_write(const char *str, uint 
str_length TSRMLS_DC)
+       return str_length;
+ }
+ 
+-static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers 
TSRMLS_DC)
++static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers)
+ {
+       sapi_header_struct *h;
+       zend_llist_position pos;
+@@ -123,11 +134,7 @@ static int sapi_uwsgi_send_headers(sapi_headers_struct 
*sapi_headers TSRMLS_DC)
+       return SAPI_HEADER_SENT_SUCCESSFULLY;
+ }
+ 
+-#ifdef UWSGI_PHP7
+-static size_t sapi_uwsgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
+-#else
+-static int sapi_uwsgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+-#endif
++static size_t sapi_uwsgi_read_post(char *buffer, size_t count_bytes)
+ {
+       uint read_bytes = 0;
+       
+@@ -151,7 +158,7 @@ static int sapi_uwsgi_read_post(char *buffer, uint 
count_bytes TSRMLS_DC)
+ }
+ 
+ 
+-static char *sapi_uwsgi_read_cookies(TSRMLS_D)
++static char *sapi_uwsgi_read_cookies()
+ {
+       uint16_t len = 0;
+       struct wsgi_request *wsgi_req = (struct wsgi_request *) 
SG(server_context);
+@@ -164,55 +171,55 @@ static char *sapi_uwsgi_read_cookies(TSRMLS_D)
+       return NULL;
+ }
+ 
+-static void sapi_uwsgi_register_variables(zval *track_vars_array TSRMLS_DC)
++static void sapi_uwsgi_register_variables(zval *track_vars_array)
+ {
+       int i;
+       struct wsgi_request *wsgi_req = (struct wsgi_request *) 
SG(server_context);
+-      php_import_environment_variables(track_vars_array TSRMLS_CC);
++      php_import_environment_variables(track_vars_array);
+ 
+       if (uphp.server_software) {
+               if (!uphp.server_software_len) uphp.server_software_len = 
strlen(uphp.server_software);
+-              php_register_variable_safe("SERVER_SOFTWARE", 
uphp.server_software, uphp.server_software_len, track_vars_array TSRMLS_CC);
++              php_register_variable_safe("SERVER_SOFTWARE", 
uphp.server_software, uphp.server_software_len, track_vars_array);
+       }
+       else {
+-              php_register_variable_safe("SERVER_SOFTWARE", "uWSGI", 5, 
track_vars_array TSRMLS_CC);
++              php_register_variable_safe("SERVER_SOFTWARE", "uWSGI", 5, 
track_vars_array);
+       }
+ 
+       for (i = 0; i < wsgi_req->var_cnt; i += 2) {
+               php_register_variable_safe( 
estrndup(wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len),
+                       wsgi_req->hvec[i + 1].iov_base, wsgi_req->hvec[i + 
1].iov_len,
+-                      track_vars_array TSRMLS_CC);
++                      track_vars_array);
+         }
+ 
+-      php_register_variable_safe("PATH_INFO", wsgi_req->path_info, 
wsgi_req->path_info_len, track_vars_array TSRMLS_CC);
++      php_register_variable_safe("PATH_INFO", wsgi_req->path_info, 
wsgi_req->path_info_len, track_vars_array);
+       if (wsgi_req->query_string_len > 0) {
+-              php_register_variable_safe("QUERY_STRING", 
wsgi_req->query_string, wsgi_req->query_string_len, track_vars_array TSRMLS_CC);
++              php_register_variable_safe("QUERY_STRING", 
wsgi_req->query_string, wsgi_req->query_string_len, track_vars_array);
+       }
+ 
+-      php_register_variable_safe("SCRIPT_NAME", wsgi_req->script_name, 
wsgi_req->script_name_len, track_vars_array TSRMLS_CC);
+-      php_register_variable_safe("SCRIPT_FILENAME", wsgi_req->file, 
wsgi_req->file_len, track_vars_array TSRMLS_CC);
++      php_register_variable_safe("SCRIPT_NAME", wsgi_req->script_name, 
wsgi_req->script_name_len, track_vars_array);
++      php_register_variable_safe("SCRIPT_FILENAME", wsgi_req->file, 
wsgi_req->file_len, track_vars_array);
+ 
+-      php_register_variable_safe("DOCUMENT_ROOT", wsgi_req->document_root, 
wsgi_req->document_root_len, track_vars_array TSRMLS_CC);
++      php_register_variable_safe("DOCUMENT_ROOT", wsgi_req->document_root, 
wsgi_req->document_root_len, track_vars_array);
+ 
+       if (wsgi_req->path_info_len) {
+               char *path_translated = ecalloc(1, wsgi_req->file_len + 
wsgi_req->path_info_len + 1);
+ 
+               memcpy(path_translated, wsgi_req->file, wsgi_req->file_len);
+               memcpy(path_translated + wsgi_req->file_len, 
wsgi_req->path_info, wsgi_req->path_info_len);
+-              php_register_variable_safe("PATH_TRANSLATED", path_translated, 
wsgi_req->file_len + wsgi_req->path_info_len , track_vars_array TSRMLS_CC);
++              php_register_variable_safe("PATH_TRANSLATED", path_translated, 
wsgi_req->file_len + wsgi_req->path_info_len , track_vars_array);
+       }
+       else {
+-              php_register_variable_safe("PATH_TRANSLATED", "", 0, 
track_vars_array TSRMLS_CC);
++              php_register_variable_safe("PATH_TRANSLATED", "", 0, 
track_vars_array);
+       }
+ 
+-      php_register_variable_safe("PHP_SELF", wsgi_req->script_name, 
wsgi_req->script_name_len, track_vars_array TSRMLS_CC);
++      php_register_variable_safe("PHP_SELF", wsgi_req->script_name, 
wsgi_req->script_name_len, track_vars_array);
+ 
+       struct uwsgi_string_list *usl = uphp.vars;
+       while(usl) {
+               char *equal = strchr(usl->value, '=');
+               if (equal) {
+                       php_register_variable_safe( estrndup(usl->value, 
equal-usl->value),
+-                              equal+1, strlen(equal+1), track_vars_array 
TSRMLS_CC);
++                              equal+1, strlen(equal+1), track_vars_array);
+               }
+               usl = usl->next;
+       }
+@@ -253,10 +260,7 @@ PHP_MINIT_FUNCTION(uwsgi_php_minit) {
+                       char *name = usl->value;
+                       char *strval = equal + 1;
+                       equal = NULL;
+-#ifndef UWSGI_PHP7
+-                      name_len = name_len + 1;
+-#endif
+-                      zend_register_string_constant(name, name_len, strval, 
CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);
++                      zend_register_string_constant(name, name_len, strval, 
CONST_CS | CONST_PERSISTENT, module_number);
+               }
+               usl = usl->next;
+       }
+@@ -264,11 +268,7 @@ PHP_MINIT_FUNCTION(uwsgi_php_minit) {
+ }
+ 
+ PHP_FUNCTION(uwsgi_version) {
+-#ifdef UWSGI_PHP7
+       RETURN_STRING(UWSGI_VERSION);
+-#else
+-      RETURN_STRING(UWSGI_VERSION, 1);
+-#endif
+ }
+ 
+ PHP_FUNCTION(uwsgi_worker_id) {
+@@ -285,11 +285,11 @@ PHP_FUNCTION(uwsgi_masterpid) {
+ PHP_FUNCTION(uwsgi_cache_exists) {
+ 
+         char *key = NULL;
+-        int keylen = 0;
++        php_strlen_size keylen = 0;
+         char *cache = NULL;
+-        int cachelen = 0;
++        php_strlen_size cachelen = 0;
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, 
&keylen, &cache, &cachelen) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, 
&cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -303,9 +303,9 @@ PHP_FUNCTION(uwsgi_cache_exists) {
+ PHP_FUNCTION(uwsgi_cache_clear) {
+ 
+         char *cache = NULL;
+-        int cachelen = 0;
++        php_strlen_size cachelen = 0;
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &cache, 
&cachelen) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &cache, &cachelen) 
== FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -318,13 +318,13 @@ PHP_FUNCTION(uwsgi_cache_clear) {
+ 
+ 
+ PHP_FUNCTION(uwsgi_cache_del) {
+-      
++
+       char *key = NULL;
+-        int keylen = 0;
++      php_strlen_size keylen = 0;
+       char *cache = NULL;
+-      int cachelen = 0;
++      php_strlen_size cachelen = 0;
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, 
&keylen, &cache, &cachelen) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, 
&cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -338,15 +338,15 @@ PHP_FUNCTION(uwsgi_cache_del) {
+ PHP_FUNCTION(uwsgi_cache_get) {
+ 
+       char *key = NULL;
+-      int keylen = 0;
++      php_strlen_size keylen = 0;
+       char *cache = NULL;
+-      int cachelen = 0;
++      php_strlen_size cachelen = 0;
+       uint64_t valsize;
+ 
+       if (!uwsgi.caches)
+               RETURN_NULL();
+ 
+-      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, 
&keylen, &cache, &cachelen) == FAILURE) {
++      if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, 
&cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -354,28 +354,24 @@ PHP_FUNCTION(uwsgi_cache_get) {
+       if (value) {
+               char *ret = estrndup(value, valsize);
+               free(value);
+-#ifdef UWSGI_PHP7
+               RETURN_STRING(ret);
+-#else
+-              RETURN_STRING(ret, 0);
+-#endif
+       }
+       RETURN_NULL();
+ }
+ 
+ PHP_FUNCTION(uwsgi_cache_set) {
+       char *key = NULL;       
+-      int keylen;
++      php_strlen_size keylen = 0;
+       char *value = NULL;
+-      int vallen;
+-      uint64_t expires = 0;
++      php_strlen_size vallen = 0;
++      php_long_size expires = 0;
+       char *cache = NULL;
+-      int cachelen = 0;
++      php_strlen_size cachelen = 0;
+ 
+       if (!uwsgi.caches)
+               RETURN_NULL();
+ 
+-      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, 
&keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
++      if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", &key, &keylen, 
&value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -388,17 +384,17 @@ PHP_FUNCTION(uwsgi_cache_set) {
+ 
+ PHP_FUNCTION(uwsgi_cache_update) {
+         char *key = NULL;
+-        int keylen;
++        php_strlen_size keylen = 0;
+         char *value = NULL;
+-        int vallen;
+-        uint64_t expires = 0;
++        php_strlen_size vallen = 0;
++        php_long_size expires = 0;
+         char *cache = NULL;
+-        int cachelen = 0;
++        php_strlen_size cachelen = 0;
+ 
+         if (!uwsgi.caches)
+                 RETURN_NULL();
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, 
&keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", &key, &keylen, 
&value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -423,7 +419,7 @@ PHP_FUNCTION(uwsgi_rpc) {
+         uint16_t argvs[256];
+       uint64_t size = 0;
+ 
+-      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &varargs, 
&num_args) == FAILURE) {
++      if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &varargs, &num_args) == 
FAILURE) {
+               RETURN_NULL();
+       }
+ 
+@@ -462,11 +458,7 @@ PHP_FUNCTION(uwsgi_rpc) {
+               // here we do not free varargs for performance reasons
+               char *ret = estrndup(response, size);
+               free(response);
+-#ifdef UWSGI_PHP7
+               RETURN_STRING(ret);
+-#else
+-              RETURN_STRING(ret, 0);
+-#endif
+         }
+ 
+ clear:
+@@ -481,7 +473,7 @@ PHP_FUNCTION(uwsgi_setprocname) {
+       char *name;
+       int name_len;
+ 
+-      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, 
&name_len) == FAILURE) {
++      if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == 
FAILURE) {
+               RETURN_NULL();
+       }
+ 
+@@ -495,7 +487,7 @@ PHP_FUNCTION(uwsgi_signal) {
+       long long_signum;
+       uint8_t signum = 0;
+ 
+-        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", 
&long_signum) == FAILURE) {
++        if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &long_signum) == 
FAILURE) {
+                 RETURN_NULL();
+         }
+ 
+@@ -629,10 +621,12 @@ static int php_uwsgi_startup(sapi_module_struct 
*sapi_module)
+       }
+ }
+ 
+-#if ((PHP_MAJOR_VERSION >= 7) && (PHP_MINOR_VERSION >= 1))
++#if (PHP_MAJOR_VERSION >= 8)
++static void sapi_uwsgi_log_message(const char *message, int syslog_type_int) {
++#elif ((PHP_MAJOR_VERSION == 7) && (PHP_MINOR_VERSION >= 1))
+ static void sapi_uwsgi_log_message(char *message, int syslog_type_int) {
+ #else
+-static void sapi_uwsgi_log_message(char *message TSRMLS_DC) {
++static void sapi_uwsgi_log_message(char *message) {
+ #endif
+       uwsgi_log("%s\n", message);
+ }
+@@ -668,16 +662,32 @@ static sapi_module_struct uwsgi_sapi_module = {
+       STANDARD_SAPI_MODULE_PROPERTIES
+ };
+ 
+-int uwsgi_php_init(void) {
++static void uwsgi_php_init_mount(struct uwsgi_dyn_dict *mount_dict) {
++      struct uwsgi_dyn_dict *udd = mount_dict;
++      while (udd) {
++              char *orig_dest = udd->value;
++              udd->value = uwsgi_expand_path(udd->value, udd->vallen, NULL);
++              udd->vallen = strlen(udd->value);
++              if (!udd->value) {
++                      uwsgi_log("Unable to expand php mountpoint to %s\n", 
orig_dest);
++                      exit(1);
++              }
++              udd = udd->next;
++      }
++}
++
++static int uwsgi_php_init(void) {
+ 
+       struct uwsgi_string_list *pset = uphp.set;
+       struct uwsgi_string_list *append_config = uphp.append_config;
+ 
++      if (!uphp.sapi_initialized) {
+ #ifdef ZTS
+-        tsrm_startup(1, 1, 0, NULL);
++              tsrm_startup(1, 1, 0, NULL);
+ #endif
+-
+-      sapi_startup(&uwsgi_sapi_module);
++              sapi_startup(&uwsgi_sapi_module);
++              uphp.sapi_initialized = 1;
++      }
+ 
+       // applying custom options
+       while(append_config) {
+@@ -705,13 +715,14 @@ int uwsgi_php_init(void) {
+                       uwsgi_log("unable to set php docroot to %s\n", 
orig_docroot);
+                       exit(1);
+               }
+-              uwsgi_log("PHP document root set to %s\n", uphp.docroot);
+-              uphp.docroot_len = strlen(uphp.docroot);
+       }
+ 
++      uwsgi_php_init_mount(uphp.mountpoint);
++
+       if (uphp.sapi_name) {
+               uwsgi_sapi_module.name = uphp.sapi_name;
+       }
++
+       uwsgi_sapi_module.startup(&uwsgi_sapi_module);
+       uwsgi_log("PHP %s initialized\n", PHP_VERSION);
+ 
+@@ -776,6 +787,33 @@ int uwsgi_php_walk(struct wsgi_request *wsgi_req, char 
*full_path, char *docroot
+ 
+ }
+ 
++static char *uwsgi_php_get_mount(char *path_info, uint16_t path_info_len, 
struct uwsgi_dyn_dict *mount_dict, int *discard_base) {
++      int best_found = 0;
++      struct uwsgi_dyn_dict *udd = mount_dict, *chosen = NULL;
++
++      while (udd) {
++              if (mount_dict->vallen) {
++                      if (!uwsgi_starts_with(path_info, path_info_len, 
udd->key, udd->keylen)) {
++                              if (udd->keylen > best_found) {
++                                      best_found = udd->keylen;
++                                      chosen = udd;
++                              }
++                      }
++              }
++              udd = udd->next;
++      }
++
++      if (chosen) {
++              *discard_base = chosen->keylen;
++              if (chosen->key[chosen->keylen-1] == '/') {
++                      *discard_base = *discard_base - 1;
++              }
++              return chosen->value;
++      } else {
++              return NULL;
++      }
++}
++
+ 
+ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
+ 
+@@ -788,10 +826,6 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
+ 
+       zend_file_handle file_handle;
+ 
+-#ifdef ZTS
+-      TSRMLS_FETCH();
+-#endif
+-
+       SG(server_context) = (void *) wsgi_req;
+ 
+       if (uwsgi_parse_vars(wsgi_req)) {
+@@ -801,7 +835,15 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
+       char *orig_path_info = wsgi_req->path_info;
+       uint16_t orig_path_info_len = wsgi_req->path_info_len;
+ 
+-      if (uphp.docroot) {
++      int discard_base = 0;
++
++      char *mount_docroot = uwsgi_php_get_mount(wsgi_req->path_info, 
wsgi_req->path_info_len, uphp.mountpoint, &discard_base);
++
++      if (mount_docroot) {
++              wsgi_req->document_root = mount_docroot;
++              wsgi_req->path_info = wsgi_req->path_info+discard_base;
++              wsgi_req->path_info_len = wsgi_req->path_info_len-discard_base;
++      } else if (uphp.docroot) {
+               wsgi_req->document_root = uphp.docroot;
+       }
+       // fallback to cwd
+@@ -833,7 +875,8 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
+                 }
+ #endif
+ 
+-              strcpy(real_filename, uphp.app);        
++              strncpy(real_filename, uphp.app, PATH_MAX);
++              real_filename[PATH_MAX-1] = '\0';
+               if (wsgi_req->path_info_len == 1 && wsgi_req->path_info[0] == 
'/') {
+                       goto appready;
+               }
+@@ -926,7 +969,6 @@ oldstyle:
+       free(filename);
+       real_filename_len = strlen(real_filename);
+ 
+-      // first check for valid doc roots
+       if (uphp.allowed_docroot) {
+               struct uwsgi_string_list *usl = uphp.allowed_docroot;
+               while(usl) {
+@@ -939,16 +981,6 @@ oldstyle:
+               uwsgi_log("PHP security error: %s is not under an allowed 
docroot\n", real_filename);
+               return -1;
+       }
+-      // then for default docroot (if any)
+-      else if (uphp.docroot)
+-      {
+-              if (!uwsgi_starts_with(real_filename, real_filename_len, 
uphp.docroot, uphp.docroot_len)) {
+-                      goto secure;
+-              }
+-              uwsgi_403(wsgi_req);
+-              uwsgi_log("PHP security error: %s is not under the default 
docroot\n", real_filename);
+-              return -1;
+-      }
+ 
+ secure:
+ 
+@@ -1065,7 +1097,7 @@ secure3:
+         file_handle.type = ZEND_HANDLE_FILENAME;
+         file_handle.filename = real_filename;
+ 
+-        if (php_request_startup(TSRMLS_C) == FAILURE) {
++        if (php_request_startup() == FAILURE) {
+               uwsgi_500(wsgi_req);
+                 return -1;
+         }
+@@ -1073,13 +1105,13 @@ secure3:
+       struct uwsgi_string_list *usl=NULL;
+ 
+       uwsgi_foreach(usl, uphp.exec_before) {
+-              if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec 
before", 1 TSRMLS_CC) == FAILURE) goto end;
++              if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec 
before", 1) == FAILURE) goto end;
+       }
+ 
+-        php_execute_script(&file_handle TSRMLS_CC);
++        php_execute_script(&file_handle);
+ 
+       uwsgi_foreach(usl, uphp.exec_after) {
+-              if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec 
after", 1 TSRMLS_CC) == FAILURE) goto end;
++              if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec 
after", 1) == FAILURE) goto end;
+       }
+ 
+ end:
+diff --git c/plugins/php/session.c w/plugins/php/session.c
+index 2312b6b9..cce06985 100644
+--- c/plugins/php/session.c
++++ w/plugins/php/session.c
+@@ -12,34 +12,20 @@ PS_CLOSE_FUNC(uwsgi) {
+ PS_READ_FUNC(uwsgi) {
+       char *cache = PS_GET_MOD_DATA();
+       uint64_t valsize = 0;
+-#ifdef UWSGI_PHP7
+       char *value = uwsgi_cache_magic_get(key->val, key->len , &valsize, 
NULL, cache);
+-#else
+-      char *value = uwsgi_cache_magic_get((char *)key, strlen((char *)key), 
&valsize, NULL, cache);
+-#endif
+-        if (!value) return FAILURE;
+-#ifdef UWSGI_PHP7
++      if (!value) {
++              *val = STR_EMPTY_ALLOC();
++              return SUCCESS;
++      }
+       *val = zend_string_init(value, valsize, 0);
+-#else
+-      char *new_val = emalloc(valsize);
+-      memcpy(new_val, value, valsize);
+-      free(value);
+-      *val = new_val;
+-      *vallen = valsize;
+-#endif
+       return SUCCESS;
+       
+ }
+ 
+ PS_WRITE_FUNC(uwsgi) {
+       char *cache = PS_GET_MOD_DATA();
+-#ifdef UWSGI_PHP7
+       if (val->len == 0) return SUCCESS;
+       if (!uwsgi_cache_magic_set(key->val, key->len, val->val, val->len, 0, 
UWSGI_CACHE_FLAG_UPDATE, cache)) {
+-#else
+-      if (vallen == 0) return SUCCESS;
+-      if (!uwsgi_cache_magic_set((char *)key, strlen(key), (char *)val, 
vallen, 0, UWSGI_CACHE_FLAG_UPDATE, cache)) {
+-#endif
+               return SUCCESS; 
+       }
+       return FAILURE;
+@@ -47,11 +33,10 @@ PS_WRITE_FUNC(uwsgi) {
+ 
+ PS_DESTROY_FUNC(uwsgi) {
+       char *cache = PS_GET_MOD_DATA();
+-#ifdef UWSGI_PHP7
++      if (!uwsgi_cache_magic_exists(key->val, key->len, cache))
++              return SUCCESS;
++
+       if (!uwsgi_cache_magic_del(key->val, key->len, cache)) {
+-#else
+-      if (!uwsgi_cache_magic_del((char *)key, strlen(key), cache)) {
+-#endif
+               return SUCCESS;
+       }
+       return FAILURE;
+diff --git c/plugins/php/uwsgiplugin.py w/plugins/php/uwsgiplugin.py
+index d930c44e..8657eb70 100644
+--- c/plugins/php/uwsgiplugin.py
++++ w/plugins/php/uwsgiplugin.py
+@@ -1,6 +1,6 @@
+ import os
+ 
+-NAME='php'
++NAME = 'php'
+ 
+ ld_run_path = None
+ PHPPATH = 'php-config'

Copied: uwsgi/repos/community-staging-x86_64/uwsgi.install (from rev 1059407, 
uwsgi/trunk/uwsgi.install)
===================================================================
--- community-staging-x86_64/uwsgi.install                              (rev 0)
+++ community-staging-x86_64/uwsgi.install      2021-12-01 14:51:28 UTC (rev 
1059417)
@@ -0,0 +1,9 @@
+post_update(){
+    echo "To use uwsgi@.socket and uwsgi@.service:"
+    echo "\tAll you need to do is put the name of your .ini file after the @ 
sign"
+    echo "\tYou can use either the .socket or .service, but if you use the 
.socket"
+    echo "\tuwsgi@<sameinifile>.service won't be started until the first time 
your http"
+    echo "\tserver touches the socket. You will also not need to specify the 
socket in"
+    echo "\tthe .ini file or in the .service file.  Systemd will handle 
listening to"
+    echo "\tthe socket for you."
+}

Copied: uwsgi/repos/community-staging-x86_64/uwsgi.logrotate (from rev 1059407, 
uwsgi/trunk/uwsgi.logrotate)
===================================================================
--- community-staging-x86_64/uwsgi.logrotate                            (rev 0)
+++ community-staging-x86_64/uwsgi.logrotate    2021-12-01 14:51:28 UTC (rev 
1059417)
@@ -0,0 +1,10 @@
+/var/log/uwsgi/*.log /var/log/uwsgi/*/*.log {
+  copytruncate
+  daily
+  rotate 7
+  compress
+  delaycompress
+  missingok
+  notifempty
+  su root uwsgi
+}

Copied: uwsgi/repos/community-staging-x86_64/uwsgi.sysusers (from rev 1059407, 
uwsgi/trunk/uwsgi.sysusers)
===================================================================
--- community-staging-x86_64/uwsgi.sysusers                             (rev 0)
+++ community-staging-x86_64/uwsgi.sysusers     2021-12-01 14:51:28 UTC (rev 
1059417)
@@ -0,0 +1 @@
+g uwsgi 53 -

Copied: uwsgi/repos/community-staging-x86_64/uwsgi.tmpfiles (from rev 1059407, 
uwsgi/trunk/uwsgi.tmpfiles)
===================================================================
--- community-staging-x86_64/uwsgi.tmpfiles                             (rev 0)
+++ community-staging-x86_64/uwsgi.tmpfiles     2021-12-01 14:51:28 UTC (rev 
1059417)
@@ -0,0 +1 @@
+d /run/uwsgi 0775 root http - - 

Copied: uwsgi/repos/community-staging-x86_64/uwsgi_at.service (from rev 
1059409, uwsgi/trunk/uwsgi_at.service)
===================================================================
--- community-staging-x86_64/uwsgi_at.service                           (rev 0)
+++ community-staging-x86_64/uwsgi_at.service   2021-12-01 14:51:28 UTC (rev 
1059417)
@@ -0,0 +1,15 @@
+[Unit]
+Description=uWSGI service unit
+After=syslog.target
+
+[Service]
+ExecStart=/usr/bin/uwsgi --ini /etc/uwsgi/%I.ini
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStop=/bin/kill -INT $MAINPID
+Restart=always
+Type=notify
+NotifyAccess=all
+KillSignal=SIGQUIT
+
+[Install]
+WantedBy=multi-user.target

Copied: uwsgi/repos/community-staging-x86_64/uwsgi_at.socket (from rev 1059409, 
uwsgi/trunk/uwsgi_at.socket)
===================================================================
--- community-staging-x86_64/uwsgi_at.socket                            (rev 0)
+++ community-staging-x86_64/uwsgi_at.socket    2021-12-01 14:51:28 UTC (rev 
1059417)
@@ -0,0 +1,9 @@
+[Unit]
+Description=Socket for uWSGI %I
+
+[Socket]
+# Change this to your uwsgi application port or unix socket location
+ListenStream=/run/uwsgi/%I.sock
+
+[Install]
+WantedBy=sockets.target

Reply via email to