-
Notifications
You must be signed in to change notification settings - Fork 6
Home
CakephpWhoops plugin | branch | CakePHP core | PHP min |
---|---|---|---|
0.x [EOL] | cake3 | 3.x | PHP 5.6 |
1.x | cake4 | 4.x | PHP 7.2 |
2.x | master | 5.x | PHP 8.1 |
Install the package aur/phpstorm-url-handler
. See below for Firefox.
This was tested on Linux Mint but should apply for any modern desktop. Please feel free to add instructions for your distribution, e.g. Ubuntu.
First test if your PHPStorm version can open files via CLI. For that you just find your path to the installed PHPStorm folder and try to open a file on a specific line:
/locale/path/to/PhpStorm/bin/phpstorm.sh --line {line} {filepath}
It should jump to your IDE and open exactly that line.
Note that the file path has to be an absolute path on your host system (not inside any VM).
This will serve the incoming browser click and execute the above sh script.
#!/usr/bin/env bash
# PhpStorm URL Handler
#
# phpstorm://open?file=@file&line=@line
# Adapted from https://github.com/sanduhrs/phpstorm-url-handler
#
# @license GPL
# @author Stefan Auditor <[email protected]>
arg=${1}
# Get the file path.
file=$(echo "${arg}" | sed -r 's/.*file=(.*)&line=.*/\1/')
# Get the line number.
line=$(echo "${arg}" | sed -r 's/.*file=.*&line=(.*)/\1/')
/locale/path/to/PhpStorm/bin/phpstorm.sh --line "${line}" "${file}"
Note: you can also use /usr/bin/env pstorm
instead of the sh file (or even /usr/bin/env phpstorm
on older IDE versions).
In general, you can adapt and install this .desktop file via desktop-file-install phpstorm-url-handler.desktop && update-desktop-database
, or add the protocol to your browser directly (which is absolutely needed in Firefox, see below).
Important for Firefox is, that you enable the the phpstorm://
protocol via about:config
. To enable the PHPStorm protocol, add a new boolean value for network.protocol-handler.expose.phpstorm
and keep the default value false
.
(who wants to do that?)
(who wants to do that?)