cod consolidation and style updates

This commit is contained in:
Mark Gregory
2026-10-15 09:15:38 +01:00
parent 3364c8ac23
commit 84695ac372
+15 -1
View File
@@ -50,7 +50,21 @@ task('artisan:clear', function (): void {
task('services:restart', function (): void {
run('sudo -n nginx -t');
run('sudo -n systemctl reload nginx');
run('sudo -n systemctl restart php8.3-fpm');
$phpFpm = run(<<<'BASH'
if systemctl list-unit-files php8.5-fpm.service --no-legend | grep -q '^php8.5-fpm.service'; then
echo php8.5-fpm
elif systemctl list-unit-files php8.3-fpm.service --no-legend | grep -q '^php8.3-fpm.service'; then
echo php8.3-fpm
else
exit 1
fi
BASH);
$phpFpm = trim($phpFpm);
if ($phpFpm === '') {
throw new \RuntimeException('No supported PHP-FPM service found (8.5 or 8.3).');
}
writeln("Restarting {$phpFpm}...");
run("sudo -n systemctl restart {$phpFpm}");
});
after('deploy:update_code', 'deploy:write_revision_file');