Skip to content

Add remote path mapping for VIP sites on Lando #954

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

Merged
merged 1 commit into from
Apr 23, 2025
Merged
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
8 changes: 6 additions & 2 deletions docs/help/clickable-stack-traces-and-function-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ If you're debugging a remote site or using Docker or a virtual machine, you'll n

Here are examples for various local development environments:

### Altis
### Altis local server

No need to do anything, the path mapping is handled automatically.

### WordPress core
### WordPress core development environment

No need to do anything, the path mapping is handled automatically.

### WordPress VIP on Lando

No need to do anything, the path mapping is handled automatically.

Expand Down
15 changes: 13 additions & 2 deletions output/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,22 @@ public static function get_file_link_format() {
public static function get_file_path_map() {
$map = array();

// WordPress core and Altis:
$host_path = getenv( 'HOST_PATH' );

if ( ! empty( $host_path ) ) {
$source = rtrim( ABSPATH, DIRECTORY_SEPARATOR );
$replacement = rtrim( $host_path, DIRECTORY_SEPARATOR );
$source = ABSPATH;
$replacement = trailingslashit( $host_path );
$map[ $source ] = $replacement;
}

// WordPress VIP on Lando:
$lando_path = getenv( 'VIP_DEV_AUTOLOGIN_KEY' ) ? getenv( 'LANDO_APP_ROOT_BIND' ) : null;

if ( ! empty( $lando_path ) ) {
// https://github.com/Automattic/vip-cli/blob/2bf64a46b9d409a5683459d032d65c16a6eeac48/assets/dev-env.lando.template.yml.ejs#L288
$source = ABSPATH;
$replacement = trailingslashit( $lando_path ) . 'wordpress/';
$map[ $source ] = $replacement;
}

Expand Down