当前位置: 首页>>代码示例>>PHP>>正文


PHP mb_unserialize函数代码示例

本文整理汇总了PHP中mb_unserialize函数的典型用法代码示例。如果您正苦于以下问题:PHP mb_unserialize函数的具体用法?PHP mb_unserialize怎么用?PHP mb_unserialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mb_unserialize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get

 function get($args = array(), $page_id = 0)
 {
     if (!$this->_check_args($args, $page_id)) {
         return false;
     }
     if (is_array($args[0])) {
         $key = array_shift($args[0]);
         if (count($args[0]) == 0) {
             array_shift($args);
         }
     } else {
         $key = is_array($args) ? array_shift($args) : $args;
     }
     /*
      * There was a PHP notice on the line #35 of array to string conversion ($key was an array). It was impossible to me (Luka) to figure out the what 
      * would the correct thing to do is. The issue was with feature_area/optin(2)
      */
     if (is_array($key)) {
         $key = $key[0];
     }
     $name = '_' . OP_SN . '_' . $key;
     if (!isset($this->_options[$name])) {
         if ($page_id == 0) {
             $page_id = $this->_page_id;
         }
         $temp = get_post_meta($page_id, $name, true);
         $this->_options[$name] = mb_unserialize($temp);
     }
     return _op_traverse_array($this->_options[$name], $args);
 }
开发者ID:shahadat014,项目名称:geleyi,代码行数:30,代码来源:page_options.php

