【问题标题】:Sublime Text 3 php-fmt won't workSublime Text 3 php-fmt 不起作用
【发布时间】:2015-03-30 15:57:37
【问题描述】:

我正在尝试为 ST3 使用 php-fmt 插件,我安装了它,但是当我使用密钥时它什么也没做。 我认为我正确设置了所有内容,但 php 文件没有任何格式。 我可以在命令行上使用 PHP ......我按照设置进行操作。 我在 OSX 上,使用 MAMP php 5.5.10

如果我使用命令“分析” 我收到消息

Autocomplete and autoimport need building a database of terms.
Please, fill in below with the proper location for this database.
Keep in mind that the best location is always the root of the project, therefore limiting the size and ensuring speed.

如果您知道为什么它不起作用,请提供帮助或提出替代 PHP 代码格式的建议 谢谢!

【问题讨论】:

    标签: php sublimetext3


    【解决方案1】:

    在菜单上转到 Preferences > Package Settings > phpfmt > Settings - User

    编辑将在上一个操作的结果中打开的文件。

    根据你的php二进制位置指定“php_bin”,

    它应该包含如下内容:

    {
        "enable_auto_align": false,
        "indent_with_space": true,
        "passes":
        [
        ],
        "php_bin": "/Applications/MAMP/bin/php/php5.5.10/bin/php",
        "psr1": true,
        "psr2": true,
        "version": 2
    

    }

    【讨论】:

      【解决方案2】:

      此答案适用于较新版本。

      SublimeText 3 和 PHPfmt 4

      在菜单上转到 Preferences > Package Settings > phpfmt > Settings - User 并添加以下代码,请确保 PHP >= 5.6 安装在路径 C:/php/php.exe 或您可以替换为下面的 PHP.exe 路径:

      {
       "version": 4,
       "php_bin":"C:/php/php.exe",
       "format_on_save":true,
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-08-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-05-14
        • 1970-01-01
        • 2014-03-31
        • 1970-01-01
        相关资源
        最近更新 更多