用eclipse修改PHP模板代码----我的经历

   如今PHP程序很多,修改PHP的IDE与编辑器也多, 如PhpStorm,Sublime Text,NetBeans,Zend Studio,Notepad++,Eclipse with PDT,Dreamweaver,Aptana,Vim,phpDesigner,zendstudio,aptana.

  当然使用visual studio也可修改PHP代码。


  这里,我将使用eclipse修改PHP代码

let's start

  

下载eclipse http://www.eclipse.org/downloads/packages/eclipse-php-developers/lunasr1

目录

  1. 安装svn插件
  2. 安装vi支持插件
  3. 配置编码和换行
  4. 设置精典主题
  5. 设置自动提示延时
  6. 设置字体
  7. 设置volt模板类型
  8. 空格代替TAB,显示空白符
  9. 格式化标准为PSR-2
  10. 设置xdebug支持跟踪调试
自动换行可以参考 Eclipse Word Wrap
https://github.com/ahtik/eclipse-wordwrap/wiki
Use http://ahtik.com/eclipse-update/ update site to install the latest version. Go to http://ahtik.com/blog/projects/eclipse-word-wrap/ for more info 

安装svn

http://subclipse.tigris.org/update_1.10.x

eclipse_install_subclipse.png

建议不要选择Contact all update sites during install to find required software

安装 Twig | Eclipse | Plugin

这个网站提供了大量适合PHP开发的插件: http://twig.dubture.com/installation/

除了通过marketplace安装外还可以如下

The plugin can be installed via the Update Manager using the following updatesite:
http://p2-dev.pdt-extensions.org 

eclipse_pdt_extensions2.png

vim-vrapper

http://vrapper.sourceforge.net/update-site/stable

eclipse_install_vim.png

统一配置

编码

eclipse_workspace.png

设置精典主题

eclipse_theme.png

加快自动提示速度

eclipse_auto_activation_delay.png

字体

eclipse_font.png

volt模板语法高亮显示(方案一:设置成php或者html)

eclipse_content_types.png

如果安装了twig模板支持(推荐方案二:设置成Twig Template)

eclipse_pdt_extensions3.png eclipse_pdt_extensions4.png

显示空白

空格代替tab

eclipse_edit_insert_spaces_for_tabs.png

eclipse_edit_insert_spaces_for_tabs2.png

格式化标准为PSR-2

eclipse_formatter.png

eclipse_edit_insert_spaces_for_tabs3.png

php调试

eclipse_enable_cli_debug.png

eclipse_xdebug_port.png

eclipse_xdebug.png

eclipse_xdebug_browser

eclipse基本使用指导

workspace

PHP项目

eclipse_project_1.png

PHP Include Path

eclipse_project_2.png

除了指定外部源码目录外还可以指定项目

eclipse_include_project.png

搜索,快速打开项目文件

  • Ctrl+Shift+R
  • Ctrl+h

eclipse_search1.png

eclipse_ctrl_h.png

eclipse_ctrl_shift_r.png

快捷键

  • 显示快捷键:Ctrl+Shift+L
  • 删除行:Ctrl+D
  • 开关注释:Ctrl+/
  • 块注释:Ctrl+Shift+/ Ctrl+Shift+\
  • 跳转到行号:Ctrl+L
  • 格式化文件:Ctrl+Shift+F
  • 格式化选中部分:Ctrl+I
  • 补全提示:Alt+/

分割窗口

windows->editor

本地历史记录

比较 Local history

替换 Local history

文档注释

  • 编写规范
  • 文档工具生成文档

兼容phpstorm,netbeans,eclipse的函数内变量注释

/* @var $var type */

svn插件使用


最后谈的是使用PHPunit进行PHP项目测试,

具体略。

adiOS

转载于:https://my.oschina.net/bigfool007139/blog/614347

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值