关于ucenter通讯过程的代码的!CSDN大神多!慕名而来!请多指教!
调试ucenter的时候在/control/admin/app.php中遇到了这样一段代码
if($app['extra']['apppath'] && @include $app['extra']['apppath'].'./api/'.$app['apifilename'])
{
//code
}
请问 这个if 后面 include 进来的文件 是执行的结果还是文件本身,还是仅仅返回一个ture or false?
include 进来的是一个.php的文件。
分割线----------------------------------------------------------------------------------------------------------------
运行下面这个文件中的 onping函数
<?php 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']) { echo 'in if='.$app['extra']['apppath'].'./api/'.$app['apifilename']; $uc_note = new uc_note(); $status = $uc_note->test($note['getdata'], $note['postdata']); } else { echo 'in 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 = "<img src=\'images/correct.gif\' border=\'0\' class=\'statimg\' \/ alt="关于ucenter通讯过程的代码的!CSDN大神多!慕名而来!请多指教!" ><span class=\'green\'>'.$this->lang['app_connent_ok'].'</span>";testlink();'; } else { echo 'document.getElementById(\'status_'.$appid.'\').innerHTML = "<img src=\'images/error.gif\' border=\'0\' class=\'statimg\' \/ alt="关于ucenter通讯过程的代码的!CSDN大神多!慕名而来!请多指教!" ><span class=\'red\'>'.$this->lang['app_connent_false'].'</span>";testlink();'; } }?>
其中include $app['extra']['apppath'].'./api/'.$app['apifilename'] 这个文件是 其他目录里面的 uc.php文件,前部代码如下!这个文件是utf8版的HDwiki5.1自带的!
<?phperror_reporting(0);define('UC_CLIENT_VERSION', '1.5.1');define('UC_CLIENT_RELEASE', '20100501');define('API_DELETEUSER', 1); //用户删除 APIdefine('API_RENAMEUSER', 1); //用户改名 APIdefine('API_GETTAG', 1); //获取标签 APIdefine('API_SYNLOGIN', 1); //同步登录 APIdefine('API_SYNLOGOUT', 1); //同步登出 APIdefine('API_UPDATEPW', 1); //更改用户密码define('API_UPDATEBADWORDS', 1); //更新关键字列表define('API_UPDATEHOSTS', 1); //更新域名解析缓存define('API_UPDATEAPPS', 1); //更新应用列表define('API_UPDATECLIENT', 1); //更新客户端缓存define('API_UPDATECREDIT', 1); //更新用户积分define('API_GETCREDITSETTINGS', 1); //向 UCenter 提供积分设置define('API_GETCREDIT', 1); //获取用户的某项积分define('API_UPDATECREDITSETTINGS', 1); //积分设置define('API_RETURN_SUCCEED', '1');define('API_RETURN_FAILED', '-1');define('API_RETURN_FORBIDDEN', '-2');define('HDWIKI_ROOT', substr(dirname(__FILE__),0,-4));define('UC_CLIENT_ROOT',HDWIKI_ROOT.'/api/uc_client/');define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());require_once HDWIKI_ROOT.'/api/ucconfig.inc.php';$get = $post = array();$code = @$_GET['code'];parse_str(authcode($code, 'DECODE', UC_KEY), $get);if(MAGIC_QUOTES_GPC) { $get = _stripslashes($get);}$timestamp = time();if(empty($get)){ exit('Invalid Request');}elseif($timestamp - $get['time'] > 3600){ exit('Authracation has expiried');}
那为什么输出了一个'Invalid Request 呢?这个输出结果对吗?
回复讨论(解决方案)
对于 @include $app['extra']['apppath'].'./api/'.$app['apifilename']
当文件 $app['extra']['apppath'].'./api/'.$app['apifilename'] 不存在时,反对 false
存在时返回 1
这种写法完全没有问题!
如果你的程序出现了问题,请在其他的地方找原因
对于 @include $app['extra']['apppath'].'./api/'.$app['apifilename']
当文件 $app['extra']['apppath'].'./api/'.$app['apifilename'] 不存在时,反对 false
存在时返回 1
这种写法完全没有问题!
如果你的程序出现了问题,请在其他的地方找原因
请问,这样的用法和file_exists的功能有什么区别呢?include进来的内容 对本地程序有影响吗?还是 单纯的判读文件是否存在?
include 进来的肯定是有内容的了,从你贴出的片段不也能看到很多定义吗?
你当然可以先判断文件存在,然后再include
但这样写不是很简洁吗?至少在编译器件要少分析一个语句吧?
问题找到了
是301跳转的问题
换了主机空间原来的独立Ip没有了!
301跳转方面可能有点问题!
多谢各位大神了!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Some users encountered errors when installing the device, prompting error code 28. In fact, this is mainly due to the driver. We only need to solve the problem of win7 driver code 28. Let’s take a look at what should be done. Do it. What to do with win7 driver code 28: First, we need to click on the start menu in the lower left corner of the screen. Then, find and click the "Control Panel" option in the pop-up menu. This option is usually located at or near the bottom of the menu. After clicking, the system will automatically open the control panel interface. In the control panel, we can perform various system settings and management operations. This is the first step in the nostalgia cleaning level, I hope it helps. Then we need to proceed and enter the system and

