Skip to content

Commit

Permalink
更新添加cli模式,重构代码兼容3版本
Browse files Browse the repository at this point in the history
  • Loading branch information
yangweijie committed Jul 14, 2013
1 parent f6ed37d commit 48acc42
Show file tree
Hide file tree
Showing 23 changed files with 705 additions and 2,768 deletions.
5 changes: 2 additions & 3 deletions Context.sublime-menu
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[
{ "command": "search_word_thinkphp_manual", "caption": "Search ThinkPHP manual here" },
{ "command": "show_cloums_by_word", "caption": "show_cloums" },
{ "command": "goto_php_documentent", "caption": "goto_php_document" }
{ "command": "query_database", "caption": "show_cloums" ,"args": {"cmd" :"show_cloum"}},
{ "command": "goto_php_document", "caption": "goto_php_document" }
]
4 changes: 0 additions & 4 deletions Default (Linux).sublime-keymap

This file was deleted.

3 changes: 2 additions & 1 deletion Default (Linux).sublime-mousemap
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[
{ "button": "button1", "modifiers": ["alt"], "command": "goto_php_document"}
{ "button": "button1", "modifiers": ["ctrl"], "command": "goto_definition" },
{ "button": "button1", "modifiers": ["alt"], "command": "goto_php_document" }
]
4 changes: 0 additions & 4 deletions Default (OSX).sublime-keymap

This file was deleted.

4 changes: 0 additions & 4 deletions Default (Windows).sublime-keymap

This file was deleted.

3 changes: 2 additions & 1 deletion Default (Windows).sublime-mousemap
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[
{ "button": "button1", "modifiers": ["ctrl"], "command": "goto_php_document" }
{ "button": "button1", "modifiers": ["ctrl"], "command": "goto_definition" },
{ "button": "button1", "modifiers": ["alt"], "command": "goto_php_document" }
]
115 changes: 35 additions & 80 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,41 @@
"children":
[
{
"caption": "ThinkPHP",
"children":
[
{
"caption": "ThinkPHP delete opened folders' bom",
"id": "ThinkPHP del_bom",
"command": "del_workspace_boms"
},
{
"caption": "ThinkPHP manual",
"id": "ThinkPHP manual",
"command": "thinkphp"
},
{
"caption": "ThinkPHP manual: api",
"id": "ThinkPHP api manual",
"command": "view_thinkphp_api_manual"
},
{
"caption": "ThinkPHP manual: search",
"id": "ThinkPHP manual: search",
"command": "search_thinkphp_manual"
},
{
"caption": "ThinkPHP manual: build book",
"id": "ThinkPHP manual: build book",
"command": "update_thinkphp_manual"
},
{ "caption": "-" },
{
"caption": "ThinkPHP choose database",
"id": "ThinkPHP choose database",
"command": "query_database",
"args": {"cmd" :"list_database"}
},
{ "caption": "-" },
{ "command": "open_file",
"args": {"file": "${packages}/Thinkphp/php.sublime-completions"},
"caption": "Browse Complation - php", "mnemonic": "B"
},
{
"command": "open_file",
"args": {"file": "${packages}/Thinkphp/tpl.sublime-completions"},
"caption": "Browse Complation - tpl"
},
{
"command": "open_file",
"args": {"file": "${packages}/Thinkphp/ThinkPHP.sublime-settings"},
"caption": "Settings – Default"
},
{
"command": "open_file",
"args": {"file": "${packages}/User/ThinkPHP.sublime-settings"},
"caption": "Settings – User"
},
{
"command": "open_file",
"args": {
"file": "${packages}/ThinkPHP/Default (Windows).sublime-keymap",
"platform": "Windows"
},
"caption": "Key Bindings – Default"
},
{
"command": "open_file",
"args": {
"file": "${packages}/ThinkPHP/Default (OSX).sublime-keymap",
"platform": "OSX"
},
"caption": "Key Bindings – Default"
},
{
"command": "open_file",
"args": {
"file": "${packages}/ThinkPHP/Default (Linux).sublime-keymap",
"platform": "Linux"
},
"caption": "Key Bindings – Default"
}
]
"caption": "ThinkPHP manual: api",
"id": "ThinkPHP api manual",
"command": "view_thinkphp_api_manual"
},
{
"caption": "ThinkPHP change database",
"id": "ThinkPHP change database",
"command": "query_database",
"args": {"cmd" :"change_database"}
},
{
"caption": "ThinkPHP database queryer",
"id": "ThinkPHP database queryer",
"command": "query_database",
"args": {"cmd" :"query"}
},
{
"caption": "ThinkPHP-CLI",
"id": "ThinkPHP executer",
"command": "thinkphp"
},
{ "caption": "-" },
{
"command": "open_file",
"args": {"file": "${packages}/Thinkphp/ThinkPHP.sublime-settings"},
"caption": "Settings – Default"
},
{ "command": "open_file",
"args": {"file": "${packages}/Thinkphp/php.sublime-completions"},
"caption": "Browse Complation - php", "mnemonic": "B"
},
{
"command": "open_file",
"args": {"file": "${packages}/Thinkphp/tpl.sublime-completions"},
"caption": "Browse Complation - tpl"
}
]
}
Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
##Thinkphp是什么?
Sublime中的一个THinkphp框架的工具包,主要包括访问在线手册,生成本地手册页面,搜索官网手册和thinkphp snippet
Sublime中的一个THinkphp框架的工具包,主要包括thinkphp snippet、访问框架在线api、以及一些编程辅助功能。目前重构的插件去除了手册相关功能,同时支持Sublime text2和3版本。

