本文整理汇总了PHP中xml_unserialize函数的典型用法代码示例。如果您正苦于以下问题:PHP xml_unserialize函数的具体用法?PHP xml_unserialize怎么用?PHP xml_unserialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xml_unserialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notifyAction
public function notifyAction(Request $request)
{
$this->initUcenter();
$_DCACHE = $get = $post = array();
$code = @$_GET['code'];
parse_str(uc_authcode($code, 'DECODE', UC_KEY), $get);
if (MAGIC_QUOTES_GPC) {
$get = $this->stripslashes($get);
}
$timestamp = time();
if ($timestamp - $get['time'] > 3600) {
return new Response('Authracation has expiried');
}
if (empty($get)) {
return new Response('Invalid Request');
}
// $action = $get['action'];
$this->requireClientFile('lib/xml.class.php');
$xml = file_get_contents('php://input');
$post = xml_unserialize($xml);
if (!in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings'))) {
return new Response(API_RETURN_FAILED);
}
$method = 'do' . ucfirst($get['action']);
$result = $this->{$method}($request, $get, $post);
return new Response($result);
}
示例2: parseRequest
private function parseRequest()
{
$_DCACHE = $get = $post = array();
$code = @$_GET['code'];
parse_str($this->_authcode($code, 'DECODE', UC_KEY), $get);
if (MAGIC_QUOTES_GPC) {
$get = $this->_stripslashes($get);
}
$timestamp = time();
if ($timestamp - $get['time'] > 3600) {
exit('Authracation has expiried');
}
// error_log("get".print_r($get,true));
if (empty($get)) {
exit('Invalid Request');
}
$action = $get['action'];
require_once DISCUZ_ROOT . './uc_client/lib/xml.class.php';
$post = xml_unserialize(file_get_contents('php://input'));
Yii::log($get, 'debug');
Yii::log($post, 'debug');
$_GET = $get;
$_POST = $post;
$this->route = $this->ucController . '/' . $action;
error_log("route" . $this->route);
if (!in_array($action, array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings'))) {
exit(API_RETURN_FAILED);
}
}
示例3: unserialize
public static function unserialize($arr, $htmlon = 0)
{
if (!function_exists('xml_serialize')) {
include API_ROOT . 'uc_client/lib/xml.class.php';
}
return xml_unserialize($arr, $htmlon);
}
示例4: index
function index()
{
/* 只提供普通的http通知方式 */
error_reporting(0);
set_magic_quotes_runtime(0);
$_DCACHE = $get = $post = array();
$code = @$_GET['code'];
parse_str(_authcode($code, 'DECODE', UC_KEY), $get);
$get = _stripslashes($get);
$timestamp = time();
if ($timestamp - $get['time'] > 3600) {
exit('Authracation has expiried');
}
if (empty($get)) {
exit('Invalid Request');
}
$action = $get['action'];
include ROOT_PATH . '/uc_client/lib/xml.class.php';
$post = xml_unserialize(file_get_contents('php://input'));
if (in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings'))) {
exit($this->{$get}['action']($get, $post));
} else {
exit(API_RETURN_FAILED);
}
}
示例5: index
public function index()
{
//note 普通的 http 通知方式
if (!defined('IN_UC')) {
error_reporting(0);
set_magic_quotes_runtime(0);
defined('MAGIC_QUOTES_GPC') || define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());
service("Passport");
$_DCACHE = $get = $post = array();
$code = @$_GET['code'];
parse_str(_authcode($code, 'DECODE', UC_KEY), $get);
if (MAGIC_QUOTES_GPC) {
$get = _stripslashes($get);
}
$timestamp = time();
if ($timestamp - $get['time'] > 3600) {
exit('Authracation has expiried');
}
if (empty($get)) {
exit('Invalid Request');
}
$action = $get['action'];
require_once DISCUZ_ROOT . './uc_client/lib/xml.class.php';
$post = xml_unserialize(file_get_contents('php://input'));
if (in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings'))) {
exit($this->{$get}['action']($get, $post));
} else {
exit(API_RETURN_FAILED);
}
}
}
示例6: __construct
function __construct()
{
parent::__construct();
define('UC_CLIENT_VERSION', '1.6.0');
define('UC_CLIENT_RELEASE', '20110501');
define('API_DELETEUSER', 1);
define('API_RENAMEUSER', 1);
define('API_GETTAG', 1);
define('API_SYNLOGIN', 1);
define('API_SYNLOGOUT', 1);
define('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_GETCREDIT', 1);
define('API_GETCREDITSETTINGS', 1);
define('API_UPDATECREDITSETTINGS', 1);
define('API_ADDFEED', 1);
define('API_RETURN_SUCCEED', '1');
define('API_RETURN_FAILED', '-1');
define('API_RETURN_FORBIDDEN', '1');
define('IN_API', true);
define('CURSCRIPT', 'api');
if (!defined('IN_UC')) {
// require_once '../source/class/class_core.php';
Vendor("source.class.class_core");
$discuz = C::app();
$discuz->init();
require DISCUZ_ROOT . './config/config_ucenter.php';
$get = $post = array();
$code = @$_GET['code'];
parse_str(authcode($code, 'DECODE', UC_KEY), $get);
if (time() - $get['time'] > 3600) {
exit('Authracation has expiried');
}
if (empty($get)) {
exit('Invalid Request');
}
include_once DISCUZ_ROOT . './uc_client/lib/xml.class.php';
$post = xml_unserialize(file_get_contents('php://input'));
if (in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcredit', 'getcreditsettings', 'updatecreditsettings', 'addfeed'))) {
$uc_note = new uc_note();
echo $uc_note->{$get}['action']($get, $post);
exit;
} else {
exit(API_RETURN_FAILED);
}
} else {
exit;
}
}
示例7: api
public function api(UcenterNoteApi $note)
{
$code = Request::get('code');
parse_str(Helper::authcode($code, 'DECODE', Config::get('ucenter.key')), $get);
Request::server('REQUEST_TIME') - $get['time'] > 3600 && exit('Authracation has expiried');
empty($get) && exit('Invalid Request');
$action = $get['action'];
$_input = file_get_contents('php://input');
$post = $_input ? xml_unserialize($_input) : [];
$allowActions = ['test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings', 'getcredit'];
if (in_array($action, $allowActions)) {
$return = call_user_func([$note, $action], $get, $post);
return response($return);
} else {
return response(self::API_RETURN_FAILED);
}
}
示例8: initRequest
/**
* 解析请求
* @return boolean
*/
public function initRequest()
{
$code = @$_GET['code'];
parse_str(_uc_authcode($code, 'DECODE', UC_KEY), $get);
if (get_magic_quotes_gpc()) {
$get = _uc_stripslashes($get);
}
if (empty($get)) {
$this->error = '非法请求';
return false;
}
$timestamp = time();
if ($timestamp - $get['time'] > 3600) {
$this->error = '请求有效期已过';
return false;
}
$this->code = $code;
$this->action = parse_name($get['action'], '1');
$this->post = xml_unserialize(file_get_contents('php://input'));
}
示例9: updatedata
function updatedata($appid, $data) {
$appid = intval($appid);
include_once UC_ROOT.'lib/xml.class.php';
$data = xml_unserialize($data);
$this->base->load('app');
$data[0] = addslashes($data[0]);
$datanew = array();
if(is_array($data[1])) {
foreach($data[1] as $r) {
$datanew[] = $_ENV['misc']->array2string($r);
}
}
$tmp = $_ENV['app']->get_apps('type', "appid='$appid'");
$datanew = addslashes($tmp[0]['type']."\t".implode("\t", $datanew));
if(!empty($data[0])) {
$return = $this->db->result_first("SELECT count(*) FROM ".UC_DBTABLEPRE."tags WHERE tagname='$data[0]' AND appid='$appid'");
if($return) {
$this->db->query("UPDATE ".UC_DBTABLEPRE."tags SET data='$datanew', expiration='".$this->base->time."' WHERE tagname='$data[0]' AND appid='$appid'");
} else {
$this->db->query("INSERT INTO ".UC_DBTABLEPRE."tags (tagname, appid, data, expiration) VALUES ('$data[0]', '$appid', '$datanew', '".$this->base->time."')");
}
}
}
示例10: unserialize
function unserialize($s)
{
if (file_exists(UC_ROOT . RELEASE_ROOT . './lib/xml.class.php')) {
include_once UC_ROOT . RELEASE_ROOT . './lib/xml.class.php';
} else {
include_once UC_ROOT . './lib/xml.class.php';
}
return xml_unserialize($s);
}
示例11: sync_unserialize
function sync_unserialize($s, $release_root)
{
if (!function_exists('xml_unserialize')) {
if ($release_root && file_exists(UC_ROOT . $release_root . './lib/xml.class.php')) {
include UC_ROOT . $release_root . './lib/xml.class.php';
} else {
include UC_ROOT . './lib/xml.class.php';
}
}
return xml_unserialize($s);
}
示例12: get_plugin_by_name
function get_plugin_by_name($pluginname)
{
$dir = UC_ROOT . './plugin';
$s = file_get_contents($dir . '/' . $pluginname . '/plugin.xml');
return xml_unserialize($s, TRUE);
}
示例13: AlipayNotify
<?php
require_once "alipayadd.config.php";
require_once "lib/alipay_notify.class.php";
$alipayNotify = new AlipayNotify($aliapy_config);
$verify_result = $alipayNotify->verifyNotify();
if ($verify_result) {
//验证成功
$receive_address = get_magic_quotes_gpc() ? stripslashes($_POST['receive_address']) : $_POST['receive_address'];
$ali_address = array();
$receive_address = xml_unserialize($receive_address);
if ($receive_address) {
$ali_address['prov'] = $receive_address['receiveAddress']['prov'];
$ali_address['city'] = $receive_address['receiveAddress']['city'];
$ali_address['area'] = $receive_address['receiveAddress']['area'];
$ali_address['address'] = $receive_address['receiveAddress']['address'];
$ali_address['fullname'] = $receive_address['receiveAddress']['fullname'];
$ali_address['mobile_phone'] = $receive_address['receiveAddress']['mobile_phone'];
$ali_address['post'] = $receive_address['receiveAddress']['post'];
}
if ($ali_address) {
Session::Set('ali_add', $ali_address);
redirect(get_loginpage(WEB_ROOT . '/index.php'));
} else {
Session::Set('error', '获取物流地址失败');
redirect(get_loginpage(WEB_ROOT . '/index.php'));
}
} else {
//验证失败
//如要调试,请看alipay_notify.php页面的verifyNotify函数,比对sign和mysign的值是否相等,或者检查$veryfy_result有没有返回true
echo "验证失败";
示例14: array
$_DCACHE = $get = $post = array();
$code = isset($GLOBALS['code']) ? $GLOBALS['code'] : '';
$get = $GLOBALS;
parse_str(_authcode($code, 'DECODE', UC_KEY), $get);
if (MAGIC_QUOTES_GPC) {
$get = _stripslashes($get);
}
if (SYS_TIME - $get['time'] > 3600) {
exit('Authracation has expiried');
}
if (empty($get)) {
exit('Invalid Request');
}
require_once WWW_ROOT . './api/uc_client/lib/xml.class.php';
$post = file_get_contents('php://input');
$post = xml_unserialize($post);
if (in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings'))) {
$uc_note = new uc_note();
header('Content-type: text/html; charset=' . CHARSET);
echo $uc_note->{$get}['action']($get, $post);
exit;
} else {
exit(API_RETURN_FAILED);
}
class uc_note
{
private $member, $uc_db, $applist;
function __construct()
{
//$this->uc_db = load_class('db', 'core', 'uc_mysql_config');
define('M', 'member');
示例15: fetch_plugins
function fetch_plugins()
{
$plugindir = UC_ROOT . './plugin';
$d = opendir($plugindir);
while ($f = readdir($d)) {
if ($f != '.' && $f != '..' && is_dir($plugindir . '/' . $f)) {
$pluginxml = $plugindir . $f . '/plugin.xml';
$plugins[] = xml_unserialize($pluginxml);
}
}
}