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

Compare commits

...

14 Commits

Author SHA1 Message Date
371f98b875 🚀 Version 6.0 2023-05-28 10:28:02 +02:00
7955c777e7 📝 Updated credits w/ sponsors
The list of sponsors includes a list of all public sponsors.

(Private sponsors have been omitted from the list.)
2023-05-27 12:46:39 +02:00
5c9b06d83b 👌 Missing localized strings 2023-05-27 12:43:31 +02:00
3c7bed0a9b 🔧 Bump build number for release version 2023-05-27 12:11:59 +02:00
54f83a0aed 🐛 Prevent operations when PHP Monitor is busy 2023-05-27 11:57:41 +02:00
b041ca37be 🐛 Disable Sites menu item when Standalone 2023-05-27 11:53:11 +02:00
2b2b027317 📝 Update README 2023-05-26 21:27:36 +02:00
cdbd959159 👌 Update strings 2023-05-26 20:49:18 +02:00
0c3b68734c 🔧 New bug report format 2023-04-12 13:48:22 +02:00
8b0aeef2e6 🚀 Version 5.8.1 2023-03-29 18:05:03 +02:00
aa406434d0 🔧 Bump build 2023-03-29 18:04:27 +02:00
d320c49092 👌 Avoid force unwrapping try (may crash) 2023-03-23 19:08:39 +01:00
966033e052 🐛 Prevent crash upon parsing invalid Valet directories
This fixes #247, which can be caused when certain folders are not
accessible for some reason. This can occur due to network reasons,
but also because the linked folder in question is iCloud Drive.
2023-03-23 18:00:45 +01:00
7c192730e1 📝 Update SECURITY 2023-03-15 20:09:32 +01:00
10 changed files with 171 additions and 92 deletions

View File

