xwp / wp-cli-ssh

[OBSOLETE] Seamlessly run WP-CLI commands on a remote server via SSH
157 stars 14 forks source link

Custom php interpreter support #27

Closed timneutkens closed 8 years ago

timneutkens commented 8 years ago

Attempt at providing support for different php interpreters. Uses a subshell at the moment. I'm not quite certain that that is the way to go in bash. But if you want to use wp-cli like: /usr/bin/php wp . you have to specify a file path like: /usr/bin/php /path/to/wp . Otherwise it will throw a no input file specified error.

westonruter commented 8 years ago

What about adding something like a wpcli_binary_path config instead of using $(command -v wp)? I suppose the latter would still be needed if wpcli_binary_path is empty while php_interpreter is not empty.

timneutkens commented 8 years ago

Did a rework on this one. Combined your thoughts on it with mine. Added a new options called wpcli_binary_path in which you can specify the wp-cli command to be executed. So if you want to use a custom php interpreter it is possible. You also don't have the clutter of 2 options in the code. I tweaked the original bash script a bit. It is now only used to detect or install wp-cli if no wpcli_binary_path is set.

timneutkens commented 8 years ago

I renamed wpcli_binary_path to wpcli_command.

westonruter commented 8 years ago

👍 good work

timneutkens commented 8 years ago

@westonruter Thanks! Been needing this to execute the following gist: https://gist.github.com/timneutkens/32c9bcd7d8576e663958ed4b1389c1dc

westonruter commented 8 years ago

@timneutkens please see conversation at https://github.com/wp-cli/wp-cli/pull/2755

westonruter commented 8 years ago

Specifically at https://github.com/wp-cli/wp-cli/pull/2755#discussion_r63400131

timneutkens commented 8 years ago

Will take a look tomorrow. Thanks for Referencing!