我正在使用 PHPstorm,我想从 git 索引中删除隐藏文件夹 .idea。当我使用$git status我得到
C:\Program Files (x86)\Ampps\www\1stenglish IS [master +1 ~0 -0 !]> git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .idea/
nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)
但是当我想用命令从 git index 中删除它时,git rm --cached .idea/我得到了错误
fatal: pathspec '.idea' did not match any files
Run Code Online (Sandbox Code Playgroud)
我尝试了不同的路径选项,但没有结果:
git rm --cached .idea
git rm --cached .idea/* …Run Code Online (Sandbox Code Playgroud) 有没有办法通过上下文菜单将三元赋值重构为用if-else块完成的赋值?
所以,例如你会有这样的事情:
$a = ($b > -32)? "up" : "down";
Run Code Online (Sandbox Code Playgroud)
然后,您将应用此转换,PHPStorm 会神奇地将其更改为:
if ($b > -32) {
$a = "up";
} else {
$a = "down";
}
Run Code Online (Sandbox Code Playgroud)
似乎是一个非常常见且易于自动化的操作,因此它必须在这个迷宫般的菜单中的某个地方实现自动化。
我正在用Symfony2和构建一个项目Twig templates。一切都运行良好,但是当我尝试使用XDebug它时,一切都停止了。页面加载需要 30 秒或更长时间,并且经常超时,即使页面非常简单。
有没有办法使用的方式XDebug与Symfony2和Twig,并将它以可接受的速度运行?
我已经看到很多建议说只是禁用 xdebug,但我真的不想这样做。
我的应用程序运行在一个Ubuntu 14.04 Vagrant box和我使用PhpStorm的OSX。
出于某种原因,我看不到该node_modules文件夹。当我在资源管理器上打开项目时,文件夹node_modules在那里,所以我 100% 确定它在那里。我试图使缓存无效并重新启动 PhpStorm,甚至删除.idea它仍然隐藏的文件夹(我也没有看到)。在项目设置中,我已经启用了该Show Excluded Files选项。我尝试全新安装该程序,但仍未显示。
如何使文件夹node_modules可见?
我正在使用Ubuntu.
如何在单击Ctrl + Alt + Shift + L重新格式化代码时告诉PhpStorm 2017.3保留以下数组:
<?php
return [
'page_not_found' => 'Page not Found',
'message_required' => 'Please enter your message',
];
Run Code Online (Sandbox Code Playgroud)
对此
<?php
return [
'page_not_found' => 'Page not Found',
'message_required' => 'Please enter your message',
];
Run Code Online (Sandbox Code Playgroud) 看了半个小时。他们的在线文档已过时。与PhpStorm有关的最简单操作的糟糕文档!
进行此类更改的界面绝对不是直观的。
尝试向他们抱怨-他们不在乎。
我的开发环境是: - MacOs High Sierra - PhpStorm - PHP 5.6 - Apache 2.4 - Xdebug 2.5.5
xdebug的php配置文件:
[xdebug]
zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_mode=jit
xdebug.remote_autostart=1
xdebug.remote_handler = dbgp
xdebug.force_display_errors=1
xdebug.idekey="PHPSTORM"
xdebug.remote_enable=1
xdebug.show_error_trace=1
xdebug.remote_log="/Users/user/www/xdebug_remote.log"
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/Users/user/www/xdebug_profiler"
Run Code Online (Sandbox Code Playgroud)
在PHPStorm调试验证工具中,似乎所有内容都已启动并运行:
xdebug调试日志是
log opened at 2018-03-21 12:56:51
I: Connecting to configured address/port: 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
fileuri="file:///Users/users/www/slt/index.php" language="PHP"
xdebug:language_version="5.6.33" protocol_version="1.0" appid="2764"
idekey="PHPSTORM"><engine version="2.5.5"><![CDATA[Xdebug]]></engine><author>
<![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url>
<copyright><![CDATA[Copyright (c) 2002-2017 by Derick Rethans]]></copyright>
</init>
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok">
</response>
Log …Run Code Online (Sandbox Code Playgroud) 如何在PhpStorm 2018.1中创建一个新的Laravel项目(在Ubuntu 16.04中)?
我在github上发现了这个非常受欢迎的软件包。
https://github.com/barryvdh/laravel-ide-helper
我已经在我从事过的多个项目中看到过这种用法,但是我不确定此软件包的确切好处是什么。如果我理解正确,它将在您项目的根目录中使用Laravel Framework的“克隆”生成一个文件。这应该有助于自动补全。
我在文档中没有看到任何清晰的示例。
在我的任何PhpStorm项目中,调试都不再起作用,当我开始侦听传入的连接时,脚本将被阻塞,直到我停止侦听连接,即使我的代码上没有断点也是如此。当我在第一行上放置一个断点(在其他行上不起作用)时,脚本确实停止了,但是当我告诉他转到下一行时,它再次阻塞了(即使使用了最简单的代码)。
我试图检查调试配置,一切正常(我使用了PhpStorm的验证器),路径映射也正常,上周一切正常,我什么都没改变...
这是我在php.ini上的配置:
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log=[path]/xdebug.log
xdebug.idekey=PHPSTORM
Run Code Online (Sandbox Code Playgroud)
这是我的xdebug.log的一部分,当我在第一行上放置断点然后执行以下操作时:
[4605] Log opened at 2019-03-12 14:13:50
[4605] I: Connecting to configured address/port: 127.0.0.1:9000.
[4605] I: Connected to client. :-)
[...]
[4605] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="19" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" [...] </property></response>
[...]
[4605] <- step_over -i 21
[4605] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="21" status="break" reason="ok"><xdebug:message filename="file:///[path]" lineno="4"></xdebug:message></response>
[4605]
Run Code Online (Sandbox Code Playgroud)
第一个响应是当它在第一行的断点处停止时,我已使用“ $ _COOKIE”记录了变量,一切正常,然后执行了一步,脚本就像卡住了。而且问题不可能出在代码中,我尝试了只有2个“ echo”的脚本。我尝试重新启动apache,尝试重新启动PhpStorm,然后尝试重新启动计算机,但没有做任何更改。
我的PhpStorm版本:
PhpStorm 2018.1
Build #PS-181.4203.565, built on March 28, 2018
JRE: 1.8.0_152-release-1136-b20 amd64 …Run Code Online (Sandbox Code Playgroud)