New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open Files in IDE in a container or in a virtual machine #175
Comments
have you seen https://github.com/yiisoft/yii2-debug#open-files-in-ide ? |
@dynasource Yes, of course. The difference is that I need some thing like this
|
have you tried using the callback https://github.com/yiisoft/yii2-debug/blob/master/Panel.php#L134 |
@dynasource No because don't know how to use it properly |
So, I want to do this with Sublime Text, and I have the same problem - I run my code in docker, and the path to the app is different within the container than outside it. Would be great if there was a base path option, defaulting to just whatever the app sees, and overridable by a string in the module config. I'm pretty sure this is more than just a documentation task, I think the module itself should have a new property, something like Something like this, in if($this->module->debugBasePath && is_string($this->module->debugBasePath)) {
$options['file'] = str_replace(Yii::$app->basePath, $this->module->debugBasePath, $options['file']);
} And in my config, something like this: [
'class' => 'yii\debug\Module',
'traceLine' => '<a href="subl://{file}:{line}">{text}</a>',
'debugBasePath' => '/home/myname/myapp',
] ... I guess I could toss together a PR, I'm already half-way there in implementing it 😆 |
Apparently, according to #267 (comment), you can do the following instead of my proposed PR: 'traceLine' => function($options, $panel) {
$filePath = str_replace(Yii::$app->basePath, '/home/myname/myapp', $options['file']);
return strtr('<a href="subl://{file}:{line}">{text}</a>', ['{file}' => $filePath]);
}, This should probably be documented. |
Working on VM (vagrant) and want to open files in PHPstorm on my host machine. But I can't because path is not right.
Guys from symfony made it in their framework docs at the end of ide section
The text was updated successfully, but these errors were encountered: