使我选择NuSphere PhpED的4个功能

In the last survey on the best PHP IDE for 2014, my longtime favorite PhpED was missing. I didn’t act on it then, but what better way to spread the love than to devote an article to it.

2014年最佳PHP IDE的上一次调查中,我长期以来最喜欢的PhpED丢失了。 那时我还没有采取行动,但是传播爱情的最好方法就是写一篇文章。

I’ve spent the first part of my programming career without a real IDE. UltraEdit was meeting most of my needs. At a certain point you start to realize you’re missing out on something and the quest for a real IDE begins. For quite some time I was relatively happy with NetBeans; after some time though, I did find myself fighting it on too many occasions. I again concluded that it was time to move on. Having a historical hate for Eclipse (we had a serious misunderstanding back at version 3 dot something from which I still haven’t recovered) meant I had to test the commercial IDEs.

我花了我的编程生涯的第一部分没有真正的IDE。 UltraEdit可以满足我的大多数需求。 在某个特定的时刻,您开始意识到自己缺少某些东西,因此开始寻求真正的IDE。 一段时间以来,我对NetBeans感到比较满意。 过了一段时间后,我发现自己在很多场合都在与之抗争。 我再次得出结论,该是继续前进的时候了。 对Eclipse怀有历史性的仇恨(我们对版本3点有严重的误解,但我至今还没有从中恢复过来)意味着我必须测试商业IDE。

为什么我选择PhpED (Why I chose PhpED)

Speed, overview and simplicity. That sums it up, really. There are a few things that mattered for me, speed-wise; switching projects, getting code suggestions and fast debugging. Overview is something that I want because my projects get quite complex at times. An IDE like Eclipse overwhelms me with way too many options and buttons which I hardly ever use, keep it simple please. I believe I found my requirements and more in PhpED…

速度,概述和简单性。 总结起来,真的。 在速度方面,有几件事对我很重要。 切换项目,获取代码建议和快速调试。 概述是我想要的,因为我的项目有时会变得非常复杂。 像Eclipse这样的IDE使我几乎用不到的太多选项和按钮让我不知所措,请保持简单。 我相信我在PhpED中找到了我的要求以及更多……

1.项目向导 (1. Project wizard)

The project wizard will help you set up your project like you want it; simple local project, local server or remote server. Run on web server and/or CLI. Set up the directories, code page, PHP/HTML/CSS versions and finally checking to see if the debugger is working. It’ll be quite specific on how to fix issues or offer to fix them should there be any.

项目向导将帮助您根据需要设置项目。 简单的本地项目,本地服务器或远程服务器。 在Web服务器和/或CLI上运行。 设置目录,代码页,PHP / HTML / CSS版本,最后检查调试器是否正常运行。 有关如何解决问题或在有问题时提供解决方案的信息将非常具体。

PhpED_project_wizzard.PNG

2.自动完成 (2. Autocomplete)

All the normal things are present when it comes to editing code: dynamic syntax highlighting for multiple languages, variable highlighting, fast searching and more. The code suggestion is instant; the IDE presents the possibilities that match the start that you typed. When you find what you wanted and your code is documented using PHPDoc, then it’ll show that while you’re entering your variables.

编辑代码时,所有普通的东西都存在:多种语言的动态语法高亮显示,变量高亮显示,快速搜索等等。 代码建议是即时的; IDE会提供与您键入的开始匹配的可能性。 当您找到所需的内容并且使用PHPDoc对代码进行了记录时,它将在您输入变量时显示出来。

PhpED_code_insight.png

In the example above, you can perhaps spot something that can be improved; it fails to show multiline comments of the documentation. This is good to get a simple overview of the function call, but quite often you document something for a reason and you want to see it all.

在上面的示例中,您也许可以发现可以改进的地方; 它无法显示文档的多行注释。 这是获得函数调用的简单概述的好方法,但是很多时候您出于某种原因将某些东西记录下来,并且希望一眼就能看到。

3.调试 (3. Debugging)

PhpED comes with the DBG extension for debugging. The debugger installs as a PHP module. The project wizard will automatically install the module for you if you’re running a local server. For a remote server, you’ll have to do it yourself. Again, the wizard is very helpful here on how to do this, suggesting the correct paths and file content for your server. PhpED will automatically listen for incoming debug connections and helps you get the connection through firewalls and routers, should that be necessary.

