【问题标题】:Can PhpStorm resolve mod_rewrite rules in .htaccess when doing code analysis?PhpStorm 在进行代码分析时可以解析 .htaccess 中的 mod_rewrite 规则吗?
【发布时间】:2015-05-10 00:10:34
【问题描述】:

我的 PHP 项目中有一堆 mod_rewrite 规则。当我提交到 git PhpStorm 对我提交的内容运行代码分析时,这很棒,但它会产生一堆警告,因为链接指向重写的 URL,而不是实际的 PHP 文件,例如:

Warning:(103, 71) Cannot resolve file 'contact'

对于这样的链接:

<a href="/contact">get in touch</a>

有没有办法让 PhpStorm 解决我的 .htaccess 文件中的重写规则?如果做不到这一点,我该如何关闭此检查?我尝试取消选中 Preferences &gt; Editor &gt; Inspections &gt; HTML &gt; Anchor reference problems,但仍然收到警告。

【问题讨论】:

    标签: .htaccess mod-rewrite phpstorm


    【解决方案1】:

    有没有办法让 PHPStorm 解决我的 .htaccess 文件中的重写规则?

    没有。

    https://youtrack.jetbrains.com/issue/WI-1032 -- 观看这张票(星号/投票/评论)以获取进度通知。

    如果不这样做,我该如何关闭此检查?我尝试取消选中 Preferences > Editor > Inspections > HTML > Anchor reference questions,但我仍然收到警告。

    正确的是“Inspections | HTML | File reference questions”

    【讨论】:

    • 指定的工单现在处于“已验证”状态。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-25
    • 1970-01-01
    • 2010-09-07
    相关资源
    最近更新 更多