1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-25 02:31:25 +02:00

Support editors when php.ini not available (#543)

This commit is contained in:
erikn69
2023-08-18 12:41:05 -05:00
committed by GitHub
parent 48c36d158b
commit 8ed07eb4f0

View File

@@ -189,6 +189,39 @@ abstract class DataCollector implements DataCollectorInterface
return $this->xdebugLinkTemplate;
}
/**
* @param string $editor
*/
public function setEditorLinkTemplate($editor)
{
$editorLinkTemplates = array(
'sublime' => 'subl://open?url=file://%f&line=%l',
'textmate' => 'txmt://open?url=file://%f&line=%l',
'emacs' => 'emacs://open?url=file://%f&line=%l',
'macvim' => 'mvim://open/?url=file://%f&line=%l',
'phpstorm' => 'phpstorm://open?file=%f&line=%l',
'phpstorm-remote' => 'javascript:let r=new XMLHttpRequest;' .
'r.open("get","http://localhost:63342/api/file/%f:%l");r.send()',
'idea' => 'idea://open?file=%f&line=%l',
'idea-remote' => 'javascript:let r=new XMLHttpRequest;' .
'r.open("get","http://localhost:63342/api/file/?file=%f&line=%l");r.send()',
'vscode' => 'vscode://file/%f:%l',
'vscode-insiders' => 'vscode-insiders://file/%f:%l',
'vscode-remote' => 'vscode://vscode-remote/%f:%l',
'vscode-insiders-remote' => 'vscode-insiders://vscode-remote/%f:%l',
'vscodium' => 'vscodium://file/%f:%l',
'nova' => 'nova://core/open/file?filename=%f&line=%l',
'xdebug' => 'xdebug://%f@%l',
'atom' => 'atom://core/open/file?filename=%f&line=%l',
'espresso' => 'x-espresso://open?filepath=%f&lines=%l',
'netbeans' => 'netbeans://open/?f=%f:%l',
);
if (is_string($editor) && isset($editorLinkTemplates[$editor])) {
$this->setXdebugLinkTemplate($editorLinkTemplates[$editor]);
}
}
/**
* @param string $xdebugLinkTemplate
* @param bool $shouldUseAjax