mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 20:10:08 +02:00
Depending on the installation status, PHP Monitor should be able to find out which versions of PHP can be installed and removed.
71 lines
1.9 KiB
Swift
71 lines
1.9 KiB
Swift
//
|
|
// MainMenuBuilder.swift
|
|
// PHP Monitor
|
|
//
|
|
// Copyright © 2023 Nico Verbruggen. All rights reserved.
|
|
//
|
|
|
|
import Cocoa
|
|
|
|
class StatusMenu: NSMenu {
|
|
func addMenuItems() {
|
|
addPhpVersionMenuItems()
|
|
addItem(NSMenuItem.separator())
|
|
|
|
if PhpEnv.phpInstall != nil && Preferences.isEnabled(.displayGlobalVersionSwitcher) {
|
|
addPhpActionMenuItems()
|
|
addItem(NSMenuItem.separator())
|
|
}
|
|
|
|
if PhpEnv.phpInstall != nil && Valet.installed && Preferences.isEnabled(.displayServicesManager) {
|
|
addServicesManagerMenuItem()
|
|
addItem(NSMenuItem.separator())
|
|
}
|
|
|
|
if Valet.shared.version != nil && Preferences.isEnabled(.displayValetIntegration) {
|
|
addValetMenuItems()
|
|
addItem(NSMenuItem.separator())
|
|
}
|
|
|
|
if PhpEnv.phpInstall != nil && Preferences.isEnabled(.displayPhpConfigFinder) {
|
|
addConfigurationMenuItems()
|
|
addItem(NSMenuItem.separator())
|
|
}
|
|
|
|
if PhpEnv.phpInstall != nil && Preferences.isEnabled(.displayComposerToolkit) {
|
|
addComposerMenuItems()
|
|
addItem(NSMenuItem.separator())
|
|
}
|
|
|
|
if PhpEnv.shared.isBusy {
|
|
return
|
|
}
|
|
|
|
if PhpEnv.phpInstall != nil && Preferences.isEnabled(.displayLimitsWidget) {
|
|
addStatsMenuItem()
|
|
addItem(NSMenuItem.separator())
|
|
}
|
|
|
|
if PhpEnv.phpInstall != nil && Preferences.isEnabled(.displayExtensions) {
|
|
addExtensionsMenuItems()
|
|
NSMenuItem.separator()
|
|
|
|
addXdebugMenuItem()
|
|
}
|
|
|
|
addPhpDoctorMenuItem()
|
|
|
|
if PhpEnv.phpInstall != nil && Preferences.isEnabled(.displayPresets) {
|
|
addPresetsMenuItem()
|
|
}
|
|
|
|
if PhpEnv.phpInstall != nil && Preferences.isEnabled(.displayMisc) {
|
|
addFirstAidAndServicesMenuItems()
|
|
}
|
|
|
|
addItem(NSMenuItem.separator())
|
|
|
|
addCoreMenuItems()
|
|
}
|
|
}
|