私のプロジェクトでは、例外の場合に例外スタックトレースを表示する特別な JSP があります。
Eclipse でファイルを開く URL ハンドラなどを使用する方法はありますか? たぶんxdg-open
?
Kubuntu Linux で Eclipse 4.3 を使用しています。
私はこの解決策に行き着きました:
編集xdebug.ini
(のような場所にする必要があります/etc/php/7.0/mods-available/xdebug.ini
)、追加:
xdebug.file_link_format="xdebug://%f(%l)"
サーバーまたは php-fpm を再起動します。Ubuntu 上の Apache の場合は、sudo service apache2 restart
.
を作成しますeclipse-launch.sh
。URL を解析し、ファイルを Eclipse に渡すことを目的としています。好きな名前を付けて、好きな場所に置くことができます。私は eclise ディレクトリに配置しました。/home/user
必ず実際のホーム ディレクトリとpath="..."
実際の Eclipse パスに置き換えてください。
#! /bin/bash
arg=$1
path="/home/user/eclipse/eclipse-neon/"
# file name directly followed by a line number in parenthesis
regex="//([^(]*)\(([0-9]+)\)"
if [[ $arg =~ $regex ]]
then
file=${BASH_REMATCH[1]}
line=${BASH_REMATCH[2]}
$path/eclipse --launcher.openFile "$file"+"$line"
else
msg="Unsupported URL: $arg"
zenity --info --text="$msg"
# alternatives:
# notify-send "$msg" # another notification program
# $path/eclipse # just run eclipse
fi
Eclipse コマンド ライン オプションの詳細については、http: //help.eclipse.org/mars/index.jsp?topic= /org.eclipse.platform.doc.isv/guide/product_open_file.htm を参照してください。
ファイルに実行権限を付与します。chmod +a eclipse-launch.sh
で作成xdebug.desktop
し~/.local/share/applications/
ます。によって使用されxdg-open
ます (Chrome はデフォルトで xdg-open を使用します)。
[Desktop Entry]
Comment=
Exec=/home/user/eclipse/eclipse-neon/eclipse-launch.sh "%u"
Icon=/home/user/eclipse/eclipse-neon/eclipse/icon.xpm
Name=Eclipse xdebug Launch
NoDisplay=false
StartupNotify=true
Terminal=0
TerminalOptions=
Type=Application
MimeType=x-scheme-handler/xdebug;
実行しますxdg-mime default xdebug.desktop x-scheme-handler/xdebug
。これにより、セクションにエントリが追加さ~.local/share/applications/mimeapps.list
れ[Default Applications]
ます。エントリ自体は次のようになりますx-scheme-handler/xdebug=xdebug.desktop
Firefox の場合は、次の手順に従ってください: https://xdebug.org/docs/all_settings#file_link_format
about:config
network.protocol-handler.expose.xdebug
て、false