mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-09 13:10:24 +01:00
✨ Switch Xdebug mode
This commit is contained in:
@@ -15,7 +15,11 @@ class Xdebug {
|
||||
}
|
||||
|
||||
public static var mode: String {
|
||||
return Command.execute(path: Paths.php, arguments: ["-r", "echo ini_get('xdebug.mode');"])
|
||||
guard let file = PhpEnv.shared.getConfigFile(forKey: "xdebug.mode") else {
|
||||
return ""
|
||||
}
|
||||
|
||||
return file.get(for: "xdebug.mode") ?? ""
|
||||
}
|
||||
|
||||
public static var modes: [String] {
|
||||
|
||||
@@ -174,4 +174,14 @@ class PhpEnv {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the configuration file instance that is used for a specific config value.
|
||||
You can then use the configuration file instance to change values.
|
||||
*/
|
||||
public func getConfigFile(forKey key: String) -> PhpConfigurationFile? {
|
||||
return PhpEnv.phpInstall.iniFiles
|
||||
.reversed()
|
||||
.first(where: { $0.has(key: key) })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user