1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-09 13:10:24 +01:00

👌 Handle multiple modes w/ Xdebug menu item

This commit also fixes the width of the header items.
This commit is contained in:
2022-05-19 19:06:03 +02:00
parent e7f80ebce8
commit db8197df3d
7 changed files with 39 additions and 18 deletions

View File

@@ -11,20 +11,23 @@ import Foundation
class Xdebug {
public static var enabled: Bool {
return !self.mode.isEmpty
return PhpEnv.shared.getConfigFile(forKey: "xdebug.mode") != nil
}
public static var mode: String {
public static var activeModes: [String] {
guard let file = PhpEnv.shared.getConfigFile(forKey: "xdebug.mode") else {
return ""
return []
}
return file.get(for: "xdebug.mode") ?? ""
guard let value = file.get(for: "xdebug.mode") else {
return []
}
return value.components(separatedBy: ",").filter { self.modes.contains($0) }
}
public static var modes: [String] {
return [
"off",
"develop",
"coverage",
"debug",