phpstorm -xmx
It’s said the tool doesn’t make the craft – a carpenter can drive a nail into a wooden plank using a hammer, a rock, another plank, or his forehead, but he’ll rarely choose anything other than the hammer. Some of our foreheads may have gone hard with constant hammering while programming, but that doesn’t mean its a better tool than the never before used hammer. Ok, enough analogies, I’m talking about using a text editor versus using a full-fledged PHP-dedicated project-oriented IDE for PHP application development. Both will get the job done, but productivity-wise, one is obviously a better choice than the other.
据说这种工具不能制造Craft.io品–木匠可以用锤子,石头,另一块木板或额头将钉子钉入木板,但是除了锤子,他很少选择其他任何东西。 在编程时,不断锤打我们的某些额头可能会变得很难,但这并不意味着它比从未使用过的锤子更好。 好的,有足够的类比,我谈论的是使用文本编辑器,而不是使用功能全面PHP专用的面向项目的IDE进行PHP应用程序开发。 两者都可以完成工作,但是从生产率的角度来看,一个显然比另一个更好。
PhpStorm is a Java-based IDE developed by Jetbrains, derived from a master multi-programming-language IDE called IntelliJ IDEA. It’s a stripped down version of IntelliJ with added PHP support – something IntelliJ needs to have manually enabled via a plugin.
PhpStorm是由Jetbrains开发的基于Java的IDE,从称为IntelliJ IDEA的主多编程语言IDE派生而来。 它是IntelliJ的精简版本,并增加了PHP支持– IntelliJ需要通过插件手动启用。
Now, this wouldn’t be a good review if I didn’t mention some downsides, but luckily these are few and far between and, as you’ll see below, aren’t show-stoppers. Let’s get them out of the way first.
现在,如果我不提一些缺点,这将不是一个很好的评论,但是幸运的是,这些缺点很少,而且相距甚远,正如您将在下面看到的那样,它们并不是阻碍因素。 让我们先解决它们。
First and foremost, PhpStorm is built on Java. Java is a dinosaur language and the VM which needs to spin up to execute Java apps is one of the greatest memory and CPU hogs – especially when working in an OSX environment. Coupled with the IDE’s rich functionality, this resource demand might prove to be too much for weaker machines. Using Java comes with a big perk though – PhpStorm is fast. Blazing fast.
首先,PhpStorm是基于Java构建的。 Java是一种恐龙语言,需要加速运行Java应用程序的VM是最大的内存和CPU消耗之一-特别是在OSX环境中工作时。 再加上IDE的丰富功能,对于较弱的计算机来说,这种资源需求可能证明是太多了。 使用Java带来了很大的好处-PhpStorm很快。 快速燃烧。
Furthermore, PhpStorm is a project-based IDE, which means there’s no simply editing just one file. You need to define a project and tell the IDE which files are included in it. This is a professional IDE designed for heavy coders who develop large applications and professional platforms. It emphasizes speed, productivity, and ease of access to the entire project, and as such, offers no actual support for individual PHP file editing in the traditional sense. Certainly, you can edit a PHP file, but it’ll get opened under the project you have opened at that time. And new projects must be opened in a new window – there’s only one IDE instance per open project.
此外,PhpStorm是基于项目的IDE,这意味着不能仅编辑一个文件。 您需要定义一个项目,并告诉IDE其中包含哪些文件。 这是一个专业的IDE,专门为开发大型应用程序和专业平台的重型编码器而设计。 它强调速度,生产力和对整个项目的访问的简便性,因此,它不为传统意义上的单个PHP文件编辑提供实际支持。 当然,您可以编辑一个PHP文件,但是它将在您当时打开的项目下打开。 而且新项目必须在新窗口中打开–每个打开的项目只有一个IDE实例。
But while I mentioned being built on Java as a downside, it’s also a huge-advantage. It lets us use the IDE on every development platform we own. This alone is worth looking at as a deciding factor in the purchase, as it allows you to carry your development environment with you. If you have a specific set of rules for every project, if you have coding styles and enforce PSR standards, if you have include paths that are identical across platforms but are a pain to set up over and over again, all you need to do is load the configuration from the originally configured PhpStorm and you’re good to go.
但是,尽管我提到过基于Java构建的缺点,但这也是一个巨大的优势。 它使我们可以在我们拥有的每个开发平台上使用IDE。 值得一看的是,这是购买的决定因素,因为它使您可以随身携带开发环境。 如果您对每个项目都有一套特定的规则,如果您具有编码样式并强制执行PSR标准,并且您所包含的路径在各个平台上都是相同的,但是一次又一次地设置很麻烦,那么您要做的就是从最初配置的PhpStorm中加载配置,您就可以开始了。
The second downside also doubles as an advantage. The IDE being strictly project-oriented means it indexes your entire project (all of your include_path as well if set), and offers full-fledged autocompletion with documentation for all the classes bound to your project, namespaces and all. You can exclude certain files and folders if you wish, but the gist of the matter is that one IDE instance handles one IDE project – the resources of one instance are dedicated to fast intellisense and code scanning of that project. Naturally, the clipboard is cross-instance compatible, so copying files or code snippets from one instance to the other is a breeze, whether you do it via the clipboard or just drag and drop across windows.
第二个缺点也是优势。 IDE严格面向项目,这意味着它会索引整个项目(如果已设置,还包括所有include_path),并为与项目,名称空间和所有绑定的所有类提供文档的完整自动补全功能。 您可以根据需要排除某些文件和文件夹,但要点是一个IDE实例处理一个IDE项目–一个实例的资源专用于该项目的快速智能感知和代码扫描。 自然地,剪贴板是跨实例兼容的,因此无论是通过剪贴板还是跨窗口拖放,将文件或代码段从一个实例复制到另一个实例都轻而易举。
PhpStorm 4+ supports the latest PHP version, including 5.4. There’s trait support, short array syntax, and all the other candy. If you’re developing a 5.3 project but would like to use 5.4 on new projects, configuring the IDE to do so is a walk in the park – you can set the actual interpreter version in the project configuration. If you accidentally use the short array syntax in the 5.3. project, the IDE will warn you accordingly.
PhpStorm 4+支持最新PHP版本,包括5.4。 有特征支持,短数组语法以及所有其他功能。 如果您正在开发5.3项目,但想在新项目上使用5.4,则配置IDE的过程很简单-您可以在项目配置中设置实际的解释器版本。 如果您不小心使用了5.3中的short数组语法。 项目,IDE将相应地警告您。
Another useful feature is smart refactoring; you can rename a file and have its include statements altered automatically across the entire project. You can refactor a global variable and have it changed in every file which uses it. You can refactor a property and see it and its accessors change without further effort. You can even refactor an entire PHP namespace and have it change across all classes. Imagine how much time this saves when dealing with 10k+ file projects.
另一个有用的功能是智能重构。 您可以重命名文件,并在整个项目中自动更改其包含语句。 您可以重构全局变量,并在使用它的每个文件中对其进行更改。 您可以重构属性并查看它及其访问器的更改,而无需付出更多努力。 您甚至可以重构整个PHP名称空间,并在所有类中进行更改。 想象一下,处理10k +文件项目时可以节省多少时间。
Large IDEs can be convoluted and complex, but PHPStorm eases you into its functionality in two ways: 1) Quick Tips that are actually practical will appear on every startup, unless you decide not to show them anymore. I’ve learned around 50% of all commands I know and use from these tips. 2) If you can’t find an IDE option in the menus, hitting Ctrl + Shift + A will open a command browser in which you can type out the IDE command you want to do. Want to git push the changes? Ctrl + Shift + A, and type “Push”. Forgot the shortcut for move line up/down? Just Ctrl + Shift + A and type “move line”. The shortcut will be displayed in the list. This isn’t your average autocomplete either – this is near-instant.
大型IDE可能是复杂而复杂的,但是PHPStorm可以通过两种方式使您轻松使用它:1)除非您决定不再显示它们,否则每次启动时都会出现实用的快速提示。 我从这些技巧中学到了大约50%的我知道和使用的命令。 2)如果在菜单中找不到IDE选项,则按Ctrl + Shift + A将打开命令浏览器,您可以在其中键入要执行的IDE命令。 想要git推送更改吗? Ctrl + Shift + A,然后输入“推”。 忘记了上下移动行列的快捷方式吗? 只需按Ctrl + Shift + A,然后输入“移动线”。 快捷方式将显示在列表中。 这也不是您的平均自动完成时间-这几乎是即时的。
PHPStorm’s intellisense is mind-blowing. The aforementioned autocomplete across classes in a project is great, and the autocomplete on the selection of IDE commands is a great idea, but it offers intellisense for JavaScript, HTML, and CSS as well. No other IDE has fulfilled the need for this so completely. After all, it’s not only a PHP editor – it’s actually WebStorm, the web-focused IDE from JetBrains but with added PHP support, which means it also has full support for rich and fast editing of HTML, JS and CSS.
PHPStorm的智识令人赞叹。 前面提到的跨项目的自动完成功能很棒,选择IDE命令的自动完成功能是个好主意,但是它也为JavaScript,HTML和CSS提供了智能感知功能。 没有其他IDE可以完全满足此需求。 毕竟,它不仅是一个PHP编辑器-实际上是WebStorm,它是JetBrains面向Web的IDE,而且还添加了PHP支持,这意味着它还完全支持HTML,JS和CSS的丰富和快速编辑。
There’s also a built-in graphical diff tool which highlights differences in a readable manner allowing you to visually compare the changes and seamlessly transfer updates from one file to another with the click of a button. If a conflict occurred, just hitting resolve will delete the conflict resolution files after the user syncs them up.
还有一个内置的图形化差异工具,以一种可读的方式突出显示差异,使您可以直观地比较更改并通过单击按钮将更新从一个文件无缝地传输到另一个文件。 如果发生冲突,则在用户同步冲突解决方案文件后,只需单击“解决”,便会删除它们。
The IDE also has excellent plugin functionality and a vibrant community around it. It is, essentially, built as a bare-bones application and all the functionality is plugged in. This lets you disable the plugins you don’t need (like the enabled-by-default CVS and SVN if you only use Git) to conserve resources, and lets you expand the IDE adding new functionality you feel is missing. To look up some plugins, see http://plugins.intellij.net/?webide
IDE还具有出色的插件功能以及周围充满活力的社区。 实际上,它是作为准系统应用程序构建的,并且插入了所有功能。这使您可以禁用不需要的插件(例如,如果仅使用Git,则默认启用的CVS和SVN)资源,并允许您扩展IDE并添加缺少的新功能。 要查找一些插件,请参见http://plugins.intellij.net/?webide
Here’s some more gems:
这里还有一些宝石:
Clicking the closing brace of a block that begins off-screen will display the entire starting line of said block in the top editor gutter. So if you forget the arguments a function consumes, there’s no need to scroll – just select its ending brace and the starting line will appear on the IDE frame. 单击屏幕外开始的块的右括号,将在顶部编辑器装订线中显示该块的整个起始行。 因此,如果您忘记了函数消耗的参数,则无需滚动-只需选择其结束括号,起始行就会出现在IDE框架上。 Open any file with CTRL + Shift + N, or class with CTRL + N, instantly. No scrolling through directory trees, no loading or searching. This is extra handy when you have many files/classes in your project. 立即使用CTRL + Shift + N打开任何文件,或者使用CTRL + N打开类。 无需滚动目录树,无需加载或搜索。 当项目中有许多文件/类时,这特别方便。 Got some messy code from other developers which you can’t look at unless it’s at least in PSR-1? Just run the code auto-format with CTRL+ALT+L on the files, blocks of code, or even entire folders to clean it up according to the coding style du jour. 从其他开发人员那里得到了一些凌乱的代码,除非至少在PSR-1中使用,否则您将无法看到它们? 只需使用CTRL + ALT + L对文件,代码块甚至整个文件夹运行代码自动格式化,即可根据您的编码风格对其进行清理。 Any undefined namespaces, redeclared classes, syntax errors and disrespected type hints will glow red. They will be highlighted in the right editor gutter and in the code itself. PHPStorm is your pair programmer – it helps you avoid silly bugs before you even make them! 任何未定义的名称空间,重新声明的类,语法错误和不受欢迎的类型提示都将变为红色。 它们将在右侧编辑器装订线和代码本身中突出显示。 PHPStorm是您的一对程序员–它可以帮助您避免愚蠢的bug,甚至还没有使它们成为现实!Keyboard shortcuts like “duplicate line”, “move line up / down” and live templates which let you create aliases for entire blocks of parametrized code will speed up your development and editor navigation. As an example, have a look at a couple videos and notice the speed of the developer as he uses autocomplete, live templates and various other WebStorm shortcuts to speed up his workflow.
键盘快捷键(如“重复行”,“上下移动行”和实时模板)使您可以为整个参数化代码块创建别名,从而加快了开发和编辑器的导航速度。 例如,看几个视频 ,注意开发人员在使用自动完成,实时模板和各种其他WebStorm快捷方式来加快工作流程时的速度。
There are loads of other features – I can only recommend you download the 30-day trial and give it a go. If it feels intimidating at first, stick with it and within a day or two you’ll be working it like a pro.
还有许多其他功能-我只能建议您下载30天试用版并试用。 如果一开始感觉很吓人,请坚持使用,在一两天内,您将像专业人士一样工作。
Many people oppose transitioning to PhpStorm with the argument: “Netbeans has all that and it’s free.” While I won’t argue that Netbeans does indeed have the majority of features PHPStorm offers (although not all of them), even if they had identical features, interfaces and commands, the speed increase alone is worth the price. Also, NetBeans belongs to Oracle as of 2010 who have done little in the past couple years to bring the IDE up to speed.
许多人反对以以下说法过渡到PhpStorm:“ Netbeans拥有全部,而且是免费的。” 尽管我不会争辩说Netbeans确实具有PHPStorm提供的大多数功能(尽管不是全部),但是即使它们具有相同的功能,接口和命令,但仅提速还是值得的。 此外,NetBeans于2010年成为Oracle的一员,在过去的几年中,NetBeans几乎没有做任何事情来加快IDE的发展。
Also important is the fact that the company making PhpStorm is approachable and friendly – the software they make is maintained, built, and sold by people you can actually reach. Most people figure: “I don’t care if they burn puppies or have supervillainous plans, I like their product” (which is essentially why Apple products get sales). But Jetbrains is open to suggestions, they give discounts for good causes, they extend trial periods if you ask them to, they will even provide you with a free Open Source license if you’re the main committer of an Open Source project!
同样重要的是,制作PhpStorm的公司平易近人且友好–由您实际接触的人维护,构建和销售他们制作的软件。 大多数人认为:“我不在乎他们是否燃烧幼犬或有超计划,我喜欢他们的产品”(这就是苹果产品获得销售的原因)。 但是Jetbrains乐于接受建议,它们会为您提供正当的折扣,如果您要求,它们会延长试用期,如果您是开源项目的主要提交者,它们甚至会为您提供免费的开源许可证!
It is in this friendly and generous spirit that Jetbrains, in partnership with SitePoint, is giving out PhpStorm licenses and hard copies of PHPMaster: Create Cutting Edge Code!
正是本着这种友好和慷慨的精神,Jetbrains与SitePoint合作发布了PhpStorm许可证和PHPMaster的硬拷贝:创建最新代码 !
To be eligible for the give away, either 1) download the IDE, test it out, and post a comment below in which you name your favorite feature, or 2) share this article on Twitter with the hashtag #phpmaster, all by August 22nd. Three winners will be chosen at random shortly thereafter. Comment winners will be notified by email (be sure to provide a valid email address in the contact-form!) and Twitter winners by direct-message.
为了有资格获得赠品,或者1) 下载IDE ,对其进行测试,然后在下面发表评论,在其中您可以命名自己喜欢的功能,或者2)在8月22日之前在Twitter上使用#phpmaster标签共享本文。 。 此后不久将随机选择三名优胜者。 评论优胜者将通过电子邮件(请确保在联系表中提供有效的电子邮件地址!)得到通知,Twitter优胜者将通过直接消息得到通知。
1st Prize: A PhpStorm license and a hard copy of PHPMaster: Create Cutting-Edge Code
一等奖: PhpStorm许可证和PHPMaster的硬拷贝:创建最新代码
2nd Prize: A PhpStorm license
二等奖: PhpStorm许可证
3rd Prize: A hard copy of PHPMaster: Create Cutting-Edge Code
三等奖: PHPMaster的硬拷贝:创建前沿代码
Good luck, and happy coding!
祝您好运,编码愉快!
翻译自: https://www.sitepoint.com/phpstorm-review-and-give-away/
phpstorm -xmx