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

Fix for HeidiSQL from WSL #28

Open sward-hg opened 5 years ago

sward-hg commented 5 years ago

I'm using Terminus from WSL using Pengwin. While trying to get Pancakes to open HeidiSQL, I ran into two problems:

  1. PHP cannot access the mounted C drive, so file_exists() always returns false. I hacked around this by setting the conditional on line 51 of src/App/HeidiSqlApp.php to always return true. This only worked because the first candidate (\Program Files\HeidiSQL\heidisql.exe) is the correct location in my case.
  2. The "start" command was not recognized. I hacked around this by adding "cmd.exe /c " in front of "start /b" on line 26 of src/App/HeidiSqlApp.php.

Once I'd made those adjustments, the plugin worked like a charm. Hopefully someone can come up with less hacky solutions. In the mean time, maybe this will save others with similar setups some trouble.