1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 20:10:08 +02:00

Compare commits

...

9 Commits

Author SHA1 Message Date
2fa50a7dc4 🔧 Bump build for new pre-release build 2023-01-19 17:33:55 +01:00
18b62ecc3f 👌 Adjust SECURITY and support matrix for Valet 4
This commit ensures that PHP Monitor knows about which versions of
PHP are supported by the upcoming Valet 4.0: PHP 7.1 and higher.

Ensures compatibility with https://github.com/laravel/valet/pull/1318
2023-01-19 17:30:21 +01:00
2d59b8c6e8 👌 Improve onboarding 2023-01-18 20:42:24 +01:00
450d7ec001 👌 Fixed onboarding for initial launch 2023-01-18 20:27:02 +01:00
b6b1174ca3 👌 More compact ServicesView 2023-01-18 19:56:54 +01:00
e509f6b59d 📝 TL QC Pass 1 2023-01-18 19:22:45 +01:00
6014320441 📝 Update information about supported PHP versions 2023-01-18 19:18:25 +01:00
a0d80423e9 📝 Update documentation
* Updated README
* Updated SECURITY
* Revert the minimum Valet version to v2.16
2023-01-18 19:10:43 +01:00
35b19efc3e 👌 Use specific theme colors for services status 2023-01-17 18:05:22 +01:00
16 changed files with 200 additions and 84 deletions

View File