@ -554,6 +554,10 @@
C485707B28BF458900539B36 /* VersionPopoverView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C44264BF2850BD2A007400F1 /* VersionPopoverView.swift */; };
C485707C28BF459500539B36 /* NoWarningsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C41C708C28AA7F7900E8D498 /* NoWarningsView.swift */; };
C485707D28BF45A200539B36 /* WarningView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4297F7928970D59004C4630 /* WarningView.swift */; };
C489E0BB2A220A4200323F5E /* FakeBrewFormulaeHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C489E0BA2A220A4200323F5E /* FakeBrewFormulaeHandler.swift */; };
C489E0BC2A220A4200323F5E /* FakeBrewFormulaeHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C489E0BA2A220A4200323F5E /* FakeBrewFormulaeHandler.swift */; };
C489E0BD2A220A4200323F5E /* FakeBrewFormulaeHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C489E0BA2A220A4200323F5E /* FakeBrewFormulaeHandler.swift */; };
C489E0BE2A220A4200323F5E /* FakeBrewFormulaeHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C489E0BA2A220A4200323F5E /* FakeBrewFormulaeHandler.swift */; };
C48D0C9325CC804200CC7490 /* XibLoadable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C48D0C9225CC804200CC7490 /* XibLoadable.swift */; };
C48D6C70279CD2AC00F26D7E /* VersionNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = C48D6C6F279CD2AC00F26D7E /* VersionNumber.swift */; };
C48D6C71279CD2AC00F26D7E /* VersionNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = C48D6C6F279CD2AC00F26D7E /* VersionNumber.swift */; };
@ -980,6 +984,7 @@
C47DF1AE299D5A3B0007055D /* LoginItemManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginItemManager.swift; sourceTree = "<group>"; };
C4811D2322D70A4700B5F6B3 /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = "<group>"; };
C4811D2922D70F9A00B5F6B3 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = "<group>"; };
C489E0BA2A220A4200323F5E /* FakeBrewFormulaeHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeBrewFormulaeHandler.swift; sourceTree = "<group>"; };
C48D0C9225CC804200CC7490 /* XibLoadable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XibLoadable.swift; sourceTree = "<group>"; };
C48D6C6F279CD2AC00F26D7E /* VersionNumber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionNumber.swift; sourceTree = "<group>"; };
C48D6C73279CD3E400F26D7E /* PhpVersionNumberTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhpVersionNumberTest.swift; sourceTree = "<group>"; };
@ -1405,6 +1410,7 @@
C48DDD0C29C75C9E00D032D9 /* BlockingOverlayView.swift */,
C40D72592A018ACC0054A067 /* PhpFormulaeStatus.swift */,
C40D725E2A018AE30054A067 /* BrewFormulaUI.swift */,
C489E0BA2A220A4200323F5E /* FakeBrewFormulaeHandler.swift */,
);
path = PhpManager;
sourceTree = "<group>";
@ -2282,6 +2288,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C489E0BB2A220A4200323F5E /* FakeBrewFormulaeHandler.swift in Sources */,
C41ADCE82970CCC700120423 /* FSNotifier.swift in Sources */,
C47699EF28A2F2A30060FEB8 /* WarningManager.swift in Sources */,
C490E3BB29BCA375006D2DE6 /* Measurements.swift in Sources */,
@ -2638,6 +2645,7 @@
C471E7FD28F9BACE0021E251 /* HomebrewService.swift in Sources */,
C471E7E428F9BAC20021E251 /* Helpers.swift in Sources */,
C4CB6E67292C362C002E9027 /* Homebrew.swift in Sources */,
C489E0BD2A220A4200323F5E /* FakeBrewFormulaeHandler.swift in Sources */,
C45E2A77291992DA005C7CFD /* FeatureTestCase.swift in Sources */,
C471E82028F9BB290021E251 /* NginxConfigurationFile.swift in Sources */,
C471E7D428F9BA8F0021E251 /* ActiveFileSystem.swift in Sources */,
@ -2687,6 +2695,7 @@
C4B79EB929CA387F00A483EE /* BrewFormulaeHandler.swift in Sources */,
C471E8A428F9BB8F0021E251 /* AppDelegate+Notifications.swift in Sources */,
C490E3B329BC9FEA006D2DE6 /* ProgressWindowView.swift in Sources */,
C489E0BE2A220A4200323F5E /* FakeBrewFormulaeHandler.swift in Sources */,
C490E3B229BC9FE8006D2DE6 /* ProgressViewSubject.swift in Sources */,
C471E8A528F9BB8F0021E251 /* AppDelegate+InterApp.swift in Sources */,
C471E8A628F9BB8F0021E251 /* App.swift in Sources */,
@ -2973,6 +2982,7 @@
C4B97B79275CF1B5003F3378 /* App+ActivationPolicy.swift in Sources */,
C4E2E86528FC2F1B003B070C /* XCPMApplication.swift in Sources */,
C4E49DE828F764050026AC4E /* ActiveCommand.swift in Sources */,
C489E0BC2A220A4200323F5E /* FakeBrewFormulaeHandler.swift in Sources */,
C4CE3BBB27B324230086CA49 /* MainMenu+Switcher.swift in Sources */,
C4B79ECC29CA475900A483EE /* RemovePhpVersionCommand.swift in Sources */,
C4FD87AA29AB9ABD0002D701 /* PhpConfigChecker.swift in Sources */,
@ -3352,7 +3362,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1245;
CURRENT_PROJECT_VERSION = 1250;
DEAD_CODE_STRIPPING = YES;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
@ -3382,7 +3392,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1245;
CURRENT_PROJECT_VERSION = 1250;
DEAD_CODE_STRIPPING = YES;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;
@ -3620,7 +3630,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1245;
CURRENT_PROJECT_VERSION = 1250;
DEAD_CODE_STRIPPING = YES;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;
@ -3734,7 +3744,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1245;
CURRENT_PROJECT_VERSION = 1250;
DEAD_CODE_STRIPPING = YES;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
@ -3848,7 +3858,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1245;
CURRENT_PROJECT_VERSION = 1250;
DEAD_CODE_STRIPPING = YES;
DEBUG = YES;
DEVELOPMENT_TEAM = 8M54J5J787;
@ -4027,7 +4037,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1245;
CURRENT_PROJECT_VERSION = 1250;
DEAD_CODE_STRIPPING = YES;
DEBUG = NO;
DEVELOPMENT_TEAM = 8M54J5J787;