示例2: callback

 function callback($data)
 {
     //	$request_data = get_post(NULL);
     $request_data = $data['request_data'];
     $return_data = json_decode($data['return_data']);
     $return_data = object_array($return_data);
     $CI =& get_instance();
     $CI->load->model('stream_model');
     $order_rs = $CI->stream_model->findByAttributes("order_bn = '" . $request_data['tid'] . "' and from_method='store.trade.reship.add'", 'stream_id desc');
     $reship_id = '';
     if ($order_rs) {
         $request_rs = mb_unserialize($order_rs['request_data']);
         $reship_id = $request_rs['reship_id'];
     }
     if ($return_data['rsp'] == 'succ') {
         //回调接口
         $callback_data = array();
         $callback_data['res'] = '';
         $callback_data['msg_id'] = $data['msg_id'];
         $callback_data['err_msg'] = '';
         $callback_data['data'] = json_encode(array('tid' => $request_data['tid'], 'reship_id' => $reship_id));
         $callback_data['sign'] = '';
         $callback_data['rsp'] = 'succ';
     } else {
         $callback_data = array();
         $callback_data['res'] = $return_data['res'];
         $callback_data['msg_id'] = $data['msg_id'];
         $callback_data['err_msg'] = '';
         $callback_data['data'] = json_encode(array('tid' => $request_data['tid'], 'reship_id' => $reship_id));
         $callback_data['sign'] = '';
         $callback_data['rsp'] = 'fail';
     }
     return array('callback_data' => $callback_data, 'callback_url' => $request_data['callback_url']);
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:34,代码来源:store_trade_aftersale_status_update.php

示例3: _get_callback_data

 function _get_callback_data($request_data, $response_data, $return_data, $form_certi, $stream_id)
 {
     //回调
     $form_certi = $this->certi_model->findByAttributes(array('certi_name' => $form_certi));
     //请求方
     $callback_list = array();
     $request_data = mb_unserialize($request_data);
     $method_name = str_replace('.', '_', $request_data['method']);
     $node_type = $request_data['node_type'] == 'ecos.b2c' ? 'erp_to_ec' : 'ec_to_erp';
     $filenames = get_filenames('application/libraries/apiv/' . $node_type);
     foreach ($filenames as $key2 => $value2) {
         if ($method_name . '.php' == $value2) {
             $this->load->library('apiv/' . $node_type . '/' . $method_name);
             if (method_exists($this->{$method_name}, 'callback')) {
                 //发送回调
                 $callback_rs = $this->{$method_name}->callback(array('request_data' => $request_data, 'return_data' => $return_data, 'response_data' => $response_data, 'msg_id' => md5($stream_id)));
                 $now = time();
                 $callback_data = $callback_rs['callback_data'];
                 $callback_url = $callback_rs['callback_url'];
                 $callback_data['matrix_certi'] = $form_certi['certi_name'];
                 $callback_data['matrix_timestamp'] = $now;
                 $callback_data['sign'] = md5($form_certi['certi_name'] . $form_certi['certi_key'] . $now);
                 $callback_data['stream_id'] = $stream_id;
                 //$return_callback = $this->httpclient->set_timeout(15)->post($rs['callback_url'],$callback_data);//回调发送
                 $callback_list = array('url' => $callback_url, 'method' => 'POST', 'post_data' => $callback_data, 'header' => null, 'options' => array());
             }
         }
     }
     return $callback_list;
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:30,代码来源:crontab_stream.php

示例4: load_from_resultset

 public function load_from_resultset($rs)
 {
     $main = $rs[0];
     $this->id = $main->id;
     $this->element = $main->element;
     $this->template = $main->template;
     $this->name = $main->name;
     $this->type = $main->type;
     $this->options = mb_unserialize($main->options);
     $this->dvalue = $main->dvalue;
     $this->multilanguage = $main->multilanguage;
     $this->helper = $main->helper;
     $this->width = $main->width;
     $this->position = $main->position;
     $this->enabled = $main->enabled;
     // decimal format extra fields
     $this->precision = $main->precision;
     $this->prefix = $main->prefix;
     $this->suffix = $main->suffix;
     if ($this->type == 'date') {
         $this->dvalue = core_ts2date($this->dvalue, false);
     } else {
         if ($this->type == 'datetime') {
             $this->dvalue = core_ts2date($this->dvalue, true);
         }
     }
 }
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:27,代码来源:property.class.php

示例5: get

 public function get($name)
 {
     $strCache = $this->find('cache', array('cachename' => $name), 'cachevalue', 'cacheid DESC');
     return mb_unserialize(substr($strCache['cachevalue'], 10));
     //if (! $result = array_pop ( $result )) return FALSE;
     // if( substr($result, 0, 10) < time() ){$this->del($name);return FALSE;}
     //return mb_unserialize ( substr ( $result, 10 ) );
 }
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:8,代码来源:tsMySqlCache.php

示例6: getInvoice

 public function getInvoice($id)
 {
     $row = $this->db()->row("\n            SELECT \n                bi.*,\n                u.uid,\n                u.login\n            FROM " . self::$_TABLE . " AS bi \n            INNER JOIN " . self::$_TABLE_USER . " AS u ON u.uid = bi.user_id\n            WHERE bi.id = ?i", $id);
     if ($row) {
         $row['fields'] = mb_unserialize($row['fields']);
     }
     return $row;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:8,代码来源:BillInvoicesModel.php

示例7: get_style

 public function get_style()
 {
     $model_setting = Model('setting');
     $list_setting = $model_setting->getListSetting();
     if ($list_setting['decoration_style'] != '') {
         $decoration_style = mb_unserialize($list_setting['decoration_style']);
     }
     $decoration_style = array_map("base64_decode", $decoration_style);
     return $decoration_style;
 }
开发者ID:lehman3087,项目名称:wanhaoshop,代码行数:10,代码来源:decoration.model.php

示例8: select

 function select()
 {
     $result = $this->_performQuery('select');
     $array = array();
     foreach ($result as $row) {
         if (isset($row['file_array']) and !empty($row['file_array'])) {
             include_once 'functions/text_functions.php';
             $array[] = mb_unserialize($row['file_array']);
         }
     }
     return $array;
 }
开发者ID:a2call,项目名称:commsy,代码行数:12,代码来源:cs_file_multi_upload_manager.php

示例9: load_from_resultset

 public function load_from_resultset($rs)
 {
     $main = $rs[0];
     $this->id = $main->id;
     $this->website = $main->website;
     $this->title = $main->title;
     $this->file = $main->file;
     $this->sections = mb_unserialize($main->sections);
     $this->gallery = $main->gallery;
     $this->comments = $main->comments;
     $this->tags = $main->tags;
     $this->statistics = $main->statistics;
     $this->permission = $main->permission;
     $this->enabled = $main->enabled;
 }
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:15,代码来源:template.class.php

示例10: getReqv

 /**
  * Возвращает реквизиты заказчика из слепков
  * @return type
  */
 public function getReqv($emp_id = 0)
 {
     $fields = $this->db()->val("SELECT fields FROM {$this->TABLE} WHERE reserve_id = ?i", $this->reserve_id);
     if ($fields) {
         $reqv = mb_unserialize($fields);
     } elseif ($emp_id) {
         $reqvs = ReservesHelper::getInstance()->getUserReqvs($emp_id);
         if ($reqvs && $reqvs['form_type']) {
             $reqv = $reqvs[$reqvs['form_type']];
             $reqv['form_type'] = $reqvs['form_type'];
             $reqv['rez_type'] = $reqvs['rez_type'];
         }
     }
     return $reqv;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:19,代码来源:ReservesServiceReqvModel.php

示例11: getInvoice

 public function getInvoice($id)
 {
     $row = $this->db()->row('
         SELECT 
             bi.*,
             u.uid,
             u.login
         FROM ' . self::$_TABLE . ' AS bi 
         INNER JOIN ' . self::$_TABLE_USER . ' AS u ON u.uid = bi.user_id
         WHERE bi.id = ?i', $id);
     if ($row) {
         $row['fields'] = mb_unserialize($row['fields']);
     }
     return $row;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:15,代码来源:BillInvoicesModel.php

示例12: load_from_resultset

 public function load_from_resultset($rs)
 {
     global $theme;
     $main = $rs[0];
     $this->id = $main->id;
     $this->website = $main->website;
     $this->code = $main->code;
     $this->title = $main->title;
     $this->notes = $main->notes;
     // serialized (pre nv 2.1) or json object? (>= 2.1)
     // this compatibility fix will be removed in a future version!
     if (substr($main->blocks, 0, 2) == 'a:') {
         $this->blocks = mb_unserialize($main->blocks);
         for ($b = 0; $b < count($this->blocks); $b++) {
             if (is_numeric($this->blocks[$b])) {
                 $this->blocks[$b] = array("type" => "block", "id" => $this->blocks[$b]);
             } else {
                 if (!empty($this->blocks[$b])) {
                     // block group block or block type?
                     if (is_array($theme->block_groups)) {
                         foreach ($theme->block_groups as $key => $bg) {
                             for ($i = 0; $i < count($bg->blocks); $i++) {
                                 if ($bg->blocks[$i]->id == $this->blocks[$b]) {
                                     $this->blocks[$b] = array("type" => "block_group_block", "id" => $this->blocks[$b]);
                                 }
                             }
                         }
                     }
                     // final case, we assume it's a block type
                     if (!is_array($this->blocks[$b])) {
                         $this->blocks[$b] = array("type" => "block_type", "id" => $this->blocks[$b]);
                     }
                 }
             }
         }
     } else {
         $this->blocks = json_decode($main->blocks, true);
     }
 }
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:39,代码来源:block_group.class.php

示例13: load_from_resultset

 public function load_from_resultset($rs)
 {
     $main = $rs[0];
     $this->id = $main->id;
     $this->website = $main->website;
     $this->association = $main->association;
     $this->category = $main->category;
     $this->embedding = $main->embedding;
     $this->template = $main->template;
     $this->date_to_display = empty($main->date_to_display) ? '' : $main->date_to_display;
     $this->date_published = empty($main->date_published) ? '' : $main->date_published;
     $this->date_unpublish = empty($main->date_unpublish) ? '' : $main->date_unpublish;
     $this->date_created = $main->date_created;
     $this->date_modified = $main->date_modified;
     $this->galleries = mb_unserialize($main->galleries);
     $this->comments_enabled_to = $main->comments_enabled_to;
     $this->comments_moderator = $main->comments_moderator;
     $this->access = $main->access;
     $this->permission = $main->permission;
     $this->author = $main->author;
     $this->views = $main->views;
     $this->votes = $main->votes;
     $this->score = $main->score;
     $this->position = $main->position;
     $this->dictionary = webdictionary::load_element_strings('item', $this->id);
     $this->paths = path::loadElementPaths('item', $this->id);
     // to get the array of groups first we remove the "g" character
     $groups = str_replace('g', '', $main->groups);
     $this->groups = explode(',', $groups);
     if (!is_array($this->groups)) {
         $this->groups = array($groups);
     }
     if ($this->association == 'free') {
         $this->category = '';
     }
 }
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:36,代码来源:item.class.php

示例14: _buildItem

 /** Prepares the db_array for the item
  *
  * @param $db_array Contains the data from the database
  *
  * @return array Contains prepared data ( textfunctions applied etc. )
  */
 function _buildItem($db_array)
 {
     include_once 'functions/text_functions.php';
     $db_array['extras'] = mb_unserialize($db_array['extras']);
     return parent::_buildItem($db_array);
 }
开发者ID:a2call,项目名称:commsy,代码行数:12,代码来源:cs_material_manager.php

示例15: themo_import_post_meta

function themo_import_post_meta($postmeta, $post_id, $post)
{
    // Sometimes you want to import files from a source domain. If we do this, we need to replace the URL in the meta data.
    $find = "http://www.pixelglow.ro/themes/planuswp-v2.1/wp-content/uploads/";
    // Search url
    $upload_dir = wp_upload_dir();
    // Replace URL
    $replace = $upload_dir['baseurl'];
    // upload url of the local site.
    // Watch out for newlines inside of serialized data when importing from XML, they will break the import.
    // I've found that the XML leaves a discrepancy of how many chars are in the serialized string. I add 1 extra for each line break.
    $find2 = "\n";
    // look for newline
    $replace2 = "\n ";
    // replace newline + 1 extra char (Hack you say? Yes I am aware.)
    // Multidimensional array loop
    foreach ($postmeta as $key => $value) {
        foreach ($value as $sub_key => $sub_value) {
            // If this is serialized data we need to unserialize to find / replace.
            if (is_serialized($sub_value)) {
                $reserialize = true;
                $sub_value = str_replace($find2, $replace2, $sub_value);
                // Clean up
                $sub_value = mb_unserialize($sub_value);
                // unserialize
            } else {
                $reserialize = false;
            }
            $sub_value = str_replace($find, $replace, $sub_value);
            // Find / replace value 1
            if (is_array($sub_value)) {
                // We may nned to go even deeper...
                foreach ($sub_value as $sub_sub_key => $sub_sub_value) {
                    $sub_value[$sub_sub_key] = str_replace($find, $replace, $sub_sub_value);
                    // Find and replace value 1
                    $sub_value[$sub_sub_key] = str_replace($find2, $replace2, $sub_value[$sub_sub_key]);
                    // Find and replace value 2
                    if (is_array($sub_sub_value)) {
                        // We may nned to go even DEEPER..!
                        foreach ($sub_sub_value as $sub_sub_sub_key => $sub_sub_sub_value) {
                            $sub_value[$sub_sub_key][$sub_sub_sub_key] = str_replace($find, $replace, $sub_sub_sub_value);
                            // Find and replace value 1
                            $sub_value[$sub_sub_key][$sub_sub_sub_key] = str_replace($find2, $replace2, $sub_value[$sub_sub_key][$sub_sub_sub_key]);
                            // Find and replace value 2
                        }
                    }
                }
            }
            // If we unserialized then serialize back up again.
            if ($reserialize) {
                $value[$sub_key] = serialize($sub_value);
            } else {
                $value[$sub_key] = $sub_value;
            }
        }
        $postmeta[$key] = $value;
    }
    return $postmeta;
}
开发者ID:Brad--,项目名称:exigocorp,代码行数:59,代码来源:functions.php


注:本文中的mb_unserialize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。