duanhuang4306 2008-12-17 00:31
浏览 59
已采纳

PHP:消息传递/日志记录到Eclipse控制台?

Is it possible to send messages from a PHP script to the console in Eclipse? Has anyone attempted this already? I'm not very familiar with how the console works, so I'm not sure if there is a standardized method for communicating with it.

  • 写回答

3条回答 默认 最新

  • dongrong8972 2008-12-29 23:16
    关注

    If you look at...

    Main Menu -> Run -> External Tools -> Open External Tools Dialog.

    In there I have set up PHP Codesniffer with the following...

    • Name : Code Sniffer
    • Location : /usr/bin/phpcs
    • Working Directory : ${workspace_loc}
    • Arguments : --standard=${resource_loc}

    That runs the codesniffer as an external tool and all the messages it returns appear in the console. Once you have set it up, click the down arrow and choose "Code Sniffer" and then anything the external program (in this case codesniffer) outputs will be in the Eclipse console.

    If you set it up like this...

    • Name : PHP
    • Location : /usr/bin/phpcs
    • Working Directory : ${workspace_loc}
    • Arguments : ${workspace_loc}${resource_path}

    It will just run php in CLI mode and if you run it with Wilco's code (above) you will get.

    Hello World
    

    In the terminal.

    Hope that helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)