Skip to content

Add remote debug section in tips. #13

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
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/_sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ dl.dl_inline {
padding-left: 1em;
padding-right: 1em;
};

img {
max-width: 100%;
}
}

.site-aside {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

Binary file added assets/images/hit-breakpoint-vsc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/listen-xdebug-vsc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/set-breakpoint-vsc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,48 @@ This will create a new container `test`. If you already have a container to down
</div>

This will force download WordPress 3.5 to the running container using the `wocker wp` command. After this finishes successfully, you will have a WordPress 3.5 environment if you visit [http://wocker.dev](http://wocker.dev). You can change `3.5` to any version you want.

## Use Remote Debug

There are supported clients list in [Step Debugging](https://xdebug.org/docs/remote) document by Xdebug official.

### 1. setting IDE or Editor

Listen port 9000.
Remote path for WordPress is `/var/www/wordpress`.

Example, setteings for Visual Studio Code.
data\wocker\wp-content\\.vscode\launch.json

<div class="highlight">
<pre><code data-lang="json" class="language-json">
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings":{
"/var/www/wordpress/wp-content":"${workspaceFolder}"
}
},
]
</code></pre>
</div>

### 2. Set breakpoint in IDE

Example Visual Studio Code.
![Set breakpoint, example Visual Studio Code]({{site.baseurl}}/assets/images/set-breakpoint-vsc.png)

### 3. Set mode of IDE to listen XDebug

![Listen XDebug, example Visual Studio Code]({{site.baseurl}}/assets/images/listen-xdebug-vsc.png)

### 4. Start debug session by access

Access `http://wocker.test/?XDEBUG_SESSION_START` or using browser addon.
See "Using a browser extension" section in [Step Debugging](https://xdebug.org/docs/remote) page Xdebug official.

### 5. Hit breakpoint
![Hit breakpoint]({{site.baseurl}}/assets/images/hit-breakpoint-vsc.png)