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


PHP unserialize函数代码示例

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


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

示例1: indexAction

 /**
  * Reference purchase summary
  *
  * @Route()
  * @Method({"GET", "POST"})
  * @Template()
  *
  * @param Request $request
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function indexAction(Request $request)
 {
     $previouslyPostedData = null;
     // if we are not posting new data, and a request for $this->formType is stored in the session, prepopulate the form with the stored request
     $storedRequest = unserialize($request->getSession()->get($this->formType->getName()));
     if ($request->isMethod('GET') && $storedRequest instanceof Request) {
         $previouslyPostedData = $this->createForm($this->formType)->handleRequest($storedRequest)->getData();
     }
     $form = $this->createForm($this->formType, $previouslyPostedData);
     if ($request->isMethod('POST')) {
         $form->submit($request);
         if ($form->isValid()) {
             // Persist the case to IRIS
             /** @var ReferencingCase $case */
             $case = $form->getData()['case'];
             $this->irisEntityManager->persist($case);
             /** @var ReferencingApplication $application */
             foreach ($case->getApplications() as $application) {
                 // Always default
                 $application->setSignaturePreference(SignaturePreference::SCAN_DECLARATION);
                 $this->irisEntityManager->persist($application, array('caseId' => $case->getCaseId()));
                 // Persist each guarantor of the application
                 if (null !== $application->getGuarantors()) {
                     foreach ($application->getGuarantors() as $guarantor) {
                         $this->irisEntityManager->persist($guarantor, array('applicationId' => $application->getApplicationId()));
                     }
                 }
             }
             $request->getSession()->set('submitted-case', serialize($case));
             // Send the user to the success page
             return $this->redirect($this->generateUrl('barbon_hostedapi_agent_reference_newreference_tenancyagreement_index'), 301);
         }
     }
     return array('form' => $form->createView());
 }
开发者ID:AlexEvesDeveloper,项目名称:hl-stuff,代码行数:45,代码来源:NewController.php

示例2: buildjs

function buildjs()
{
    $t = $_GET["t"];
    $time = time();
    $MEPOST = 0;
    header("content-type: application/x-javascript");
    $tpl = new templates();
    $page = CurrentPageName();
    $array = unserialize(@file_get_contents($GLOBALS["CACHEFILE"]));
    $prc = intval($array["POURC"]);
    $title = $tpl->javascript_parse_text($array["TEXT"]);
    $md5file = trim(md5_file($GLOBALS["LOGSFILES"]));
    echo "// CACHE FILE: {$GLOBALS["CACHEFILE"]} {$prc}%\n";
    echo "// LOGS FILE: {$GLOBALS["LOGSFILES"]} - {$md5file} " . strlen($md5file) . "\n";
    if ($prc == 0) {
        if (strlen($md5file) < 32) {
            echo "\n\t// PRC = {$prc} ; md5file={$md5file}\n\tfunction Start{$time}(){\n\t\t\tif(!RTMMailOpen()){return;}\n\t\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}');\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
            return;
        }
    }
    if ($md5file != $_GET["md5file"]) {
        echo "\n\tvar xStart{$time}= function (obj) {\n\t\tif(!document.getElementById('text-{$t}')){return;}\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){\n\t\t\tdocument.getElementById('text-{$t}').value=res;\n\t\t}\t\t\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$md5file}');\n\t}\t\t\n\t\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Filllogs', 'yes');\n\t\tXHR.appendData('t', '{$t}');\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('{$page}', 'POST',xStart{$time},false); \n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
        return;
    }
    if ($prc > 100) {
        echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\tdocument.getElementById('title-{$t}').style.border='1px solid #C60000';\n\t\tdocument.getElementById('title-{$t}').style.color='#C60000';\n\t\t\$('#progress-{$t}').progressbar({ value: 100 });\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
        return;
    }
    if ($prc == 100) {
        echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\t\$('#SQUID_ARTICA_QUOTA_RULES').flexReload();\n\t\tRTMMailHide();\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
        return;
    }
    echo "\t\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}');\n\t}\n\tsetTimeout(\"Start{$time}()\",1500);\n";
}
开发者ID:articatech,项目名称:artica,代码行数:34,代码来源:squid.global.wl.center.progress.php

示例3: shouldDeserialize

 /**
  * @test
  */
 public function shouldDeserialize()
 {
     $helper = new SamlSpInfoHelper();
     $expectedSamlSpInfo = $helper->getSamlSpInfo();
     $unserializedSamlSpInfo = unserialize(serialize($expectedSamlSpInfo));
     $this->assertEquals($expectedSamlSpInfo, $unserializedSamlSpInfo);
 }
