Skip to content

Commit 9135e0f

Browse files
committed
only run afterinstall frankenphp group stuff on debian
1 parent d78d294 commit 9135e0f

1 file changed

Lines changed: 23 additions & 19 deletions

File tree

src/package/cli.php

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ public function getFpmConfig(): array
132132
public function getFpmExtraArgs(): array
133133
{
134134
$binarySuffix = getBinarySuffix();
135-
$varLibDir = getVarLibdir();
136135

137136
$beforeInstallScript = <<<BASH
138137
#!/bin/sh
@@ -146,22 +145,6 @@ public function getFpmExtraArgs(): array
146145
if [ ! -e /usr/bin/php ]; then
147146
ln -sf /usr/bin/php{$binarySuffix} /usr/bin/php
148147
fi
149-
BASH;
150-
$debAfterInstallScript = <<<BASH
151-
#!/bin/sh
152-
set -e
153-
if [ ! -e /usr/bin/php ]; then
154-
ln -sf /usr/bin/php{$binarySuffix} /usr/bin/php
155-
fi
156-
157-
if getent group frankenphp > /dev/null 2>&1; then
158-
chgrp frankenphp "{$varLibDir}/session"
159-
chmod 770 "{$varLibDir}/session"
160-
chgrp frankenphp "{$varLibDir}/wsdlcache"
161-
chmod 770 "{$varLibDir}/wsdlcache"
162-
chgrp frankenphp "{$varLibDir}/opcache"
163-
chmod 770 "{$varLibDir}/opcache"
164-
fi
165148
BASH;
166149
$afterRemoveScript = <<<BASH
167150
#!/bin/sh
@@ -172,11 +155,9 @@ public function getFpmExtraArgs(): array
172155

173156
file_put_contents(TEMP_DIR . '/cli-before-install.sh', $beforeInstallScript);
174157
file_put_contents(TEMP_DIR . '/cli-after-install.sh', $afterInstallScript);
175-
file_put_contents(TEMP_DIR . '/cli-deb-after-install.sh', $debAfterInstallScript);
176158
file_put_contents(TEMP_DIR . '/cli-after-remove.sh', $afterRemoveScript);
177159
chmod(TEMP_DIR . '/cli-before-install.sh', 0755);
178160
chmod(TEMP_DIR . '/cli-after-install.sh', 0755);
179-
chmod(TEMP_DIR . '/cli-deb-after-install.sh', 0755);
180161
chmod(TEMP_DIR . '/cli-after-remove.sh', 0755);
181162

182163
return [
@@ -188,8 +169,31 @@ public function getFpmExtraArgs(): array
188169

189170
public function getDebExtraArgs(): array
190171
{
172+
$binarySuffix = getBinarySuffix();
173+
$varLibDir = getVarLibdir();
174+
191175
$this->getFpmExtraArgs();
192176

177+
$debAfterInstallScript = <<<BASH
178+
#!/bin/sh
179+
set -e
180+
if [ ! -e /usr/bin/php ]; then
181+
ln -sf /usr/bin/php{$binarySuffix} /usr/bin/php
182+
fi
183+
184+
if getent group frankenphp > /dev/null 2>&1; then
185+
chgrp frankenphp "{$varLibDir}/session"
186+
chmod 770 "{$varLibDir}/session"
187+
chgrp frankenphp "{$varLibDir}/wsdlcache"
188+
chmod 770 "{$varLibDir}/wsdlcache"
189+
chgrp frankenphp "{$varLibDir}/opcache"
190+
chmod 770 "{$varLibDir}/opcache"
191+
fi
192+
BASH;
193+
194+
file_put_contents(TEMP_DIR . '/cli-deb-after-install.sh', $debAfterInstallScript);
195+
chmod(TEMP_DIR . '/cli-deb-after-install.sh', 0755);
196+
193197
return [
194198
'--before-install', TEMP_DIR . '/cli-before-install.sh',
195199
'--after-install', TEMP_DIR . '/cli-deb-after-install.sh',

0 commit comments

Comments
 (0)