mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
36 lines
1.1 KiB
Swift
36 lines
1.1 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
|
|
)
|
|
.withPrimary(text: "OK")
|
|
.show()
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|