Closed rvtraveller closed 8 years ago
Awesome, works fine on Mac! Few questions / actions before we merge it in:
1) We gotta update the readme with this 2) Shame we couldn't find the program more easily, we should probably at least use the little used environment variable for program files (http://www.rapidee.com/en/environment-variables). It probably won't work if someone installs it through choco or somewhere else, but it's fine for now I'd say. 3) More of a curiosity, do we need to call escapeshellcmd? If someone had a double-quote in their password would it error out?
Hmm. I like the idea of using environment variables for program files but they aren't working correctly on my system:
$possible_heidi_locations = array(
getenv('PROGRAMFILES') . '\HeidiSQL\heidisql.exe',
getenv('PROGRAMFILES(X86)') . '\HeidiSQL\heidisql.exe',
getenv('TERMINUS_PANCAKES_HEIDISQL_LOC'),
);
var_dump($possible_heidi_locations);
Yields the output:
array(3) {
[0] =>
string(44) "C:\Program Files (x86)\HeidiSQL\heidisql.exe"
[1] =>
string(44) "C:\Program Files (x86)\HeidiSQL\heidisql.exe"
[2] =>
bool(false)
}
1) Readme updated with a note that it handles both Mac and Windows. Also added a line about using the custom environment variable if your HeidiSQL is in a non-standard location. 2) See comment above regarding environment variables. Maybe the solution here is to leave the hard coded options but also try to pull from environment variables so we cover all our bases? 3) Added escaping, just in case usernames/passwords/hostnames start to get interesting.
This should work for now, will cover most of the cases, LGTM!
This adds support for opening MySQL connections to Pantheon via HeidiSQL and Terminus. @derimagia -- can you confirm I didn't break Mac with this change?
The only negative about this is that it doesn't release the user's terminal back for more input until after HeidiSQL has been closed. I tried a couple things to get around this but didn't seem to have much luck.