View File

@ -23,8 +23,9 @@ PHP Monitor is a universal application that runs natively on Apple Silicon **and
* Your user account can administer your computer (required for some functionality, e.g. certificate generation)
* macOS 12.4 or later (Monterey and Ventura are supported)
* Homebrew is installed in `/usr/local/homebrew` or `/opt/homebrew`
* Homebrew is installed in the default location (`/usr/local/homebrew` or `/opt/homebrew`)
* Homebrew `php` formula is installed
* Optional but recommended: Laravel Valet
_Starting with PHP Monitor 6.0, you do not need to have Laravel Valet installed for PHP Monitor to work. To get access to all features of PHP Monitor however, installing Valet is **recommended**._
@ -134,6 +135,14 @@ If you are on an older version of macOS, you can do this by dragging *PHP Monito
Super convenient!
</details>
<details>
<summary><strong>What features are unavailable in Standalone Mode?</strong></summary>
The services manager is disabled, and all other obvious Laravel Valet integrations (configuration finder, domains list, Fix My Valet) are also disabled.
(Most other features remain available.)
</details>
<details>
<summary><strong>I want to set up PHP Monitor from scratch! I don't have Homebrew installed either, where do I begin?</strong></summary>
@ -160,7 +169,7 @@ If you're on an Apple Silicon-based Mac, you'll need to add:
and add the following to your `.zshrc` file, but add this BEFORE the homebrew PATH additions:
export PATH=$HOME/bin:~/.composer/vendor/bin:$PATH
If you're adding `composer` and Homebrew binaries, ensure that Homebrew binaries are preferred by adding these to the path last. On my system, that looks like this:
export PATH=$HOME/bin:/usr/local/bin:$PATH
@ -179,8 +188,12 @@ Make sure PHP is linked correctly:
should return: `/usr/local/bin/php` (or `/opt/homebrew/bin/php` if you are on Apple Silicon)
**If you don't need Laravel Valet, you can stop here. PHP Monitor will work like this in Standalone Mode.**
If you'd like to have Valet as well, continue and install Valet with Composer, like this.
composer global require laravel/valet
For optimal results, you should lock your PHP platform for global dependencies to the oldest version of PHP you intend to run. If that version is PHP 7.0, your `~/.composer/composer.json` file could look like this (please adjust the version accordingly!):
```
@ -199,18 +212,13 @@ For optimal results, you should lock your PHP platform for global dependencies t
Run `composer global update` again. This ensures that when you switch to a different global PHP version, [Valet won't break](https://github.com/nicoverbruggen/phpmon/issues/178). If it does, PHP Monitor will let you know what you can do about this.
Then, install Valet:
valet install
This should install `dnsmasq` and set up Valet. Great, almost there!
valet trust
You can now install PHP Monitor, if you haven't already:
brew tap nicoverbruggen/homebrew-cask
brew install --cask phpmon
Finally, run PHP Monitor. Since the app is notarized and signed with a developer ID, it should work. You will need to approve the initial launch of the app, but you should be ready to go now.
</details>
@ -219,13 +227,17 @@ Finally, run PHP Monitor. Since the app is notarized and signed with a developer
PHP Monitor will check if an update is available every time you start the app.
You can disable this behaviour by going to Preferences (via the PHP Monitor icon in the menu bar) and unchecking "Automatically check for updates". You can always check for updates manually.
You can disable this behaviour by going to Preferences (via the PHP Monitor icon in the menu bar) and unchecking "Automatically check for updates". (You can always check for updates manually.)
</details>
<details>
<summary><strong>I have PHP Monitor installed, and it works. I want to upgrade my PHP installations to the latest version, what's the best way to do this?</strong></summary>
The easiest way is to simply use the built-in **PHP Version Manager**, which will allow you to upgrade your PHP versions with one click.
If you want to do this manually, you can follow the instructions below.
It's easy to make a mistake here, and end up with an unlinked version of PHP or have versions missing from PHP Monitor.
Here's what I usually do:
@ -255,7 +267,7 @@ This should resolve the issue! If that does not fix the issue, run `brew link ph
brew install php
brew link php --force
</details>
<details>
@ -310,12 +322,14 @@ Make sure you have at least **Valet 3.0** installed, since support for isolation
<details>
<summary><strong>One of the limits (memory limit, max POST size, max upload size) shows an exclamation mark!</strong></summary>
The value you provided in your INI file is invalid. If that is the case, PHP will attempt to parse your value as bytes, which is usually unintended. (`1GB` will resolve to merely a few bytes, and all of your applications will run out of memory!)
The value you provided in your `.ini` file is invalid. If that is the case, PHP will attempt to parse your value as bytes, which is usually unintended. (`1GB` will resolve to merely a few bytes, and all of your applications will run out of memory!)
You must a provide a value like so: `1024K`, `256M`, `1G`. Alternatively, `-1` is also allowed, or just an integer (which will result in N amount of bytes being the limit).
**Example**: Trying to use `1GB` as the memory limit, for example, will result in this exclamation mark. The correct way to set a 1GB limit is by using `1G` as the value. (Note: The displayed value will append `B` for clarity, so if you set `1G`, the value reported by PHP Monitor will be 1 GB.)
(If you are using Valet, you can adjust these limits in the `.conf.d/php-memory-limits.ini` file. Otherwise, you may need to adjust `php.ini`.)
</details>
<details>
@ -404,6 +418,9 @@ You can omit the `php` key in the preset if you do not wish for the preset to sw
<details>
<summary><strong>How do I ensure additional Homebrew services are shown in the app?</strong></summary>
> **Info**
> Homebrew services aren't displayed if you are using Valet in Standalone Mode.
You must set these services up in a JSON file, located in `~/.config/phpmon/config.json`.
You can specify custom services in the configuration file for Homebrew services that run as your own user (not root).
@ -594,7 +611,7 @@ This utility will detect which PHP versions you have installed via Homebrew, and
The switcher will disable all PHP-FPM services not belonging to the version you wish to use, and link the desired version of PHP. Then, it'll restart your desired PHP version's FPM process. This all happens in parallel, so this should be a bit faster than Valets switcher.
If you're using Valet 3, versions of PHP-FPM required to keep isolated sites up and running will also be started or stopped as needed.
If you're using Valet 3 or newer, versions of PHP-FPM required to keep isolated sites up and running will also be started or stopped as needed.
### Config change detection

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 KiB

