Skip to content

Commit

Permalink
Fixes #175: Add documentation for traceLine [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie authored and samdark committed Oct 9, 2017
1 parent da52085 commit cfdd6f0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,18 @@ return [
];
```

You must make some changes to your OS, see this example: https://github.com/aik099/PhpStormProtocol
You must make some changes to your OS. See these examples:
- PHPStorm: https://github.com/aik099/PhpStormProtocol
- Sublime Text 3 on Windows or Linux: https://packagecontrol.io/packages/subl%20protocol
- Sublime Text 3 on Mac: https://github.com/inopinatus/sublime_url

#### Virtualized or dockerized

If your application is run under a virtualized or dockerized environment, it is often the case that the application's base path is different inside of the virtual machine or container than on your host machine. For the links work in those situations, you can configure `traceLine` like this (change the path to your app):

```php
'traceLine' => function($options, $panel) {
$filePath = str_replace(Yii::$app->basePath, '~/path/to/your/app', $options['file']);
return strtr('<a href="ide://open?url=file://{file}&line={line}">{text}</a>', ['{file}' => $filePath]);
},
```
11 changes: 11 additions & 0 deletions docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,17 @@ IDE links for traces are created by default. You have to set the property `yii\d
...
```

### Virtualized or dockerized

If your application is run under a virtualized or dockerized environment, it is often the case that the application's base path is different inside of the virtual machine or container than on your host machine. For the links work in those situations, you can configure `traceLine` like this (change the path to your app):

```php
'traceLine' => function($options, $panel) {
$filePath = str_replace(Yii::$app->basePath, '~/path/to/your/app', $options['file']);
return strtr('<a href="ide://open?url=file://{file}&line={line}">{text}</a>', ['{file}' => $filePath]);
},
```

### Switching Users

You can use log in as any user and reset to back to your primary user. In order to enable the feature you need to configure access permissions in the `UserPanel` config. By default access is denied to everyone.
Expand Down

0 comments on commit cfdd6f0

Please sign in to comment.