From 48acc42421bc854815c30c85f2005a025e80fc42 Mon Sep 17 00:00:00 2001 From: jay <917647288@qq.com> Date: Sun, 14 Jul 2013 17:21:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B7=BB=E5=8A=A0cli?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=85=BC=E5=AE=B93=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Context.sublime-menu | 5 +- Default (Linux).sublime-keymap | 4 - Default (Linux).sublime-mousemap | 3 +- Default (OSX).sublime-keymap | 4 - Default (Windows).sublime-keymap | 4 - Default (Windows).sublime-mousemap | 3 +- Main.sublime-menu | 115 +- README.md | 33 +- ThinkPHP-CLI.html | 419 +++++++ ThinkPHP-Queryer | 5 + ThinkPHP-Queryer.sql | 11 + Thinkphp.py | 520 +++------ Thinkphp.sublime-commands | 26 - Thinkphp.sublime-settings | 25 +- command.php | 80 +- manual/public/book.tpl | 48 - manual/public/css/book.css | 540 --------- manual/public/css/prettify.css | 47 - manual/public/js/jquery-1.7.1.min.js | 4 - manual/public/js/prettify.js | 1536 -------------------------- php.sublime-completions | 6 +- thinkphp_database_queryer | 7 +- tpl.sublime-completions | 28 +- 23 files changed, 705 insertions(+), 2768 deletions(-) delete mode 100644 Default (Linux).sublime-keymap delete mode 100644 Default (OSX).sublime-keymap delete mode 100644 Default (Windows).sublime-keymap create mode 100644 ThinkPHP-CLI.html create mode 100644 ThinkPHP-Queryer create mode 100644 ThinkPHP-Queryer.sql delete mode 100644 Thinkphp.sublime-commands delete mode 100644 manual/public/book.tpl delete mode 100644 manual/public/css/book.css delete mode 100644 manual/public/css/prettify.css delete mode 100644 manual/public/js/jquery-1.7.1.min.js delete mode 100644 manual/public/js/prettify.js diff --git a/Context.sublime-menu b/Context.sublime-menu index 8acd507..a7aaef6 100644 --- a/Context.sublime-menu +++ b/Context.sublime-menu @@ -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" } ] diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap deleted file mode 100644 index a23a7b9..0000000 --- a/Default (Linux).sublime-keymap +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "keys": ["ctrl+super+m"], "command": "thinkphp" }, - { "keys": ["ctrl+super+u"], "command": "update_thinkphp_manual" } -] \ No newline at end of file diff --git a/Default (Linux).sublime-mousemap b/Default (Linux).sublime-mousemap index 1eae3c0..44e91a0 100644 --- a/Default (Linux).sublime-mousemap +++ b/Default (Linux).sublime-mousemap @@ -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" } ] diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap deleted file mode 100644 index a23a7b9..0000000 --- a/Default (OSX).sublime-keymap +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "keys": ["ctrl+super+m"], "command": "thinkphp" }, - { "keys": ["ctrl+super+u"], "command": "update_thinkphp_manual" } -] \ No newline at end of file diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap deleted file mode 100644 index 98463d9..0000000 --- a/Default (Windows).sublime-keymap +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "keys": ["ctrl+alt+m"], "command": "thinkphp" }, - { "keys": ["ctrl+alt+u"], "command": "update_thinkphp_manual" } -] \ No newline at end of file diff --git a/Default (Windows).sublime-mousemap b/Default (Windows).sublime-mousemap index 84fe00a..44e91a0 100644 --- a/Default (Windows).sublime-mousemap +++ b/Default (Windows).sublime-mousemap @@ -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" } ] diff --git a/Main.sublime-menu b/Main.sublime-menu index 4faad32..49170dd 100644 --- a/Main.sublime-menu +++ b/Main.sublime-menu @@ -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" } ] } diff --git a/README.md b/README.md index 64057c9..3efe789 100644 --- a/README.md +++ b/README.md @@ -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) 查看函数说明文档 @@ -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) + +这样方便大家调试数据而不必切换浏览器,或者调试接口的时候用 + ##有问题反馈 在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流 diff --git a/ThinkPHP-CLI.html b/ThinkPHP-CLI.html new file mode 100644 index 0000000..6073ed2 --- /dev/null +++ b/ThinkPHP-CLI.html @@ -0,0 +1,419 @@ +Index/index +################################################### + + + +
+ + + + + + + + + + + + + + + + + +t |