Discuz x2.0 debugging important functions of Application Communication

Source: Internet
Author: User
Tags testlink

Find the source of this information from "communication failed:

Open. /control/admin/app. in the PHP file, find the onping method, and you can see that when the $ status is equal to 1, the communication will be successful. In addition, the communication will fail, so that we can set the breakpoint to get the status information, find the problem. The source code is as follows:

Function onping () {$ IP = getgpc ('IP'); $ url = getgpc ('url'); $ appid = intval (getgpc ('appid ')); $ app =$ _ env ['app']-> get_app_by_appid ($ appid); $ status = ''; if ($ app ['extra '] ['apppath'] & @ include $ app ['extra'] ['apppath']. '. /API /'. $ app ['apifilename']) {$ uc_note = new uc_note (); $ status = $ uc_note-> test ($ note ['getdata'], $ note ['postdata']);} else {$ this-> load ('note '); $ url = $ _ env ['note']-> get_url_code ('test', '', $ appid ); $ status = $ _ env ['app']-> test_api ($ URL, $ IP);} if ($ status = '1') {echo 'document. getelementbyid (\ 'status _'. $ appid. '\'). innerhtml = " <SPAN class = \ 'green \'> '. $ this-> Lang ['app _ connent_ OK ']. '</span> "; testlink ();';} else {echo 'document. getelementbyid (\ 'status _'. $ appid. '\'). innerhtml = " <SPAN class = \ 'Red \'> '. $ this-> Lang ['app _ connent_false ']. '</span> "; testlink ();';}}
 when dealing with this problem, there is a small problem in the middle. When $ status is printed as 1, this is also a "communication failure". After searching for half a day, we found that it was a BOM problem. I would like to remind you of it here, if you encounter a similar problem, you can use the ultraedit tool to save it as a file (you can choose whether to add BOM through configuration when saving it) 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.