terminus-plugin-project / terminus-pancakes-plugin

Terminus Plugin to open Pantheon Site Databases in your Favorite SQL Client
MIT License
26 stars 20 forks source link

Figure out how to handle 32 bit PHP on 64 bit Windows #5

Open rvtraveller opened 8 years ago

rvtraveller commented 8 years ago

4 added support for using HeidiSQL on Windows. Windows doesn't have an open command like Mac does and given how Windows tracks executables, we actually need to know the full file path to Heidi in order to run it. Right now, that is accomplished by hard coding possible Program Files folders and checking each of them. Ideally, we would pull the Program Files path from an environment variable (PROGRAMFILES and PROGRAMFILES(X86). When I tried that in #4 it didn't produce the right results as both environment variables pointed to the 32 bit folders.

This is because I'm running a 32 bit version of PHP on a 64 bit machine (testable by running php -r var_dump(PHP_INT_SIZE); and seeing if it is 4 or 8. We should try and figure out a long term solution for this so PHP sees both the 32 bit and 64 bit directories regardless of PHP version.

rvtraveller commented 8 years ago

Here are some good references with what I believe to be a possible solution:

http://stackoverflow.com/a/9608782 http://stackoverflow.com/a/27720921