What to do with blue screen code 0x0000001? The blue screen error is a warning mechanism when there is a problem with the computer system or hardware. Code 0x0000001 usually indicates a hardware or driver failure. When users suddenly encounter a blue screen error while using their computer, they may feel panicked and at a loss. Fortunately, most blue screen errors can be troubleshooted and dealt with with a few simple steps. This article will introduce readers to some methods to solve the blue screen error code 0x0000001. First, when encountering a blue screen error, we can try to restart

Solve the "error:expectedinitializerbefore'datatype'" problem in C++ code. In C++ programming, sometimes we encounter some compilation errors when writing code. One of the common errors is "error:expectedinitializerbefore'datatype'". This error usually occurs in a variable declaration or function definition and may cause the program to fail to compile correctly or

The win10 system is a very excellent high-intelligence system. Its powerful intelligence can bring the best user experience to users. Under normal circumstances, users’ win10 system computers will not have any problems! However, it is inevitable that various faults will occur in excellent computers. Recently, friends have been reporting that their win10 systems have encountered frequent blue screens! Today, the editor will bring you solutions to different codes that cause frequent blue screens in Windows 10 computers. Let’s take a look. Solutions to frequent computer blue screens with different codes each time: causes of various fault codes and solution suggestions 1. Cause of 0×000000116 fault: It should be that the graphics card driver is incompatible. Solution: It is recommended to replace the original manufacturer's driver. 2,

If you need to program any device remotely, this article will help you. We will share the top GE universal remote codes for programming any device. What is a GE remote control? GEUniversalRemote is a remote control that can be used to control multiple devices such as smart TVs, LG, Vizio, Sony, Blu-ray, DVD, DVR, Roku, AppleTV, streaming media players and more. GEUniversal remote controls come in various models with different features and functions. GEUniversalRemote can control up to four devices. Top Universal Remote Codes to Program on Any Device GE remotes come with a set of codes that allow them to work with different devices. you may

As a programmer, I get excited about tools that simplify the coding experience. With the help of artificial intelligence tools, we can generate demo code and make necessary modifications as per the requirement. The newly introduced Copilot tool in Visual Studio Code allows us to create AI-generated code with natural language chat interactions. By explaining functionality, we can better understand the meaning of existing code. How to use Copilot to generate code? To get started, we first need to get the latest PowerPlatformTools extension. To achieve this, you need to go to the extension page, search for "PowerPlatformTool" and click the Install button

Termination Code 0xc000007b While using your computer, you sometimes encounter various problems and error codes. Among them, the termination code is the most disturbing, especially the termination code 0xc000007b. This code indicates that an application cannot start properly, causing inconvenience to the user. First, let’s understand the meaning of termination code 0xc000007b. This code is a Windows operating system error code that usually occurs when a 32-bit application tries to run on a 64-bit operating system. It means it should

Blue screen is a problem we often encounter when using the system. Depending on the error code, there will be many different reasons and solutions. For example, when we encounter the problem of stop: 0x0000007f, it may be a hardware or software error. Let’s follow the editor to find out the solution. 0x000000c5 blue screen code reason: Answer: The memory, CPU, and graphics card are suddenly overclocked, or the software is running incorrectly. Solution 1: 1. Keep pressing F8 to enter when booting, select safe mode, and press Enter to enter. 2. After entering safe mode, press win+r to open the run window, enter cmd, and press Enter. 3. In the command prompt window, enter "chkdsk /f /r", press Enter, and then press the y key. 4.
