Sublime Text中运作PHP(转)
Sublime Text 2 has the concept of build systems. This basically means that if you are editing a Python file then you can run the Python interpreter on the source file your are editing and see the output in a console window, all without having to leave the Sublime editor. It’s surprising how much quicker and easier this is compared to having to leave Sublime to swap to a?separate?console window. This is Sublime’s Tools->Build System menuSurprisingly, there is no supplied build system for PHP, to add one go to “New Build System”. A new tab opens for file?untitled.sublime-build?with the following in it:
{ “cmd”: [“make”] }
Delete that and replace it with this:
{ “cmd”: [“php”, “$file”], “file_regex”: “php$”, “selector”: “source.php” }
And save the file. Sublime will pop up the file save dialog, which defaults to the directory that Sublime uses for its user-generated config files, so don’t change the directory, just save this file as?php.sublime-build. Now, when you edit a file whose name ends with?php?(as specified by the “php$” regex in the config file) you will have a build system available. You can now hit CTRL+B and the PHP?interpreter?will run against your source file and the output appears in a Sublime Text window.The grey window shows the output of the PHP interpreter and the time it took to run.
相关文章
相关视频
专题推荐
-
独孤九贱-php全栈开发教程
全栈 170W+
主讲:Peter-Zhu 轻松幽默、简短易学,非常适合PHP学习入门
-
玉女心经-web前端开发教程
入门 80W+
主讲:灭绝师太 由浅入深、明快简洁,非常适合前端学习入门
-
天龙八部-实战开发教程
实战 120W+
主讲:西门大官人 思路清晰、严谨规范,适合有一定web编程基础学习
下一篇: java并发程序测试实例教程
推荐阅读
-
sublime text3中tab怎么设置为默认缩进四个空格?
-
PHP中查询SQL Server或Sybase时TEXT字段被截断的解决方法
-
如何在Sublime Text 3中设置Python交互环境
-
php判断一个值是否在数组中【转】
-
将Sublime Text 3 添加到右键中的简单方法
-
PHP中把stdClass Object转array的几个方法
-
解决sublime text 3中color highlight和color highlighter插件无法正常运行的问题
-
Sublime Text 3 配置 PHP IDE环境 并使用Xdebug进行调试
-
Sublime Text 3 配置 PHP IDE环境 并使用Xdebug进行调试
-
PHP页面转UTF-8中文编码乱码的解决办法
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论