开发者ID:iambrosi,项目名称:SamlSPBundle,代码行数:10,代码来源:SamlSpInfoTest.php

示例4: testSerialization

 public function testSerialization()
 {
     $expression = new ParsedExpression('25', new ConstantNode('25'));
     $serializedExpression = serialize($expression);
     $unserializedExpression = unserialize($serializedExpression);
     $this->assertEquals($expression, $unserializedExpression);
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:7,代码来源:ParsedExpressionTest.php

示例5: Main

function Main()
{
    //header('Content-Type: text/html; charset=iso-8859-1');
    if (isset($_SESSION['casores']) && $_SESSION['casores'] > 0) {
        if ($_POST['k']) {
            $idnodo = $_POST['k'];
            $res = new Resolucao();
            $res->setCodcaso($_SESSION['casores']);
            $hash = $res->BuscaConteudoPelaChave($idnodo);
            if ($hash != false) {
                $res->RegistraVisitaNodo($idnodo);
                if ($hash->ContainsKey("fim")) {
                    if ($hash->getValue("fim") == "S") {
                        // É fim do caso. Deve atualizar status
                        $u = unserialize($_SESSION['usu']);
                        $res->setCodusuario($u->getCodigo());
                        $res->setCodresolucao($_SESSION['codresolucao']);
                        if (!$res->ConcluiResolucao()) {
                            echo $res->getErro();
                        }
                    }
                }
                echo Comuns::Idioma($hash->ToXML());
            } else {
                die(Comuns::Idioma("ERRO: @lng[hash retornou false]"));
            }
        } else {
            die(Comuns::Idioma("ERRO: @lng[Conteúdo não informado]"));
        }
    } else {
        die(Comuns::Idioma("ERRO: @lng[Caso não encontrado]"));
    }
}
开发者ID:GoPlaceIn,项目名称:siacc,代码行数:33,代码来源:ajaxbuscaparterescaso.php

示例6: execute

 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     require_once dirname(__FILE__) . '/sfLimeHarness.class.php';
     $h = new sfLimeHarness(array('force_colors' => isset($options['color']) && $options['color'], 'verbose' => isset($options['trace']) && $options['trace']));
     $h->addPlugins(array_map(array($this->configuration, 'getPluginConfiguration'), $this->configuration->getPlugins()));
     $h->base_dir = sfConfig::get('sf_test_dir');
     $status = false;
     $statusFile = sfConfig::get('sf_cache_dir') . '/.test_all_status';
     if ($options['only-failed']) {
         if (file_exists($statusFile)) {
             $status = unserialize(file_get_contents($statusFile));
         }
     }
     if ($status) {
         foreach ($status as $file) {
             $h->register($file);
         }
     } else {
         // filter and register all tests
         $finder = sfFinder::type('file')->follow_link()->name('*Test.php');
         $h->register($this->filterTestFiles($finder->in($h->base_dir), $arguments, $options));
     }
     $ret = $h->run() ? 0 : 1;
     file_put_contents($statusFile, serialize($h->get_failed_files()));
     if ($options['xml']) {
         file_put_contents($options['xml'], $h->to_xml());
     }
     return $ret;
 }
开发者ID:sensorsix,项目名称:app,代码行数:32,代码来源:sfTestAllTask.class.php

示例7: viewthread_modoption

 public function viewthread_modoption()
 {
     global $_G;
     if (!$_G['adminid']) {
         return false;
     }
     $usergroupsfeedlist = unserialize($_G['setting']['qqgroup_usergroup_feed_list']);
     if (empty($usergroupsfeedlist) || !in_array($_G['groupid'], $usergroupsfeedlist)) {
         if (self::$util->isfounder($_G['member']) == false) {
             return false;
         }
     }
     $tid = $_G['tid'];
     $title = urlencode(trim($_G['forum_thread']['subject']));
     $post = C::t('forum_post')->fetch_all_by_tid_position($_G['fotum_thread']['posttableid'], $_G['tid'], 1);
     include_once libfile('function/discuzcode');
     $content = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/ies", '', trim($post[0]['message']));
     $content = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", '', $content);
     $content = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", '', $content);
     $content = preg_replace("/\\[hide[=]?(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/is", '', $content);
     $content = strip_tags(discuzcode($content, 0, 0, 0));
     $content = preg_replace('%\\[attach\\].*\\[/attach\\]%im', '', $content);
     $content = str_replace('&nbsp;', ' ', $content);
     $content = urlencode(cutstr($content, 50, ''));
     include template('qqgroup:push');
     return trim($return);
 }