##Thinkphp有哪些功能?

* 在编辑器中获取最新手册列表,然后选择后打开本采集的离线手册页面
* 在编辑器中输入关键词或选中词后右键搜索
* 生成全部ThinkPHP官网手册的页面
* 访问官网框架在线api
* 辅助删除编辑器中打开目录所有文件的bom头
* 辅助删除编辑器中打开目录所有文件的bom头(后期补上,移植到3的时候报错解决不了,等我想办法解决)
* 通过sublime-completions提供代码完成功能
* ctrl点击或者选中函数名后右键显示函数说明文档(英文)
* ctrl点击或者选中函数名后右键显示函数说明文档(英文)
手册目录
![ThinkPHP manual](http://ww2.sinaimg.cn/large/50075709tw1dytu1g1xa1j.jpg)
改进后的菜单更集中
![ThinkPHP manual menu](http://ww4.sinaimg.cn/large/50075709tw1dyzlv2uk6oj.jpg)
![ThinkPHP api manual](http://ww3.sinaimg.cn/large/50075709tw1dyzlvmdds7j.jpg)
删除bom头
![ThinkPHP 打开目录的删除bom头命令结果](http://ww4.sinaimg.cn/large/50075709tw1dyzlvbi4daj.jpg)
![ThinkPHP manual](http://www.thinkphp.cn/Uploads/editor/2013-07-14/51e25dad0bc2b.jpg)
改进后的菜单少了一层,更快捷
Snippet提示
![sublime-completions](http://bbs.thinkphp.cn/data/attachment/forum/201207/27/0942179zll1qlqs9dsn3tt.png)
![sublime-completions](http://www.thinkphp.cn/Uploads/editor/2013-07-14/51e25e9621c58.png)

![视频: 用Sublime text2的Thinkphp插件 像zencoding)一样快速开发TP](http://v.youku.com/v_show/id_XNTA1NjE2MTM2.html)
查看函数说明文档
Expand All @@ -33,7 +26,19 @@ mysql编辑器内简单查询

注意database里 0 的那个键不要删除,剪切板里会有要添加的模板,自己要么先删除只剩0,保存后。下次选添加进来,粘贴会有1的模板,自己替换下即可。以后会扩展支持sqlserver。

2.替换出来的查询页面里的"here is the sql to be queryed" 为要查询的sql,保存后就切换tab后就能显示结果了。这是bug。因为查询结果是用php写文件的。
现在查看数据表字段注释和数据库查询统一用配置里的去访问数据库,因此有个“change database”菜单和“database queryer”菜单,查询表字段支持tp的命名方式,比如原表名think_user,在配置文件里配了前缀后我们在php文件里写D('User') 这样User选中后右键直接show_cloums就行了,为了方便大家记忆去除从输入框填写的步骤,简化为一个操作
效果如下:

![效果图](http://www.thinkphp.cn/Uploads/editor/2012-12-10/50c56b7fd4e97.png)

最后还支持了命令行访问网页cli模式方便大家调试action中操作,不需要开浏览器。
选择菜单中的ThinkPHP-CLI 弹出的文件中 输入你想访问的url 记住打开的项目更目录要有入口文件,并且php在path环境变量中有设置。
保存就可显示结果:

![效果图](http://www.thinkphp.cn/Uploads/editor/2013-07-14/51e2689cce54a.png)

这样方便大家调试数据而不必切换浏览器,或者调试接口的时候用


##有问题反馈
在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流
Expand Down
Loading

0 comments on commit 48acc42

Please sign in to comment.