mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 20:10:08 +02:00
- Renaming the configuration files from `www.conf` to the backup (`disabled-by-phpmon`) will now succeed if the `disabled-by-phpmon` file already exists. This would fail if the `disabled-by-phpmon` file already existed in previous builds. - The PHP-FPM alert when there's an issue with a missing socket configuration file has been tweaked and now contains a workaround if you want to run a newer version of PHP (e.g. PHP 8.2) that is not officially supported by Valet yet. - When attempting to list the PHP version numbers, the `parse()` method is now used, as opposed to `PhpVersionNumber.make()`, which couldn't correctly handle pre-release versions of PHP. - Updated tests to reflect these changes to `PhpVersionNumber`.
37 lines
1.2 KiB
Swift
37 lines
1.2 KiB
Swift
//
|
|
// ActivePhpInstallation.swift
|
|
// PHP Monitor
|
|
//
|
|
// Created by Nico Verbruggen on 21/12/2021.
|
|
// Copyright © 2021 Nico Verbruggen. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension ActivePhpInstallation {
|
|
|
|
/**
|
|
It is always possible that the system configuration for PHP-FPM has not been set up for Valet.
|
|
This can occur when a user manually installs a new PHP version, but does not run `valet install`.
|
|
In that case, we should alert the user!
|
|
|
|
- Important: The underlying check is `checkPhpFpmStatus`, which can be run multiple times.
|
|
This method actively presents a modal if said checks fails, so don't call this method too many times.
|
|
*/
|
|
public func notifyAboutBrokenPhpFpm() {
|
|
if !self.checkPhpFpmStatus() {
|
|
DispatchQueue.main.async {
|
|
BetterAlert()
|
|
.withInformation(
|
|
title: "alert.php_fpm_broken.title".localized,
|
|
subtitle: "alert.php_fpm_broken.info".localized,
|
|
description: "alert.php_fpm_broken.description".localized
|
|
)
|
|
.withPrimary(text: "OK")
|
|
.show()
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|