@ -14,6 +14,16 @@ It also automatically runs when you try to build the project. You'll get a warni
swiftlint --fix
```
## ⚙️ Preferences
You can find the persisted configuration file in `~/Library/Preferences/com.nicoverbruggen.phpmon.plist`
These values are cached by the OS. You can clear this cache by running:
```
defaults delete com.nicoverbruggen.phpmon && killall cfprefsd
```
## 🔧 Build instructions
<img src="./docs/build.png" width="404px" alt="build button in Xcode"/>

View File

@ -2799,7 +2799,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1025;
CURRENT_PROJECT_VERSION = 1026;
DEAD_CODE_STRIPPING = YES;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
@ -2828,7 +2828,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1025;
CURRENT_PROJECT_VERSION = 1026;
DEAD_CODE_STRIPPING = YES;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;
@ -3056,7 +3056,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1025;
CURRENT_PROJECT_VERSION = 1026;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;
ENABLE_HARDENED_RUNTIME = YES;
@ -3166,7 +3166,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1025;
CURRENT_PROJECT_VERSION = 1026;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
ENABLE_HARDENED_RUNTIME = YES;

View File

@ -27,22 +27,36 @@ PHP Monitor is a universal application that runs natively on Apple Silicon **and
* macOS 11 Big Sur or later
* Homebrew is installed in `/usr/local/homebrew` or `/opt/homebrew`
* Homebrew `php` formula is installed
* Laravel Valet 3 recommended (but compatible with Valet 2)
* Laravel Valet (works with Valet v2, v3 and v4)
_You may need to update your Valet installation to keep everything working if a major version update of PHP has been released. You can do this by running `composer global update && valet install`. Some features are not supported when running Valet 2._
For more information, please see [SECURITY.md](./SECURITY.md) to find out which version of the app is currently supported.
## 🚀 How to install
Again, make sure you have **Laravel Valet** installed first. Once that's done, you can install via Homebrew (recommended), or may download the latest release on GitHub.
Again, make sure you have **[Laravel Valet](https://laravel.com/docs/master/valet)** installed first:
```sh
composer global require laravel/valet
valet install
valet trust
```
Once that's done, you can install PHP Monitor via Homebrew (recommended), or (alternatively) you may download the latest release on GitHub.
To install via Homebrew, run:
brew tap nicoverbruggen/homebrew-cask
brew install --cask phpmon
```sh
brew tap nicoverbruggen/homebrew-cask
brew install --cask phpmon
```
To upgrade your existing installation, run:
brew upgrade phpmon
```sh
brew upgrade phpmon
```
(You may need to run `brew update` or `brew update-reset` first in order to update the cask file if you ran a Homebrew operation recently.)
@ -79,36 +93,14 @@ If you're still having issues, here's a few common questions & answers, as well
<details>
<summary><strong>Which versions of PHP are supported?</strong></summary>
The following versions of PHP are officially supported:
All stable and supported PHP versions are also supported by PHP Monitor. However, depending on which version of Valet you have installed, which versions of PHP that are made available for switching purposes may differ.
<ul>
<li>PHP 7.4</li>
<li>PHP 8.0</li>
<li>PHP 8.1</li>
<li>PHP 8.2</li>
</ul>
The following versions have some support via backport and/or dev version:
<ul>
<li>PHP 5.6 (Valet 2 only)</li>
<li>PHP 7.0 (Valet 2 and 3 only)</li>
<li>PHP 7.1 (Valet 2 and 3 only)</li>
<li>PHP 7.2 (Valet 2 and 3 only)</li>
<li>PHP 7.3 (Valet 2 and 3 only)</li>
</ul>
Additionally, the following dev version is also available:
<ul>
<li>PHP 8.3-dev (experimental)</li>
</ul>
For more details, consult the [constants file](https://github.com/nicoverbruggen/phpmon/blob/main/phpmon/Common/Core/Constants.swift#L16) file to see which versions are supported.
> **Note**
> If you have versions of PHP installed that can be detected by PHP Monitor but is *not* supported by the currently active version of Valet, you will be alerted by an item in the menu with an exclamation mark emoji. (⚠️)
Backports are available via [this tap](https://github.com/shivammathur/homebrew-php). For more information about those backports, please see the next FAQ entry.
For maximum compatibility with older PHP versions, you may wish to keep using Valet 2 or 3.
For maximum compatibility with older PHP versions, you may wish to keep using Valet 2 or 3. For more information, please see [SECURITY.md](./SECURITY.md) to find out which versions of PHP are supported with different versions of Valet.
</details>
@ -127,12 +119,12 @@ brew tap shivammathur/php
You may find that this tap is already in use: if you've used Valet before, it automatically uses this tap for legacy versions of PHP.
You can then install those older versions:
```sh
brew install php@7.0
brew install php@7.1
...
brew install shivammathur/php/php@7.4
brew install shivammathur/php/php@7.3
brew install shivammathur/php/php@7.2
brew install shivammathur/php/php@7.1
brew install shivammathur/php/php@7.0
```
**Always make sure to restart PHP Monitor after installing or upgrading PHP versions!**

View File

@ -6,7 +6,9 @@ Generally speaking, only the latest version of **PHP Monitor** is supported, exc
| Version | Apple Silicon | Supported | Supported macOS | Deployment Target | Detected PHP Versions | Recommended Valet Version |
| ------- | ------------- | ------------------ | ----- | ----- | ----- | ----
| 6.x | ✅ Universal binary | ✅ Yes | Big Sur (11.0)<br/>Monterey (12.0)<br/>Ventura (13.0) | macOS 11+ | PHP 5.6—PHP 8.2 (w/ Valet 2.x)<br/>PHP 7.0—PHP 8.2 (w/ Valet 3.x)<br/>PHP 7.4-PHP 8.2 (w/ Valet 4.x) | 3.0 or higher recommended<br/> 2.16.2 minimum |
| 5.7 | ✅ Universal binary | ✅ Yes | Big Sur (11.0)<br/>Monterey (12.0)<br/>Ventura (13.0) | macOS 11+ | PHP 5.6—PHP 8.2 (w/ Valet 2.x)<br/>PHP 7.0—PHP 8.2 (w/ Valet 3.x)<br/>PHP 7.1-PHP 8.2 (w/ Valet 4.x*) | 3.0 or higher recommended<br/> 2.16.2 minimum |
(*) Preliminary listing. Valet 4 hasn't been released yet and the versions of PHP Valet can work with might still change.
## Legacy versions

View File

@ -7,7 +7,7 @@
"alpha" : "1.000",
"blue" : "0.988",
"green" : "0.580",
"red" : "0.277"
"red" : "0.278"
}
},
"idiom" : "universal"

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.501",
"green" : "0.697",
"red" : "0.247"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.501",
"green" : "0.765",
"red" : "0.247"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.180",
"green" : "0.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.426",
"green" : "0.363",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.180",
"green" : "0.841",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.426",
"green" : "0.809",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -14,9 +14,9 @@ struct Constants {
If the installed version is older, a notification will be shown
every time the app launches (with a recommendation to upgrade).
See also: https://github.com/laravel/valet/releases/tag/v3.1.10
See also: https://github.com/laravel/valet/releases/tag/v2.16.2
*/
static let MinimumRecommendedValetVersion = "3.1.10"
static let MinimumRecommendedValetVersion = "2.16.2"
/**
* The PHP versions supported by this application.
@ -44,9 +44,9 @@ struct Constants {
"8.0", "8.1", "8.2",
"8.3" // dev
],
4: // Valet v4 dropped support for v7.0-v7.3
4: // Valet v4 dropped support for v7.0
[
"7.4",
"7.1", "7.2", "7.3", "7.4",
"8.0", "8.1", "8.2",
"8.3" // dev
]

View File

@ -44,7 +44,7 @@ final class HomebrewService: Sendable, Decodable {
/**
Dummy data for preview purposes.
*/
public static func dummy(named service: String, enabled: Bool) -> HomebrewService {
public static func dummy(named service: String, enabled: Bool, status: String? = nil) -> HomebrewService {
return HomebrewService(
name: service,
service_name: service,
@ -52,7 +52,7 @@ final class HomebrewService: Sendable, Decodable {
loaded: enabled,
pid: nil,
user: nil,
status: nil,
status: status,
log_path: nil,
error_log_path: nil
)

View File

@ -41,9 +41,14 @@ class FakeServicesManager: ServicesManager {
private func reapplyServices() {
let services = self.formulae.map {
let dummy = HomebrewService.dummy(
named: $0.name,
enabled: self.fixedStatus == .active,
status: self.fixedStatus == .error ? "error" : nil
)
let wrapper = Service(
formula: $0,
service: HomebrewService.dummy(named: $0.name, enabled: self.fixedStatus == .active)
service: dummy
)
return wrapper
}

View File

@ -66,7 +66,7 @@ class ServicesManager: ObservableObject {
public var statusColor: Color {
if self.services.isEmpty || !self.firstRunComplete {
return .yellow
return Color("StatusColorYellow")
}
let statuses = self.services[0...2].map { $0.status }
@ -74,10 +74,10 @@ class ServicesManager: ObservableObject {
if statuses.contains(.missing)
|| statuses.contains(.inactive)
|| statuses.contains(.error) {
return .red
return Color("StatusColorRed")
}
return .green
return Color("StatusColorGreen")
}
/**

View File

@ -101,25 +101,19 @@ extension MainMenu {
// Start the background refresh timer
startSharedTimer()
// Update the stats
Stats.incrementSuccessfulLaunchCount()
#if SPONSOR
Log.info("Sponsor encouragement messages are omitted in SE builds.")
#else
if !isRunningSwiftUIPreview {
Stats.incrementSuccessfulLaunchCount()
Stats.evaluateSponsorMessageShouldBeDisplayed()
#endif
// Present first launch screen if needed
if Stats.successfulLaunchCount == 0 && !isRunningSwiftUIPreview {
Log.info("Should present the first launch screen!")
Task { @MainActor in
OnboardingWindowController.show()
if Stats.successfulLaunchCount == 1 {
Log.info("Should present the first launch screen!")
Task { @MainActor in
OnboardingWindowController.show()
}
}
}
// Check for updates
await AppUpdateChecker.checkIfNewerVersionIsAvailable()
await AppUpdateChecker.checkIfNewerVersionIsAvailable()
}
// Check if the linked version has changed between launches of phpmon
Stats.evaluateLastLinkedPhpVersion()

View File

@ -35,8 +35,8 @@ struct ServicesView: View {
var perRow: Int
var rowCount: Int
var rowSpacing: Int = 0
var rowHeight: Int = 50
var statusHeight: Int = 30
var rowHeight: Int = 48
var statusHeight: Int = 20
var allRowHeight: CGFloat
var height: CGFloat
@ -66,15 +66,14 @@ struct ServicesView: View {
}
.frame(height: CGFloat(self.height - CGFloat(self.statusHeight)))
.frame(maxWidth: .infinity, alignment: .center)
// .background(Color.red)
VStack(alignment: .center) {
HStack {
Circle()
.frame(width: 12, height: 12)
.frame(width: 10, height: 10)
.foregroundColor(self.manager.statusColor)
Text(self.manager.statusMessage)
.font(.system(size: 12))
.font(.system(size: 11))
if self.manager.statusColor == .red {
HelpButton {
let type = manager.hasError
@ -108,8 +107,6 @@ struct ServiceView: View {
Text(service.name.uppercased())
.font(.system(size: 10))
.frame(minWidth: 70, alignment: .center)
.padding(.top, 4)
.padding(.bottom, 2)
if isBusy {
ProgressView()
.scaleEffect(x: 0.4, y: 0.4, anchor: .center)
@ -143,7 +140,7 @@ struct ServiceView: View {
} label: {
Text("E")
.frame(width: 12.0, height: 12.0)
.foregroundColor(Color("IconColorRed"))
.foregroundColor(Color("StatusColorRed"))
}
.focusable(false)
.frame(width: 25, height: 25)
@ -163,8 +160,8 @@ struct ServiceView: View {
.frame(width: 12.0, height: 12.0)
.foregroundColor(
service.status == .active
? Color("IconColorGreen")
: Color("IconColorRed")
? Color.primary
: Color("StatusColorRed")
)
}
.focusable(false)

View File

@ -101,11 +101,13 @@ struct OnboardingView: View {
}
VStack {
Text("onboarding.tour.once".localized)
.fixedSize(horizontal: false, vertical: true)
.font(.subheadline)
.foregroundColor(.gray)
.padding(.top, 5)
.padding(.bottom, 5)
.lineLimit(5)
.lineLimit(3)
.frame(height: 35)
Button("onboarding.tour.close".localized) {
App.shared.onboardingWindowController?.close()
}

View File

@ -10,7 +10,7 @@
"mi_busy" = "PHP Monitor is busy...";
"mi_unsure" = "We are not sure what version of PHP you are running.";
"mi_php_version" = "Global PHP version: PHP";
"mi_php_version" = "Global version: PHP";
"mi_php_switch" = "Switch to PHP";
"mi_php_unsupported" = "Some installed PHP versions are not displayed.";
"mi_php_broken_1" = "Oof! It appears your PHP installation is broken...";
@ -562,13 +562,13 @@ If you are seeing this message but are confused why this folder has gone missing
"startup.version_mismatch.button_stay" = "Keep using PHP %@";
// Warning about unsupported PHP versions
"startup.unsupported_versions_explanation.title" = "One or more PHP installed versions are not supported.";
"startup.unsupported_versions_explanation.subtitle" = "The following versions of PHP are installed on your system but are not supported by this version of Valet.
"startup.unsupported_versions_explanation.title" = "PHP installation(s) not supported by Valet detected!";
"startup.unsupported_versions_explanation.subtitle" = "The following PHP versions are installed on your system but are not supported by this version of Valet.
%@
Valet might break if you link these PHP versions so PHP Monitor won't let you switch to them.";
"startup.unsupported_versions_explanation.desc" = "If you need support for older versions of PHP, you may need to downgrade to an older versions of Valet. Otherwise, it might be a good idea to uninstall any outdated versions that are not in use. This message will only be removed after restarting PHP Monitor.";
"startup.unsupported_versions_explanation.desc" = "If you need support for older versions of PHP, you may need to downgrade to an older versions of Valet. Otherwise, it might be a good idea to uninstall any outdated versions that are not in use. It can also be that this version of Valet is too old. This message will only be removed after restarting PHP Monitor.";
// Sponsor encouragement
"startup.sponsor_encouragement.title" = "If PHP Monitor has been useful to you or your company, please consider leaving a tip.";
@ -658,7 +658,7 @@ COMMON TROUBLESHOOTING TIPS
"onboarding.title" = "Welcome Tour";
"onboarding.welcome" = "Welcome to PHP Monitor!";
"onboarding.explore" = "Learn more about some of the features that PHP Monitor has to offer. You can find a more comprehensive list of features on GitHub.";
"onboarding.explore" = "Congrats, you now have access to PHP Monitor's entire suite of functionality. You can learn more about some of the features that PHP Monitor has to offer on this screen.";
"onboarding.tour.menu_bar.title" = "Power In Your Menu Bar";
"onboarding.tour.menu_bar" = "PHP Monitor lives in your menu bar. From this menu, you can access most of PHP Monitor's key functionality, including switching the globally linked PHP version, locating config files, and much more.";
"onboarding.tour.faq_hint" = "I recommend that you check out the [README](https://github.com/nicoverbruggen/phpmon/blob/main/README.md) on GitHub: it contains a comprehensive FAQ with various tips and common questions and answers.";
@ -668,5 +668,5 @@ COMMON TROUBLESHOOTING TIPS
"onboarding.tour.domains" = "By opening the Domains window via the menu bar item, you can view which domains are linked and parked, as well as active nginx proxies.";
"onboarding.tour.isolation.title" = "Isolate Domains";
"onboarding.tour.isolation" = "If you have Valet 3 installed, you can even use domain isolation by right-clicking on a given domain in the Domains window. This allows you to pick a specific version of PHP to use for that domain, and that domain only.";
"onboarding.tour.once" = "You will only see the Welcome Tour once. You can re-open the Welcome Tour later via the menu bar icon (under First Aid & Services).";
"onboarding.tour.once" = "You will only see the Welcome Tour once. You can re-open the Welcome Tour later via the menu bar icon (available in the menu, under First Aid & Services).";
"onboarding.tour.close" = "Close Tour";