本文整理汇总了PHP中igbinary_unserialize函数的典型用法代码示例。如果您正苦于以下问题:PHP igbinary_unserialize函数的具体用法?PHP igbinary_unserialize怎么用?PHP igbinary_unserialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了igbinary_unserialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: phpUnserialize
/**
* @param mixed $data Data to unserialize
* @param bool|true $useIgBinary Use igBinary extension if supported
*
* @return string
*/
protected function phpUnserialize($data, $useIgBinary = true)
{
if ($this->isIgBinarySupported() && $useIgBinary) {
return igbinary_unserialize($data);
}
return unserialize($data);
}
示例2: unserialize
public function unserialize($data)
{
if ($this->igbinary) {
return igbinary_unserialize($data);
}
return unserialize($data);
}
示例3: unserialize
protected function unserialize ($value) {
if ($this->igbinary) {
return igbinary_unserialize($value);
}
return unserialize($value);
}
示例4: get
/**
* Attempt to retrieve a value from the cache server, if not set it.
*
* @param string $key Key we can use to retrieve the data.
*
* @return bool|string False on failure or String, data belonging to the key.
* @access public
*/
public function get($key)
{
if ($this->connected === true && $this->ping() === true) {
$data = $this->server->get($key);
return $this->isRedis ? $this->IgBinarySupport ? igbinary_unserialize($data) : unserialize($data) : $data;
}
return false;
}
示例5: _tempData_unserialize
private function _tempData_unserialize($data)
{
if (true === $this->_has_igbinary_status) {
return igbinary_unserialize($data);
} else {
return unserialize($data);
}
}
示例6: unserialize
private static function unserialize($o)
{
$igbinary = extension_loaded('igbinary');
if ($igbinary) {
return @igbinary_unserialize($o);
}
return @unserialize($o);
}
示例7: unpack
/**
*/
public function unpack($data)
{
$out = igbinary_unserialize($data);
if (!is_null($out) || $data == igbinary_serialize(null)) {
return $out;
}
throw new Horde_Pack_Exception('Error when unpacking serialized data.');
}
示例8: unserialize
/**
* @param $val
* @return mixed
*/
function unserialize($val)
{
if (function_exists('igbinary_unserialize')) {
return \igbinary_unserialize($val);
} else {
return \unserialize($val);
}
}
示例9: _unserialize
private function _unserialize($data)
{
if ($this->_has_igbinary) {
return igbinary_unserialize($data);
} else {
return unserialize($data);
}
}
示例10: ADecode
/**
* @return array
*/
public static function ADecode($sData)
{
$ret = igbinary_unserialize($sData);
if (null === $ret) {
return false;
}
return $ret;
}
示例11: convert
protected function convert($input)
{
if (function_exists('igbinary_unserialize')) {
$result = igbinary_unserialize($input);
} else {
$result = array();
}
return $result;
}
示例12: unserialize
/**
* unserialize
*
* @param string $value
*
* @return mixed
*/
public function unserialize($value)
{
if (function_exists('igbinary_unserialize')) {
return igbinary_unserialize($value);
} else {
// fallback
return unserialize($value);
}
}
示例13: unserialize
/**
* Deserialize igbinary string to PHP value
*
* @param string|binary $serialized
* @param array $opts
* @return mixed
* @throws Zend_Serializer_Exception on igbinary error
*/
public function unserialize($serialized, array $opts = array())
{
$ret = igbinary_unserialize($serialized);
if ($ret === null && $serialized !== self::$_serializedNull) {
$lastErr = error_get_last();
throw new Zend_Serializer_Exception($lastErr['message']);
}
return $ret;
}
示例14: decrypt
/**
* 解密
* @param $data 加密后的字符串;
* @return bool|mixed|string 返回加密前的数据类型。
*/
public function decrypt($data)
{
if (empty($data)) {
return '';
}
$data = explode('?', $data)[0];
$data = base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
$data = Yii::$app->getSecurity()->decryptByKey($data, self::$_key);
return igbinary_unserialize($data);
}
示例15: test_speed_unserialize_igbinary
function test_speed_unserialize_igbinary($data, $loops)
{
$serdata = igbinary_serialize($data);
$start = microtime(true);
for ($i = 0; $i < $loops; ++$i) {
$tmp = igbinary_unserialize($serdata);
}
$end = microtime(true);
return $end - $start;
}