PhpED带有用于调试的DBG扩展 。 调试器将作为PHP模块安装。 如果您正在运行本地服务器,则项目向导将自动为您安装模块。 对于远程服务器,您必须自己做。 再次,向导在此处如何执行此操作非常有帮助,为服务器建议正确的路径和文件内容。 PhpED将自动侦听传入的调试连接,并在必要时帮助您通过防火墙和路由器获得连接。

The debugger has all the features we can expect; single stepping, running to or from cursor position. Breakpoints can have additional conditions which are evaluated every time they are touched. The debugger can be started from the IDE with a ‘Run in debugger’ but can also be triggered to start at any time by just adding the DBGSESSID parameter to the request. This parameter is also saved as a session cookie so that every consequent request can be debugged automatically.

调试器具有我们可以期望的所有功能; 单步执行,运行到光标位置或从光标位置运行。 断点可以具有其他条件,每次触及它们时都会对其进行评估。 可以使用“在调试器中运行”从IDE启动调试器,但也可以通过将DBGSESSID参数添加到请求中来随时触发以启动调试器。 此参数也保存为会话cookie,以便可以自动调试每个后续请求。

The debugger has sped up my development workflow on many occasions. The insight into the local and global variables is superb. The entire call stack is traced and all variables at every call in the stack are available.

调试器在许多场合加速了我的开发工作流程。 对局部和全局变量的洞察力是极好的。 跟踪整个调用堆栈,并且堆栈中每个调用处的所有变量均可用。

PhpED_debugger_views.PNG

The debugger is also capable of profiling memory, SQL and execution. The memory profiling was added recently. It gives you an insight to your code and exactly how much memory it’s using where, an insight which might surprise you.

调试器还能够分析内存,SQL和执行。 内存配置文件是最近添加的。 它使您可以深入了解自己的代码以及在何处使用了多少内存,这可能会让您感到惊讶。

PhpED_memory_profiler.PNG

The line profiler will show you where that time waiting for a page all went. It’ll be grouped and aggregated by module or function to find the critical points of your code.

线路分析器将向您显示等待页面的时间。 将按模块或功能对其进行分组和聚合,以查找代码的关键点。

PhpED_Line_profiler.PNG

Your SQL code is of course all traceable. From connection time to setup commands and queries, every part of the SQL interaction is logged in detail.

您SQL代码当然可以追溯。 从连接时间到设置命令和查询,将详细记录SQL交互的每个部分。

PhpED_SQL_profiler.PNG

The example here was done using PDO, note how the query parameters aren’t logged. If you’ve ever tried to optimize SQL queries you’ll know that you want the exact query to be able to run an EXPLAIN properly. Some room for improvement, I’d say.

此处的示例使用PDO完成,请注意如何不记录查询参数。 如果您曾经尝试优化SQL查询,就会知道您希望确切的查询能够正确运行EXPLAIN。 我会说还有一些改进的余地。

4.概述 (4. Overview)

PhpED features a function called code navigator which shows the structure of the file you’re editing at any given moment. There is a quick search at the top of it allowing you to jump to specific parts within the file. The view adapts to the current file and is also capable of filtering out the different parts, should it contain more than one language. The bottom PHP/HTML/CSS and JS tabs allow you to switch between the individual sections.

PhpED具有称为代码导航器的功能,该功能可在任何给定时刻显示您正在编辑的文件的结构。 它的顶部有一个快速搜索,可让您跳至文件中的特定部分。 该视图适应当前文件,并且如果它包含多种语言,则还能够过滤出不同部分。 底部PHP / HTML / CSS和JS选项卡允许您在各个部分之间切换。

PhpED_code_navigator.png

The recent addition for SCSS support was welcome as well. Hugo Giraudel has written quite a bit about it here on SitePoint and I think most of us see the benefits. I like SCSS most for its structured approach. I was promised that support for LESS language additions is coming soon as well; the sooner the better.

最近也增加了对SCSS支持的支持。 Hugo GiraudelSitePoint上已经写了很多有关它的内容,我认为我们大多数人都可以从中受益。 我最喜欢SCSS的结构化方法。 向我保证,不久还将支持LESS语言。 越早越好。

