本文整理汇总了PHP中mobile_core::make_cors方法的典型用法代码示例。如果您正苦于以下问题:PHP mobile_core::make_cors方法的具体用法?PHP mobile_core::make_cors怎么用?PHP mobile_core::make_cors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobile_core
的用法示例。
在下文中一共展示了mobile_core::make_cors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: result
function result($result) {
global $_G;
ob_end_clean();
function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
header("Content-type: application/json");
mobile_core::make_cors($_SERVER['REQUEST_METHOD'], REQUEST_METHOD_DOMAIN);
$result = mobile_core::json(mobile_core::format($result));
if(defined('FORMHASH')) {
echo empty($_GET['jsoncallback_'.FORMHASH]) ? $result : $_GET['jsoncallback_'.FORMHASH].'('.$result.')';
} else {
echo $result;
}
exit;
}
示例2: exit
*/
if (!defined('IN_MOBILE_API')) {
exit('Access Denied');
}
require './source/class/class_core.php';
$discuz = C::app();
$discuz->init();
if (!defined('DISCUZ_VERSION')) {
require './source/discuz_version.php';
}
if (in_array('mobile', $_G['setting']['plugins']['available'])) {
loadcache('wsq_checkinfo');
if (!$_G['cache']['wsq_checkinfo'] || TIMESTAMP - $_G['cache']['wsq_checkinfo']['expiration'] > 600) {
$_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
$forums = C::t('forum_forum')->fetch_all_by_status(1);
foreach ($forums as $forum) {
$posts += $forum['posts'];
}
loadcache('userstats');
$array = array('discuzversion' => DISCUZ_VERSION, 'charset' => CHARSET, 'version' => MOBILE_PLUGIN_VERSION, 'pluginversion' => $_G['setting']['plugins']['version']['mobile'], 'regname' => $_G['setting']['regname'], 'qqconnect' => in_array('qqconnect', $_G['setting']['plugins']['available']) ? '1' : '0', 'wsqqqconnect' => in_array('qqconnect', $_G['setting']['plugins']['available']) ? '1' : '0', 'wsqhideregister' => $_G['wechat']['setting']['wechat_allowregister'] && $_G['wechat']['setting']['wechat_allowfastregister'] ? '1' : '0', 'sitename' => $_G['setting']['bbname'], 'mysiteid' => $_G['setting']['my_siteid'], 'ucenterurl' => $_G['setting']['ucenterurl'], 'defaultfid' => $_G['wechat']['setting']['wsq_fid'], 'totalposts' => $posts, 'totalmembers' => $_G['cache']['userstats']['totalmembers']);
savecache('wsq_checkinfo', array('variable' => $array, 'expiration' => TIMESTAMP));
} else {
$array = $_G['cache']['wsq_checkinfo']['variable'];
}
} else {
$array = array();
}
$array['testcookie'] = $_G['cookie']['testcookie'];
$data = mobile_core::json($array);
mobile_core::make_cors($_SERVER['REQUEST_METHOD'], REQUEST_METHOD_DOMAIN);
echo $data;