vincecore/ide-link-bundle

修复使用虚拟机时IDE链接

安装次数: 1,243

依赖项: 0

建议者: 0

安全性: 0

星标: 2

关注者: 3

分支: 0

开放问题: 0

类型:symfony-bundle

v1.0.0 2016-02-06 17:27 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:37:19 UTC


README

此包将修复在虚拟机使用时链接到您的IDE的文件路径。请参阅https://symfony.com.cn/doc/current/reference/configuration/framework.html#ide。它所做的只是允许您定义“错误的路径”并将其替换为“正确的路径”。

安装

步骤1:使用composer下载

$ php composer.phar require vincecore/ide-link-bundle "dev-master" --dev

Composer将安装包到您的项目的vendor/vincecore目录。

步骤2:启用包

在内核中启用包

<?php
// app/AppKernel.php

public function registerBundles()
{
    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        $bundles[] = new Vincecore\IdeLinkBundle\VincecoreIdeLinkBundle();
    }
}

步骤3:配置参数

// app/config/parameters.yml.dist
# This file is a "template" of what your parameters.yml file should look like
parameters:
    //
    ide_link.wrong_path: ~
    ide_link.correct_path: ~
    
// app/config/parameters.yml (example)
parameters:
    //
    ide_link.wrong_path: "/vagrant"
    ide_link.correct_path: "/Users/john/projects/acme"
    

步骤4:配置Symfony(phpstorm示例)

请参阅https://symfony.com.cn/doc/current/reference/configuration/framework.html#ide

// app/config/config.yml
framework:
    //
    ide: "phpstorm://open?file=%%f&line=%%l"