1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-07 21:20:07 +01:00

🐛 Fixes #3: Bad Gateway caused by valet use

Note: The terminal output work-in-progress is currently disabled in this
particular commit.
This commit is contained in:
2019-07-08 10:43:56 +02:00
parent 78702ae325
commit 1bfcdd546b
5 changed files with 39 additions and 3 deletions

View File

@@ -73,6 +73,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
// Actions
menu.addItem(NSMenuItem.separator())
menu.addItem(NSMenuItem(title: "Open php.ini in Finder", action: #selector(self.openActiveConfigFolder), keyEquivalent: ""))
// OPTIONAL
// menu.addItem(NSMenuItem(title: "Restart PHP \(self.version!.short) service", action: #selector(self.restartPhp), keyEquivalent: ""))
}
menu.addItem(NSMenuItem.separator())
@@ -92,7 +93,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
menu.addItem(NSMenuItem(title: "Switching PHP versions...", action: nil, keyEquivalent: ""))
menu.addItem(NSMenuItem.separator())
}
menu.addItem(NSMenuItem(title: "View terminal output...", action: #selector(self.openOutput), keyEquivalent: ""))
// TODO: Enable when implementation is complete
// menu.addItem(NSMenuItem(title: "View terminal output", action: #selector(self.openOutput), keyEquivalent: ""))
menu.addItem(NSMenuItem(title: "About phpmon", action: #selector(self.openAbout), keyEquivalent: ""))
menu.addItem(NSMenuItem(title: "Quit phpmon", action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q"))
DispatchQueue.main.async {

26
phpmon/Constants.swift Normal file
View File

@@ -0,0 +1,26 @@
//
// Constants.swift
// phpmon
//
// Created by Nico Verbruggen on 08/07/2019.
// Copyright © 2019 Nico Verbruggen. All rights reserved.
//
import Cocoa
class Constants {
/**
* The PHP versions supported by this application.
*/
static let SupportedPhpVersions = [
"5.6", "7.0", "7.1", "7.2", "7.3"
]
/**
Which php version is aliased as `php` to brew?
This is usually the latest PHP version.
*/
static let LatestPhpVersion = "7.3"
}

View File

@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>10</string>
<key>LSApplicationCategoryType</key>

View File

@@ -41,7 +41,11 @@ class Services {
}
if (availableVersions.contains("7.3")) {
_ = Shell.execute(command: "brew link php@7.3")
_ = Shell.execute(command: "valet use php@\(version)")
if (version == Constants.LatestPhpVersion) {
_ = Shell.execute(command: "valet use php")
} else {
_ = Shell.execute(command: "valet use php@\(version)")
}
}
}