After

Width:  |  Height:  |  Size: 674 KiB

View File

@ -17,7 +17,9 @@
<p><b>Having issues?</b> Consult the <a href="https://phpmon.app/faq">FAQ</a> section, I did my best to ensure everything is documented.</p>
<p><b>Want to support further development of PHP Monitor?</b> You can <a href="https://phpmon.app/sponsor">financially support</a> the continued development of this app.</p>
<p><b>Get the latest on Twitter or Mastodon.</b> Give me a <a href="https://twitter.com/nicoverbruggen">follow on Twitter</a> or <a href="https://phpc.social/@nicoverbruggen">Mastodon</a> to learn about what's brewing and when new updates drop.</p>
<br>
<p><b>Special thanks</b> to all current and past <a href="https://github.com/sponsors/nicoverbruggen#sponsors"><b>sponsors</b></a> of PHP Monitor, who have helped to make further development of the app possible.</p>
<p><b>Made possible by these GitHub Sponsors</b>: @abdusfauzi, @abicons, @adrolli, @andresayej, @andyunleashed, @anzacorp, @argirisp, @AshPowell, @aurawindsurfing, @awsmug, @barrycarton, @BertvanHoekelen, @calebporzio, @caseyalee, @cgreuling, @cjcox17, @Diewy, @drfraker, @driftingly, @duellsy, @edalzell, @EYOND, @faithfm, @frankmichel, @gwleuverink, @hopkins385, @intrepidws, @jacksleight, @JacobBennett, @jasonvarga, @jeromegamez, @jimmyaldape, @jimmysawczuk, @joetannenbaum, @jolora, @joshuablum, @jpeinelt, @jreviews, @JustSteveKing, @Kajvdh, @KFoobar, @Laravel-Backpack, @leganz, @martinleveille, @mathiasonea, @matthewmnewman, @mcastillo1030, @megabubbletea, @mennen-online, @mike-healy, @mostafakram, @mpociot, @MrMicky-FR, @MrMooky, @murdercode, @nckrtl, @nhedger, @ninjaparade, @ozanuzer, @pepatel, @philbraun, @pickuse2013, @pk-informatics, @Plytas, @rderimay, @rickyjohnston, @rico, @RobertBoes, @runofthemill, @SahinU88, @sdebacker, @sdevore, @shadracnicholas, @simonhamp, @SRWieZ, @stefanbauer, @StriveMedia, @swilla, @Tailcode-Studio, @theutz, @ThomasEnssner, @tillkruss, @timothyrowan, @ttnppedr, @vincent-tarrit, @WheresMarco, @xPand4B, @xuandung38, @yeslandi89, @zackkatz, @zacksmash, @zaherg.<br/>(Some names have been omitted due to their sponsorships being private. Thank you all!)
<br/>
</body>
</html>

