-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: 🔥 Remove broken log 🔧 Version bump 🚧 WIP: Adds support to PHP 7.4 ⚡️ Use Command.execute to retrieve PHP version 🚧 WIP: Add toggle to enable or disable Xdebug 📝 Update readme
- Loading branch information
Showing
11 changed files
with
181 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// Command.swift | ||
// PHP Monitor | ||
// | ||
// Created by Nico Verbruggen on 17/10/2019. | ||
// Copyright © 2019 Nico Verbruggen. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
class Command { | ||
|
||
public static func execute(path: String, arguments: [String]) -> String { | ||
let task = Process() | ||
task.launchPath = path | ||
task.arguments = arguments | ||
|
||
let pipe = Pipe() | ||
task.standardOutput = pipe | ||
task.launch() | ||
|
||
let data = pipe.fileHandleForReading.readDataToEndOfFile() | ||
let output: String = String.init(data: data, encoding: String.Encoding.utf8)! | ||
return output; | ||
} | ||
|
||
public static func experiment() { | ||
/* | ||
print("Running '/usr/local/bin/php -v' directly...") | ||
print("========================================") | ||
var start = DispatchTime.now() | ||
print(Command.execute(path: "/usr/local/bin/php", arguments: ["-v"])) | ||
var end = DispatchTime.now() | ||
var nanoTime = end.uptimeNanoseconds - start.uptimeNanoseconds | ||
var timeInterval = Double(nanoTime) / 1_000_000_000 | ||
print("Time to run command directly: \(timeInterval) seconds") | ||
|
||
print("") | ||
print("Running 'bash -> php -v'...") | ||
print("========================================") | ||
start = DispatchTime.now() | ||
print(Shell.user.pipe("php -v")) | ||
end = DispatchTime.now() | ||
nanoTime = end.uptimeNanoseconds - start.uptimeNanoseconds | ||
timeInterval = Double(nanoTime) / 1_000_000_000 | ||
print("Time to run command via bash: \(timeInterval) seconds") | ||
*/ | ||
} | ||
|
||
} |
Oops, something went wrong.