开发者ID:tianyunchong,项目名称:php,代码行数:27,代码来源:qqgroup.class.php

示例8: setReferrer

 /**
  * Set column referrer
  *
  * @param string $data The source data.
  * @return string
  */
 public static function setReferrer($data)
 {
     // unserialize
     $data = unserialize($data);
     // return correct data
     return isset($data['server']['HTTP_REFERER']) ? '<a href="' . $data['server']['HTTP_REFERER'] . '">' . $data['server']['HTTP_REFERER'] . '</a>' : '';
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:13,代码来源:statistics.php

示例9: detail

 /**
  **	信息编辑
  **/
 public function detail()
 {
     $id = trim($this->input['id']);
     if (!$id) {
         $this->errorOutput(OBJECT_NULL);
     }
     $info = array();
     $info['files'] = array();
     $info = $this->messagereceived->detail($id);
     $info['files'] = $this->messagereceived->detailfiles($id);
     $info['picture'] = array();
     $info['video'] = array();
     $info['annex'] = array();
     foreach ($info['files'] as $key => $value) {
         if ($value['typeid'] == 1) {
             $info['picture'][] = $value['host'] . $value['dir'] . $value['filepath'] . $value['filename'];
         }
         if ($value['typeid'] == 2) {
             $video_array = array();
             $video_vid = array();
             $video_vid = unserialize($value['backup']);
             $video_array['vid'] = $video_vid['vid'];
             $video_array['pic'] = $video_vid['pic'];
             $video_array['url'] = $value['host'] . $value['dir'] . "/" . $value['filepath'];
             $info['video'][] = $video_array;
         }
         if ($value['typeid'] == 3) {
             $info['annex'][] = $value;
         }
     }
     $this->addItem($info);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:36,代码来源:message_received.php

示例10: fetchObjectFromCache

 protected function fetchObjectFromCache($key)
 {
     if (false === ($result = unserialize($this->cache->get($this->getHierarchyKey($key))))) {
         return [false, null];
     }
     return $result;
 }
开发者ID:aequasi,项目名称:cache-1,代码行数:7,代码来源:RedisCachePool.php

示例11: initAuth

 /**
  * 初始化权限系统
  */
 protected function initAuth()
 {
     $this->config->load('allow');
     $this->allow = $this->config->item('allow');
     foreach ($this->allow as $key => $value) {
         $allow[$key] = $value['auth'];
     }
     if ($this->user['username'] != 'admin') {
         $this->load->model('Groups_model', 'groups');
         $groups = $this->groups->get($this->user['groups']);
         $auth = unserialize($groups->auth);
         foreach ($allow as $ctrl => $value) {
             if (array_key_exists($ctrl, $auth)) {
                 foreach ($value as $func => $value) {
                     if (!in_array($func, $auth[$ctrl])) {
                         unset($allow[$ctrl][$func]);
                     }
                 }
             } else {
                 unset($allow[$ctrl]);
             }
         }
     }
     $this->data['auth'] = $this->auth = $allow;
 }
开发者ID:wangwei1986,项目名称:cms,代码行数:28,代码来源:QD_Controller.php

示例12: indexOp

 public function indexOp()
 {
     //查询会员及其附属信息
     $result = parent::pointshopMInfo(true);
     $member_info = $result['member_info'];
     unset($result);
     $model_member = Model('member');
     //获得会员升级进度
     $membergrade_arr = $model_member->getMemberGradeArr(true, $member_info['member_exppoints'], $member_info['level']);
     Tpl::output('membergrade_arr', $membergrade_arr);
     //处理经验值计算说明文字
     $exppoints_rule = C("exppoints_rule") ? unserialize(C("exppoints_rule")) : array();
     $ruleexplain_arr = array();
     $exppoints_rule['exp_orderrate'] = floatval($exppoints_rule['exp_orderrate']);
     if ($exppoints_rule['exp_orderrate'] > 0) {
         $ruleexplain_arr['exp_order'] = "经验值以有效购物金额作为计算标准,有效购物金额{$exppoints_rule['exp_orderrate']}元=1经验值;";
         $exp_ordermax = intval($exppoints_rule['exp_ordermax']);
         if ($exp_ordermax > 0) {
             $ruleexplain_arr['exp_order'] .= "单个订单最多获得{$exppoints_rule['exp_ordermax']}经验值;";
         }
     }
     $exppoints_rule['exp_login'] = intval($exppoints_rule['exp_login']);
     if ($exppoints_rule['exp_login'] > 0) {
         $ruleexplain_arr['exp_login'] = "会员每天第一次登录获得{$exppoints_rule['exp_login']}经验值;";
     }
     $exppoints_rule['exp_comments'] = intval($exppoints_rule['exp_comments']);
     if ($exppoints_rule['exp_comments'] > 0) {
         $ruleexplain_arr['exp_comments'] = "进行一次订单商品评价将获得{$exppoints_rule['exp_comments']}经验值;";
     }
     Tpl::output('ruleexplain_arr', $ruleexplain_arr);
     //分类导航
     $nav_link = array(0 => array('title' => L('homepage'), 'link' => SHOP_SITE_URL), 1 => array('title' => L('nc_pointprod'), 'link' => urlShop('pointshop', 'index')), 2 => array('title' => '我的成长进度'));
     Tpl::output('nav_link_list', $nav_link);
     Tpl::showpage('pointgrade');
 }
开发者ID:mengtaolin,项目名称:shopping,代码行数:35,代码来源:pointgrade.php

示例13: _dataInLocalLog

 private function _dataInLocalLog()
 {
     $modelGameOperateLog = $this->_getGlobalData('Model_GameOperateLog', 'object');
     $this->_loadCore('Help_SqlSearch');
     //载入sql工具
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($modelGameOperateLog->tName());
     $helpSqlSearch->set_conditions("game_server_id=" . intval($_REQUEST['server_id']));
     $helpSqlSearch->set_conditions("operate_type=" . self::LOGTYPE);
     $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE);
     $helpSqlSearch->set_orderBy('Id desc');
     $sql = $helpSqlSearch->createSql();
     $data = $modelGameOperateLog->select($sql);
     $users = $this->_getGlobalData('user_index_id');
     //获得所有用户的数组
     foreach ($data as &$sub) {
         $sub['user_id'] = $users[$sub['user_id']];
         $sub['create_time'] = date('Y-m-d H:i:s', $sub['create_time']);
         $sub['URL_del'] = $this->_urlLockAccountDel($sub['game_user_id'], $sub['game_user_account'], $sub['game_user_nickname']);
         $sub['info'] = unserialize($sub['info']);
         $sub['endTime'] = $sub['info']['FromGame']['endTime'];
     }
     $this->_assign['dataList'] = $data;
     $this->_loadCore('Help_Page');
     //载入分页工具
     $conditions = $helpSqlSearch->get_conditions();
     $helpPage = new Help_Page(array('total' => $modelGameOperateLog->findCount($conditions), 'perpage' => PAGE_SIZE));
     $this->_assign['pageBox'] = $helpPage->show();
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:29,代码来源:Default_1.class.php

示例14: setUp

 protected function setUp()
 {
     $this->_data['PRODUCT'] = unserialize(file_get_contents(PATH_DADOS . 'products.reg'));
     $this->_data['PROVIDERS'] = unserialize(file_get_contents(PATH_DADOS . 'providers.reg'));
     $this->_data['SECTOR'] = unserialize(file_get_contents(PATH_DADOS . 'sector.reg'));
     $this->_data['TURNOVERS'] = unserialize(file_get_contents(PATH_DADOS . 'turnovers.reg'));
 }
开发者ID:silasrm,项目名称:Backup-PHP,代码行数:7,代码来源:BackupTest.php

示例15: __construct

 public function __construct()
 {
     parent::_initialize();
     $this->token = $this->_get('token');
     $this->wecha_id = $this->wecha_id;
     if (!$this->token) {
         $product_cart_model = M('product_cart');
         $out_trade_no = $this->_get('out_trade_no');
         $order = $product_cart_model->where(array('orderid' => $out_trade_no))->find();
         if (!$order) {
             $order = $product_cart_model->where(array('id' => intval($this->_get('out_trade_no'))))->find();
         }
         $this->token = $order['token'];
     }
     $payConfig = M('Alipay_config')->where(array('token' => $this->token))->find();
     $payConfigInfo = unserialize($payConfig['info']);
     $this->payConfig = $payConfigInfo['weixin'];
     if (ACTION_NAME == 'pay' || ACTION_NAME == 'new_pay') {
         if (empty($this->payConfig['is_old'])) {
             $this->new_pay();
             exit;
         } else {
             $this->pay();
             exit;
         }
     }
 }
开发者ID:hehekeke,项目名称:pigcms,代码行数:27,代码来源:WeixinAction.class.php


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