还有更多…… (And there’s more…)

The list of features is long. I’m sure I’m not using them all. A few versions ago PhpED also started supporting PHP frameworks. This worked out very well because it is now aware of the relations between controllers and views. At the bottom of your editing window it’ll show tabs for the (partial) views you’re using in the current file or for the controller related to your view.

功能列表很长。 我确定我不会全部使用它们。 几个版本以前,PhpED也开始支持PHP框架。 这非常好,因为它现在知道控制器和视图之间的关系。 在编辑窗口的底部,它将显示您在当前文件中使用的(部分)视图或与视图相关的控制器的选项卡。

PhpED_mvc.PNG

With framework support also came the possibility to do URL mapping; quite often you can’t run or debug the file you’re editing. The framework you’re using has its own URL manager that maps a controller to a URL for instance. You can tell PhpED how to map the files in your structure to a URL which it can run. It’ll then open the correct URL if you press Run. If you’re using a controller with multiple actions it’ll even show a pop-up asking which action you want to start.

有了框架支持,就可以进行URL映射了。 很多时候,您无法运行或调试正在编辑的文件。 您使用的框架具有自己的URL管理器,该管理器将控制器映射到一个URL。 您可以告诉PhpED如何将结构中的文件映射到可以运行的URL。 然后,如果您按“运行”,它将打开正确的URL。 如果您使用的控制器具有多个动作,它甚至会显示一个弹出窗口,询问您要开始哪个动作。

完美吗? (Is it perfect?)

Will any IDE ever be? As a developer you’re constantly evolving; discovering new possibilities and you hope your IDE can keep up with you. This IDE, on the other hand, has surprised me with new features at times. I do make it a habit to check out other IDEs every now and then to make sure I don’t miss out on something. So far I haven’t see any major things that made me seriously consider switching.

会不会有IDE? 作为开发人员,您正在不断发展; 发现新的可能性,您希望您的IDE能够跟上您的发展。 另一方面,该IDE有时会以新功能令惊讶。 我确实习惯每时每刻签出其他IDE,以确保我不会错过任何东西。 到目前为止,我还没有发现任何让我认真考虑切换的重要事情。

For me, there’s one real annoyance; the color picker. It’s like a time machine back to Windows 95. Not sensitive to the code at hand, doesn’t do RGB() codes or HSL(), not capable of opacity, not user friendly, don’t even bother trying it.

对我来说,有一种真正的烦恼。 颜色选择器。 就像回到Windows 95的时光机一样。它对手头的代码不敏感,不执行RGB()代码或HSL(),不透明,用户不友好,甚至不必费心尝试。

There are some other nice-to-haves that I’ve seen in other IDEs, but those don’t tip the balance yet. Among the features that might be nice additions are Composer integration, a spelling checker and perhaps plugins.

我在其他IDE中还看到了其他一些不错的东西,但是这些并没有达到平衡。 其中可能不错的功能包括Composer集成,拼写检查器以及插件。

I made some suggestions to the PhpED team some time ago and got quick feedback on it. I was also invited to become a beta tester for PhpED, and the suggested features made it into the product – that at least gives the impression you’re taken seriously when you suggest something.

不久前,我向PhpED团队提出了一些建议,并获得了快速的反馈。 我还受邀成为PhpED的Beta测试人员,其建议的功能已融入产品中-至少在给您提出建议时会给您以认真的印象。

结论 (Conclusion)

I only showed some of the features of PhpED here. This selection, though, is what makes PhpED a winner to me. This IDE has definitely helped me become a more agile developer, but like always, everything is relative; I’m sure you have the same feelings about your IDE.

我只在这里展示了PhpED的一些功能。 不过,这种选择使PhpED成为我的赢家。 这个IDE无疑帮助我成为了一个更加敏捷的开发人员,但是像往常一样,一切都是相对的。 我敢肯定,您对自己的IDE有相同的感受。

Are you using PhpED? Or do you use another IDE that does an even better job? Tell us about your experiences.

您在使用PhpED吗? 还是使用另一个性能更好的IDE? 告诉我们您的经历。

翻译自: https://www.sitepoint.com/4-features-make-choose-nusphere-phped/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值