Sublime Text 3 php-fmt 不起作用
Sublime Text 3 php-fmt won't work
我正在尝试使用 ST3 的 php-fmt 插件,我安装了它,但是当我使用按键时它没有做任何事情。
我认为我已正确设置所有内容,但 php 文件没有任何格式。
我可以在命令行上使用 PHP ...我遵循了设置。
我在 OSX,使用 MAMP php 5.5.10
如果我使用命令 'analyze'
我收到消息
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 代码
谢谢!
在菜单上转到首选项 > 包设置 > phpfmt > 设置 - 用户
编辑将在上一个操作的结果中打开的文件。
根据您的 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
}
此答案适用于较新版本。
SublimeText 3 和 PHPfmt 4
在菜单上转到首选项 > 包设置 > phpfmt > 设置 - 用户
并添加以下代码,请确保 PHP >= 5.6 安装在路径 C:/php/php.exe 上,或者您可以替换为下面的 PHP.exe 路径:
{
"version": 4,
"php_bin":"C:/php/php.exe",
"format_on_save":true,
}
我正在尝试使用 ST3 的 php-fmt 插件,我安装了它,但是当我使用按键时它没有做任何事情。 我认为我已正确设置所有内容,但 php 文件没有任何格式。 我可以在命令行上使用 PHP ...我遵循了设置。 我在 OSX,使用 MAMP php 5.5.10
如果我使用命令 'analyze' 我收到消息
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 代码 谢谢!
在菜单上转到首选项 > 包设置 > phpfmt > 设置 - 用户
编辑将在上一个操作的结果中打开的文件。
根据您的 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
}
此答案适用于较新版本。
SublimeText 3 和 PHPfmt 4
在菜单上转到首选项 > 包设置 > phpfmt > 设置 - 用户 并添加以下代码,请确保 PHP >= 5.6 安装在路径 C:/php/php.exe 上,或者您可以替换为下面的 PHP.exe 路径:
{
"version": 4,
"php_bin":"C:/php/php.exe",
"format_on_save":true,
}