Ask for help on the ucenter communication process code! Many powerful CSDN! Come here! Please kindly advise! When debugging the ucenter, go to controladminapp. php encountered such a piece of code if ($ app [extra] [apppath] & nbsp; & amp; & nbsp; @ include & nbsp; $ app [extra] [apppath] .. api help for ucenter communication process code! Many powerful CSDN! Come here! Please kindly advise!
This code was encountered in/control/admin/app. php during ucenter debugging.
If ($ app ['Extra '] ['apppath'] & @ include $ app ['Extra'] ['apppath']. '. /api /'. $ app ['apifilename'])
{
// Code
}
Will the file included after this if statement be the execution result or the file itself, or will only return a true or false?
Include is A. php file.
Split line ----------------------------------------------------------------------------------------------------------------
Run the onping function in the following file.
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 = "'.$this->lang['app_connent_ok'].'";testlink();';
} else {
echo 'document.getElementById(\'status_'.$appid.'\').innerHTML = "'.$this->lang['app_connent_false'].'";testlink();';
}
}
?>
Include $ app ['Extra '] ['apppath']. '. /api /'. $ app ['apifilename'] This file is a uc file in another directory. php file, the front code is as follows! This file is provided by HDwiki5.1 of utf8 version!
Error_reporting (0 );
Define ('UC _ CLIENT_VERSION ', '1. 5.1 ');
Define ('UC _ CLIENT_RELEASE ', '20140901 ');
Define ('api _ deleteuser', 1); // you can delete an API.
Define ('api _ renameuser', 1); // rename the API
Define ('api _ gettag', 1); // Obtain the tag API
Define ('api _ synlogin', 1); // synchronous login API
Define ('api _ synlogout', 1); // synchronously log out of the API
Define ('api _ updatepw', 1); // change the user password
Define ('api _ updatebadword', 1); // update the keyword list
Define ('api _ updatehosts', 1); // update the domain name resolution cache
Define ('api _ UPDATEAPPS ', 1); // update the application list
Define ('api _ UPDATECLIENT ', 1); // update the client cache
Define ('api _ UPDATECREDIT ', 1); // update user points
Define ('api _ GETCREDITSETTINGS ', 1); // provides point settings to UCenter.
Define ('api _ getcredentials', 1); // Obtain a user's credit
Define ('api _ updatecreditsettings', 1); // Set points
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 ('invalidrequest ');
} Elseif ($ timestamp-$ get ['Time']> 3600 ){
Exit ('authracation has expiried ');
}
Why is an 'invalidrequest' output? Is this output correct?
------ Solution --------------------
For @ include $ app ['Extra '] ['apptath'].'./api/'. $ app ['apifilename']
If the file $ app ['Extra '] ['apptath'].'./api/'. $ app ['apifilename'] does not exist, oppose false.
If yes, 1 is returned.
There is no problem with this writing!
If a problem occurs in your program, find the cause elsewhere.
------ Solution --------------------
There must be content included in include. can you see a lot of definitions from the fragments you post?
Of course, you can first determine the existence of the file and then include
But isn't it concise? Should at least one statement be analyzed in the compiler?