View File

@ -11,6 +11,10 @@ import UserNotifications
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDelegate {
static var instance: AppDelegate {
return NSApplication.shared.delegate as! AppDelegate
}
// MARK: - Variables
/**
@ -121,4 +125,18 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
await menu.startup()
}
}
// MARK: - Menu Items
@IBOutlet weak var menuItemSites: NSMenuItem!
/**
Ensure relevant menu items in the main menu bar (not the pop-up menu)
are disabled or hidden when needed.
*/
public func configureMenuItems(standalone: Bool) {
if standalone {
menuItemSites.isHidden = true
}
}
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Search Toolbar Item" minToolsVersion="12.0" minSystemVersion="11.0"/>
@ -34,18 +34,6 @@
</items>
</menu>
</menuItem>
<menuItem title="File" id="XRy-v5-KNb">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="File" id="zA7-mh-f1x">
<items>
<menuItem title="Close" keyEquivalent="w" id="2FI-pQ-tuO">
<connections>
<action selector="performClose:" target="Ady-hI-5gd" id="ZHq-so-Sba"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Sites" id="9gy-d3-Pos">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Sites" id="YTZ-bb-TOG">
@ -82,12 +70,12 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="8Pm-83-BlM">
<items>
<menuItem title="Undo" keyEquivalent="z" id="jCt-Yf-FSE">
<menuItem title="Undo" enabled="NO" keyEquivalent="z" id="jCt-Yf-FSE">
<connections>
<action selector="undo:" target="Ady-hI-5gd" id="O3z-27-Ug0"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="fCh-1M-Qyg">
<menuItem title="Redo" enabled="NO" keyEquivalent="Z" id="fCh-1M-Qyg">
<connections>
<action selector="redo:" target="Ady-hI-5gd" id="utE-Bv-fdY"/>
</connections>
@ -297,6 +285,18 @@
</items>
</menu>
</menuItem>
<menuItem title="Window" id="XRy-v5-KNb">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Window" id="zA7-mh-f1x">
<items>
<menuItem title="Close" keyEquivalent="w" id="2FI-pQ-tuO">
<connections>
<action selector="performClose:" target="Ady-hI-5gd" id="ZHq-so-Sba"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
@ -317,7 +317,11 @@
</application>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="PHP_Monitor" customModuleProvider="target"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="PHP_Monitor" customModuleProvider="target">
<connections>
<outlet property="menuItemSites" destination="9gy-d3-Pos" id="nul-IL-YuR"/>
</connections>
</customObject>
</objects>
<point key="canvasLocation" x="-360" y="-94"/>
</scene>

View File

@ -88,6 +88,9 @@ extension MainMenu {
// Load the global hotkey
App.shared.loadGlobalHotkey()
// Set up menu items
AppDelegate.instance.configureMenuItems(standalone: !Valet.installed)
if Valet.installed {
// Preload all sites
await Valet.shared.startPreloadingSites()

View File

@ -0,0 +1,58 @@
//
// FakeBrewFormulaeHandler.swift
// PHP Monitor
//
// Created by Nico Verbruggen on 27/05/2023.
// Copyright © 2023 Nico Verbruggen. All rights reserved.
//
import Foundation
class FakeBrewFormulaeHandler: HandlesBrewFormulae {
public func loadPhpVersions(loadOutdated: Bool) async -> [BrewFormula] {
return [
BrewFormula(
name: "php",
displayName: "PHP 8.2",
installedVersion: "8.2.3",
upgradeVersion: "8.2.4"
),
BrewFormula(
name: "php@8.1",
displayName: "PHP 8.1",
installedVersion: "8.1.17",
upgradeVersion: nil
),
BrewFormula(
name: "php@8.0",
displayName: "PHP 8.0",
installedVersion: nil,
upgradeVersion: nil
),
BrewFormula(
name: "php@7.4",
displayName: "PHP 7.4",
installedVersion: nil,
upgradeVersion: nil
),
BrewFormula(
name: "php@7.3",
displayName: "PHP 7.3",
installedVersion: nil,
upgradeVersion: nil
),
BrewFormula(
name: "php@7.2",
displayName: "PHP 7.2",
installedVersion: nil,
upgradeVersion: nil
),
BrewFormula(
name: "php@7.1",
displayName: "PHP 7.1",
installedVersion: nil,
upgradeVersion: nil
)
]
}
}

View File

@ -189,6 +189,15 @@ struct PhpFormulaeView: View {
}
public func runCommand(_ command: InstallAndUpgradeCommand) async {
if PhpEnvironments.shared.isBusy {
self.presentErrorAlert(
title: "phpman.action_prevented_busy.title".localized,
description: "phpman.action_prevented_busy.desc".localized,
button: "generic.ok".localized
)
return
}
do {
self.setBusyStatus(true)
try await command.execute { progress in
@ -224,7 +233,7 @@ struct PhpFormulaeView: View {
public func repairAll() async {
await self.runCommand(InstallAndUpgradeCommand(
title: "Repairing installations...",
title: "phpman.operations.repairing".localized,
upgrading: [],
installing: []
))
@ -232,7 +241,7 @@ struct PhpFormulaeView: View {
public func upgradeAll(_ formulae: [BrewFormula]) async {
await self.runCommand(InstallAndUpgradeCommand(
title: "Installing updates...",
title: "phpman.operations.updating".localized,
upgrading: formulae,
installing: []
))
@ -240,7 +249,7 @@ struct PhpFormulaeView: View {
public func install(_ formula: BrewFormula) async {
await self.runCommand(InstallAndUpgradeCommand(
title: "Installing \(formula.displayName)",
title: "phpman.operations.installing".localized(formula.displayName),
upgrading: [],
installing: [formula]
))
@ -349,52 +358,3 @@ struct PhpFormulaeView_Previews: PreviewProvider {
).frame(width: 600, height: 600)
}
}
class FakeBrewFormulaeHandler: HandlesBrewFormulae {
public func loadPhpVersions(loadOutdated: Bool) async -> [BrewFormula] {
return [
BrewFormula(
name: "php",
displayName: "PHP 8.2",
installedVersion: "8.2.3",
upgradeVersion: "8.2.4"
),
BrewFormula(
name: "php@8.1",
displayName: "PHP 8.1",
installedVersion: "8.1.17",
upgradeVersion: nil
),
BrewFormula(
name: "php@8.0",
displayName: "PHP 8.0",
installedVersion: nil,
upgradeVersion: nil
),
BrewFormula(
name: "php@7.4",
displayName: "PHP 7.4",
installedVersion: nil,
upgradeVersion: nil
),
BrewFormula(
name: "php@7.3",
displayName: "PHP 7.3",
installedVersion: nil,
upgradeVersion: nil
),
BrewFormula(
name: "php@7.2",
displayName: "PHP 7.2",
installedVersion: nil,
upgradeVersion: nil
),
BrewFormula(
name: "php@7.1",
displayName: "PHP 7.1",
installedVersion: nil,
upgradeVersion: nil
)
]
}
}

View File

@ -128,6 +128,9 @@ You may be asked for your password during the uninstallation process if file per
%@";
"phpman.action_prevented_busy.title" = "PHP Monitor is currently busy.";
"phpman.action_prevented_busy.desc" = "PHP Monitor is currently doing something like switching between PHP versions. To ensure your system does not break, you will need to wait until PHP Monitor is ready in order before you try this again.";
"phpman.uninstall_prevented.title" = "You cannot uninstall the currently active version of PHP via PHP Monitor.";
"phpman.uninstall_prevented.desc" = "In order to prevent issues with PHP Monitor and further crashes, it isn't possible to uninstall the currently linked version of PHP via this UI. You can switch versions and try again, or uninstall this version manually via the terminal.\n\nPlease note that PHP Monitor may crash if you uninstall the currently linked PHP version.";
@ -138,6 +141,10 @@ You may be asked for your password during the uninstallation process if file per
"phpman.unlinked.desc" = "You likely still have some version of PHP that is currently installed, but currently no version of PHP is linked.";
"phpman.unlinked.detail" = "Without any PHP version linked, the `php` binary is not accessible on your system and you cannot run any PHP scripts without explicitly being part of the PATH. You can have PHP Monitor automatically resolve this problem (choose Fix Automatically in the main menu), or fix it yourself by running `brew link php --force`.";
"phpman.operations.repairing" = "Repairing installations...";
"phpman.operations.updating" = "Installing updates...";
"phpman.operations.installing" = "Installing %@...";
"phpman.steps.fetching" = "Fetching...";
"phpman.steps.downloading" = "Downloading package data...";
"phpman.steps.installing" = "Installing some package data...";
@ -739,7 +746,7 @@ COMMON TROUBLESHOOTING TIPS
• %@
When files like these are missing, it's recommended to reinstall the appropriate PHP version(s) via Homebrew again, which should restore the configuration files that are missing. Missing configuration files can be the reason why you get '502 Bad Gateway' errors, even after running Fix My Valet.";
When files like these are missing, you should switch to the PHP version associated with those files: that may resolve the problem. If this doesn't fix the issue, it's recommended to reinstall the appropriate PHP version(s) via Homebrew again, which should restore the configuration files that are missing. Missing configuration files can be the reason why you get '502 Bad Gateway' errors, even after running Fix My Valet (if you are using Valet).";
"warnings.none" = "There are no recommendations available for you right now. You're all good!";
@ -751,14 +758,14 @@ When files like these are missing, it's recommended to reinstall the appropriate
"onboarding.explore.lite" = "You now have access to PHP Monitor's most important features.
Please note that some features (greyed out below) are currently unavailable because Laravel Valet is not active.";
"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.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, installing different PHP versions, and more.";
"onboarding.tour.faq_hint" = "**Questions?** 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.";
"onboarding.tour.services.title" = "Manage Homebrew Services";
"onboarding.tour.services" = "Once you click on the menu bar item, you can see at a glance based on the checkmarks or crosses if all of the Homebrew services are up and running. You can also click on a service to quickly toggle it.";
"onboarding.tour.domains.title" = "Manage Domains";
"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.isolation" = "If you have Valet 3 or newer 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.feature_unavailable" = "This feature is currently unavailable and requires Laravel Valet to be installed.";
"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";