本文整理汇总了PHP中wddx_deserialize函数的典型用法代码示例。如果您正苦于以下问题:PHP wddx_deserialize函数的具体用法?PHP wddx_deserialize怎么用?PHP wddx_deserialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wddx_deserialize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sessionData
public function sessionData($key)
{
$data = $this->_store->get($key);
$data = wddx_deserialize($data);
$data['ttl'] = $this->_store->ttl($key);
return $data;
}
开发者ID:rchavik,项目名称:RedisSession,代码行数:7,代码来源:SessionStore.php
示例2: unserialize
/**
* @param string $value
* @return array
*/
public function unserialize($value, $defaultValue = array())
{
if (!empty($value)) {
return wddx_deserialize($value);
}
return $defaultValue;
}
开发者ID:beberlei,项目名称:Doctrine-Workflow,代码行数:11,代码来源:WddxSerializer.php
示例3: loadConfigFile
/**
* load configuration from a file
*
* @access public
* @param string $configFile full path of the config file
* @param array $options various options, depending on the reader
* @return array $config complete configuration
*/
function loadConfigFile($configFile, $options = array())
{
if (!function_exists("wddx_add_vars")) {
return patErrorManager::raiseError(PATCONFIGURATION_ERROR_DRIVER_NOT_WORKING, "WDDX extension is not installed on your system.");
}
$fp = @fopen($configFile, "r");
$wddx = fread($fp, filesize($configFile));
$conf = wddx_deserialize($wddx);
if ($conf === NULL) {
return patErrorManager::raiseError(PATCONFIGURATION_ERROR_CONFIG_INVALID, "{$configFile} is no valid WDDX file.");
}
return array("config" => $conf, "externalFiles" => array(), "cacheAble" => true);
}
开发者ID:BackupTheBerlios,项目名称:smart-svn,代码行数:21,代码来源:WDDX.php
示例4: parse_response
function parse_response($data)
{
// skip HTTP header
$data = ltrim(strstr($data, "\r\n\r\n"));
$vars = wddx_deserialize($data);
if ($vars['login'] === TRUE) {
return TRUE;
} else {
// uh oh, hackers
printf("ERROR #%d: %s<br />\n", $vars['error'], $vars['error_str']);
return FALSE;
}
}
开发者ID:SandyS1,项目名称:presentations,代码行数:13,代码来源:client.inc.php
示例5: unserialize
public function unserialize($v)
{
if ($v === NULL) {
return NULL;
}
if (!is_scalar($v)) {
return $v;
}
if ($this->len < 1) {
return wddx_deserialize($v);
}
if (substr($v, 0, $this->len) != $this->prefix) {
return $v;
}
return wddx_deserialize(substr($v, $this->len));
}
开发者ID:Gaia-Interactive,项目名称:gaia_core_php,代码行数:16,代码来源:wddx.php
示例6: unserialize
/**
* Unserialize from WDDX to PHP
*
* @param string $wddx
* @param array $opts
* @return mixed
* @throws RuntimeException on wddx error
*/
public function unserialize($wddx, array $opts = array())
{
$ret = wddx_deserialize($wddx);
if ($ret === null && class_exists('SimpleXMLElement', false)) {
// check if the returned NULL is valid
// or based on an invalid wddx string
try {
$simpleXml = new \SimpleXMLElement($wddx);
if (isset($simpleXml->data[0]->null[0])) {
return null;
// valid null
}
throw new RuntimeException('Invalid wddx');
} catch (\Exception $e) {
throw new RuntimeException($e->getMessage(), 0, $e);
}
}
return $ret;
}
开发者ID:robertodormepoco,项目名称:zf2,代码行数:27,代码来源:Wddx.php
示例7: _unserialize
/**
* Unserialize data.
*
* @param mixed $data The data to be unserialized.
* @param mixed $mode The mode of unserialization. Can be either a
* single mode or array of modes. If array, will be
* unserialized in the order provided.
* @param mixed $params Any additional parameters the unserialization
* method requires.
*
* @return mixed Unserialized data.
* @throws Horde_Serialize_Exception
*/
protected static function _unserialize(&$data, $mode, $params = null)
{
switch ($mode) {
case self::NONE:
break;
case self::RAW:
$data = rawurldecode($data);
break;
case self::URL:
$data = urldecode($data);
break;
case self::WDDX:
$data = wddx_deserialize($data);
break;
case self::BZIP:
// $params['small'] = Use bzip2 'small memory' mode?
$data = bzdecompress($data, isset($params['small']) ? $params['small'] : false);
break;
case self::IMAP8:
$data = quoted_printable_decode($data);
break;
case self::IMAPUTF7:
$data = Horde_String::convertCharset(Horde_Imap_Client_Utf7imap::Utf7ImapToUtf8($data), 'UTF-8', 'ISO-8859-1');
break;
case self::IMAPUTF8:
$data = Horde_Mime::encode($data);
break;
case self::BASIC:
$data2 = @unserialize($data);
// Unserialize can return false both on error and if $data is the
// false value.
if ($data2 === false && $data == serialize(false)) {
return $data2;
}
$data = $data2;
break;
case self::GZ_DEFLATE:
$data = gzinflate($data);
break;
case self::BASE64:
$data = base64_decode($data);
break;
case self::GZ_COMPRESS:
$data = gzuncompress($data);
break;
// $params = Output character set
// $params = Output character set
case self::UTF7:
$data = Horde_String::convertCharset($data, 'utf-7', $params);
break;
// $params = Output character set
// $params = Output character set
case self::UTF7_BASIC:
$data = self::unserialize($data, array(self::BASIC, self::UTF7), $params);
break;
case self::JSON:
$out = json_decode($data);
if (!is_null($out) || strcasecmp($data, 'null') === 0) {
return $out;
}
break;
case self::LZF:
$data = @lzf_decompress($data);
break;
}
if ($data === false) {
throw new Horde_Serialize_Exception('Unserialization failed.');
}
return $data;
}
开发者ID:jubinpatel,项目名称:horde,代码行数:83,代码来源:Serialize.php
示例8: unserialize
/**
* Unserialize from WDDX to PHP
*
* @param string $wddx
* @param array $opts
* @return mixed
* @throws Zend_Serializer_Exception on wddx error
*/
public function unserialize($wddx, array $opts = array())
{
$ret = wddx_deserialize($wddx);
if ($ret === null) {
// check if the returned NULL is valid
// or based on an invalid wddx string
try {
$oldLibxmlDisableEntityLoader = libxml_disable_entity_loader(true);
$dom = new DOMDocument();
$dom->loadXML($wddx);
foreach ($dom->childNodes as $child) {
if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
#require_once 'Zend/Serializer/Exception.php';
throw new Zend_Serializer_Exception('Invalid XML: Detected use of illegal DOCTYPE');
}
}
$simpleXml = simplexml_import_dom($dom);
libxml_disable_entity_loader($oldLibxmlDisableEntityLoader);
if (isset($simpleXml->data[0]->null[0])) {
return null;
// valid null
}
$errMsg = 'Can\'t unserialize wddx string';
} catch (Exception $e) {
$errMsg = $e->getMessage();
}
#require_once 'Zend/Serializer/Exception.php';
throw new Zend_Serializer_Exception($errMsg);
}
return $ret;
}
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:39,代码来源:Wddx.php
示例9: array
<?php
// Our assoc array
$talk = array('id' => 4, 'title' => 'Dynamic Images in PHP - How and When to Use Them', 'date' => '2002-04-29', 'speaker' => 'Alison Gianotto', 'url' => 'http://www.sdphp.net/talks/ag_image');
// we can serialize the value and
// create the packet in one step
$ser1 = wddx_serialize_vars('talk');
echo format_packet($ser1, 'In one step');
// or we could serialize it in several steps
$packet = wddx_packet_start("One of Alison's talks at SDPHP");
wddx_add_vars($packet, 'talk');
$ser2 = wddx_packet_end($packet);
echo format_packet($ser2, 'Making the packet by hand');
// now let's deserialize the packet
$vars = wddx_deserialize($ser2);
echo "<pre>\n<small>\n";
print_r($vars);
echo "</small>\n</pre>\n";
function format_packet($pckt, $title = 'wddx packet')
{
$re = '/^[^<]/';
$pckt = str_replace('>', ">\n", $pckt);
$t = explode("\n", $pckt);
$s = "[ {$title} ]<br>\n<pre>\n";
foreach ($t as $line) {
if (trim($line) == '') {
continue;
} elseif (preg_match($re, $line)) {
$tmp = explode("\n", str_replace('<', "\n<", $line));
$s .= ' <span style="color: blue;">' . $tmp[0] . "</span>\n" . htmlspecialchars($tmp[1]) . "\n";
} else {
开发者ID:SandyS1,项目名称:presentations,代码行数:31,代码来源:wddx_ex.php
示例10: unserialize
/**
* Unserialize from WDDX to PHP
*
* @param string $wddx
* @return mixed
* @throws Exception\RuntimeException on wddx error
*/
public function unserialize($wddx)
{
$ret = wddx_deserialize($wddx);
if ($ret === null && class_exists('SimpleXMLElement', false)) {
// check if the returned NULL is valid
// or based on an invalid wddx string
try {
libxml_disable_entity_loader(true);
$simpleXml = new \SimpleXMLElement($wddx);
libxml_disable_entity_loader(false);
if (isset($simpleXml->data[0]->null[0])) {
return null;
// valid null
}
throw new Exception\RuntimeException('Unserialization failed: Invalid wddx packet');
} catch (\Exception $e) {
throw new Exception\RuntimeException('Unserialization failed: ' . $e->getMessage(), 0, $e);
}
}
return $ret;
}
开发者ID:raZ3l,项目名称:zf2,代码行数:28,代码来源:Wddx.php
示例11: unserialize
/**
* Unserialize from WDDX to PHP
*
* @param string $wddx
* @param array $opts
* @return mixed
* @throws Zend_Serializer_Exception on wddx error
*/
public function unserialize($wddx, array $opts = array())
{
$ret = wddx_deserialize($wddx);
if ($ret === null) {
// check if the returned NULL is valid
// or based on an invalid wddx string
try {
$simpleXml = new SimpleXMLElement($wddx);
if (isset($simpleXml->data[0]->null[0])) {
return null;
// valid null
}
$errMsg = 'Can\'t unserialize wddx string';
} catch (Exception $e) {
$errMsg = $e->getMessage();
}
//$1 'Zend/Serializer/Exception.php';
throw new Zend_Serializer_Exception($errMsg);
}
return $ret;
}
开发者ID:netconstructor,项目名称:Centurion,代码行数:29,代码来源:Wddx.php
示例12: _wddx_decode
function _wddx_decode($data)
{
return wddx_deserialize($data);
}
开发者ID:jobw0110,项目名称:lascolinasobgyn,代码行数:4,代码来源:sessions.php
示例13: var_dump
<var name="113301888545229100">
<struct>
<var name="max">
<number>10</number>
</var>
<var name="cache">
<number>4</number>
</var>
<var name="order">
<struct>
<var name="content_113300831086270200">
<struct>
<var name="CMS_BUILD">
<string>desc</string>
</var>
</struct>
</var>
</struct>
</var>
</struct>
</var>
</struct>
</var>
</struct>
</var>
</struct>
</data>
</wddxpacket>
WDX;
var_dump(wddx_deserialize($wddx));
开发者ID:badlamer,项目名称:hhvm,代码行数:30,代码来源:bug35410_64bit.php
示例14: print_r
<?php
$message = "<wddxPacket version='1.0'><header><comment>my_command</comment></header><data><struct><var name='handle'><number></number></var></struct></data></wddxPacket>";
print_r(wddx_deserialize($message));
print_r(wddx_deserialize($message));
开发者ID:badlamer,项目名称:hhvm,代码行数:5,代码来源:bug52468.php
示例15: file_get_contents
<?php
// Sample REST server - returns uptime information
// Jesus M. Castagnetto
//$host = 'www.example.com';
//$port = 80;
//$serverPath = '/xmlrpc/server.php'
$host = 'jmc.sdsc.edu';
$port = 6666;
$serverPath = '/misc/ws_rest_sample_server.php';
$packet = file_get_contents("http://{$host}:{$port}{$serverPath}");
$tmp = wddx_deserialize($packet);
extract($tmp);
$sep = str_repeat('*', 50);
echo <<<_END
{$sep}
Uptime for : {$host}
Timestamp (UTC) : {$timestamp}
Local time at host : {$uptime['time']}
Host has run for : {$uptime['duration']}
Number of current users : {$uptime['users']}
Average number of jobs in queue
1 minute : {$uptime['load1']}
5 minutes : {$uptime['load5']}
15 minutes : {$uptime['load15']}
{$sep}
_END;
?>
开发者ID:SandyS1,项目名称:presentations,代码行数:29,代码来源:ws_rest_sample_client.php
示例16: _removeUserMap
protected function _removeUserMap($id)
{
$data = $this->_store->get($id);
if (!$data) {
return;
}
$decoded = wddx_deserialize($data);
if (!is_array($decoded)) {
return false;
}
$uid = Hash::get($decoded, AuthComponent::$sessionKey . '.id');
if (empty($uid)) {
return;
}
$usermap = $this->_userMapPrefix . ':' . $uid;
return $this->_store->del($usermap);
}
开发者ID:rchavik,项目名称:RedisSession,代码行数:17,代码来源:RedisSession.php
示例17: dirname
<?php
$path = dirname(__FILE__);
$fp = fopen("php://temp", 'w+');
fputs($fp, "<wddxPacket version='1.0'><header><comment>TEST comment</comment></header><data><struct><var name='var1'><null/></var><var name='var2'><string>some string</string></var><var name='var3'><number>756</number></var><var name='var4'><boolean value='true'/></var></struct></data></wddxPacket>");
rewind($fp);
var_dump(wddx_deserialize($fp));
fclose($fp);
开发者ID:badlamer,项目名称:hhvm,代码行数:8,代码来源:003.php
示例18: chr
<?php
for ($i = 65; $i < 256; $i++) {
if ($i >= 0xc0) {
$v = chr(0xc3) . chr($i - 64);
} elseif ($i >= 0x80) {
$v = chr(0xc2) . chr($i);
} else {
$v = chr($i);
// make it UTF-8
}
$ret = wddx_serialize_value($v);
echo $ret . "\n";
var_dump(bin2hex($v), bin2hex(wddx_deserialize($ret)), $v == wddx_deserialize($ret));
}
开发者ID:badlamer,项目名称:hhvm,代码行数:15,代码来源:bug37569.php
示例19: Decode
/**
* @param $raw
*
* @return mixed
*/
public function Decode($raw)
{
return \wddx_deserialize($raw);
}
开发者ID:saivarunk,项目名称:quark,代码行数:9,代码来源:Quark.php
示例20: var_dump
<?php
// Based on MediaWiki's ApiFormatWddxTest
// The omitted data in the "b" variable previously caused a fatal error
var_dump(wddx_deserialize(<<<EOT
<wddxPacket version="1.0">
<header/>
<data>
<struct>
<var name="a">
<string>foo</string>
</var>
<var name="b"/>
</struct>
</data>
</wddxPacket>
EOT
));
开发者ID:badlamer,项目名称:hhvm,代码行数:18,代码来源:malformed.php
注:本文中的wddx_deserialize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论