當前位置: 首頁>>代碼示例>>PHP>>正文


PHP config::write方法代碼示例

本文整理匯總了PHP中config::write方法的典型用法代碼示例。如果您正苦於以下問題:PHP config::write方法的具體用法?PHP config::write怎麽用?PHP config::write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在config的用法示例。


在下文中一共展示了config::write方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checktoken

 function checktoken()
 {
     if ($this->shopid) {
         $config = new config("autorun_{$this->shopid}.php", hopedir);
     } else {
         $config = new config('autorun.php', hopedir);
     }
     $tempinfo = $config->getInfo();
     if (isset($tempinfo['access_token']) && isset($tempinfo['wx_time'])) {
         $btime = time() - $tempinfo['wx_time'];
         if ($btime < 7000) {
             $this->access_token = $tempinfo['access_token'];
             return true;
         }
     }
     //通過post方法獲取  當前token;
     $info = $this->vpost('https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->wxappid . '&secret=' . $this->wxsecret);
     $info = json_decode($info, true);
     if (isset($info['access_token'])) {
         $test['access_token'] = $info['access_token'];
         $this->access_token = $info['access_token'];
         $test['wx_time'] = time();
         $config->write($test);
         return true;
     } else {
         $this->errId = $info['errcode'];
         return false;
     }
 }
開發者ID:snamper,項目名稱:xiaoshuhaochi,代碼行數:29,代碼來源:wx_s.php

示例2: saveadvtype

 function saveadvtype()
 {
     $arrtypename = IReq::get('typename');
     $arrtypeurl = IReq::get('typeurl');
     $arrtypeorder = IReq::get('typeorder');
     if (empty($arrtypename)) {
         $this->message('廣告類型不能為空');
     }
     if (is_array($arrtypename)) {
         $orderinfo = array();
         foreach ($arrtypename as $key => $value) {
             if (isset($arrtypeorder[$key])) {
                 $dokey = !empty($arrtypeorder[$key]) ? $arrtypeorder[$key] : 0;
                 array_push($orderinfo, $dokey);
             } else {
                 array_push($orderinfo, 0);
             }
         }
         $orderinfo = array_unique($orderinfo);
         sort($orderinfo);
         $newinfo = array();
         foreach ($orderinfo as $key => $value) {
             foreach ($arrtypename as $k => $v) {
                 if (isset($arrtypeorder[$k])) {
                     $checkcode = !empty($arrtypeorder[$k]) ? $arrtypeorder[$k] : 0;
                 } else {
                     $checkcode = 0;
                 }
                 if ($checkcode == $value) {
                     $data['typename'] = $v;
                     $data['typeurl'] = isset($arrtypeurl[$k]) ? $arrtypeurl[$k] : '';
                     $data['typeorder'] = $checkcode;
                     $newinfo[] = $data;
                 }
             }
         }
     } else {
         $newinfo['typename'] = $arrtypename;
         $newinfo['typeurl'] = $arrtypeurl;
         $newinfo['typeorder'] = $arrtypeorder;
     }
     $siteinfo['advtype'] = serialize($newinfo);
     $config = new config('hopeconfig.php', hopedir);
     $config->write($siteinfo);
     $this->success('操作成功');
 }
開發者ID:snamper,項目名稱:xiaoshuhaochi,代碼行數:46,代碼來源:adminmethod.php

示例3: wxsetsave

 function wxsetsave()
 {
     $info['wxtoken'] = trim(IReq::get('wxtoken'));
     $info['wxappid'] = trim(IReq::get('wxappid'));
     $info['wxsecret'] = trim(IReq::get('wxsecret'));
     if (empty($info['wxtoken'])) {
         $this->message('自定義token不能為空');
     }
     if (empty($info['wxappid'])) {
         $this->message('微信appid不能為空');
     }
     if (empty($info['wxsecret'])) {
         $this->message('微信secret不能為空');
     }
     $config = new config('hopeconfig.php', hopedir);
     $config->write($info);
     $this->success('操作成功');
 }
開發者ID:snamper,項目名稱:xiaoshuhaochi,代碼行數:18,代碼來源:adminmethod.php

示例4: savepsset

 function savepsset()
 {
     $locationtype = intval(IFilter::act(IReq::get('locationtype')));
     if ($locationtype == 1) {
         $test = Mysite::$app->config['baidumapkey'];
         if (empty($test)) {
             $this->message('請先設置百度地圖的secrkey');
         }
     }
     $pstype = intval(IFilter::act(IReq::get('pstype')));
     $savearray['locationtype'] = $locationtype;
     $savearray['pstype'] = $pstype;
     $savearray['psvalue1'] = IFilter::act(IReq::get('mapay1'));
     $savearray['psvalue2'] = IFilter::act(IReq::get('mapay2'));
     $savearray['psvalue3'] = IFilter::act(IReq::get('mapay3'));
     if ($pstype == 1) {
         //統一配送費時
         $savearray['psvalue1'] = IFilter::act(IReq::get('allpay'));
     } elseif ($pstype == 5) {
         $savearray['psvalue1'] = IFilter::act(IReq::get('caipay1'));
         $savearray['psvalue2'] = IFilter::act(IReq::get('caipay2'));
     }
     $siteinfo['psset'] = serialize($savearray);
     $siteinfo['opensitesend'] = intval(IFilter::act(IReq::get('opensitesend')));
     $siteinfo['openshopsend'] = intval(IFilter::act(IReq::get('openshopsend')));
     $config = new config('hopeconfig.php', hopedir);
     $config->write($siteinfo);
     $this->success('操作成功!');
 }
開發者ID:snamper,項目名稱:xiaoshuhaochi,代碼行數:29,代碼來源:adminmethod.php

示例5: saveorderbz

 function saveorderbz()
 {
     $this->checkadminlogin();
     $arrtypename = IReq::get('typename');
     $arrtypename = is_array($arrtypename) ? $arrtypename : array($arrtypename);
     $siteinfo['orderbz'] = serialize($arrtypename);
     $config = new config('hopeconfig.php', hopedir);
     $config->write($siteinfo);
     $this->success('操作成功');
 }
開發者ID:snamper,項目名稱:xiaoshuhaochi,代碼行數:10,代碼來源:adminmethod.php

示例6: savescore

 function savescore()
 {
     $siteinfo['commentscore'] = intval(IReq::get('commentscore'));
     $siteinfo['loginscore'] = intval(IReq::get('loginscore'));
     $siteinfo['regesterscore'] = intval(IReq::get('regesterscore'));
     $siteinfo['commenttype'] = intval(IReq::get('commenttype'));
     $siteinfo['scoretocost'] = intval(IReq::get('scoretocost'));
     $siteinfo['maxdayscore'] = intval(IReq::get('maxdayscore'));
     $siteinfo['commentday'] = intval(IReq::get('commentday'));
     $config = new config('hopeconfig.php', hopedir);
     $config->write($siteinfo);
     $this->success('操作成功');
 }
開發者ID:snamper,項目名稱:xiaoshuhaochi,代碼行數:13,代碼來源:adminmethod.php

示例7: savetempset

 function savetempset()
 {
     $tempname = IFilter::act(IReq::get('modulename'));
     if (empty($tempname)) {
         $this->message('模板名稱不能為空');
     }
     $logindir = hopedir . '/templates';
     if (!file_exists($logindir . '/' . $tempname . '/stro.txt')) {
         $this->message('模板文件不存在');
     }
     $siteinfo['sitetemp'] = $tempname;
     $config = new config('hopeconfig.php', hopedir);
     $config->write($siteinfo);
     IFile::clearDir('templates_c');
     $this->success('操作成功');
 }
開發者ID:snamper,項目名稱:xiaoshuhaochi,代碼行數:16,代碼來源:adminmethod.php

示例8: smssetsave

 function smssetsave()
 {
     $config = new config('hopeconfig.php', hopedir);
     $siteinfo['smstype'] = IReq::get('smstype');
     if ($siteinfo['smstype'] == 1) {
         $siteinfo['smkey'] = IReq::get('smkey');
         $siteinfo['smpassword'] = IReq::get('smpassword');
         $siteinfo['smacount'] = IReq::get('smacount');
         $siteinfo['smeName'] = IReq::get('smeName');
         $siteinfo['smlinkMan'] = IReq::get('smlinkMan');
         $siteinfo['smphoneNum'] = IReq::get('smphoneNum');
         $siteinfo['smmobile'] = IReq::get('smmobile');
         $siteinfo['smemail'] = IReq::get('smemail');
         $siteinfo['smfax'] = IReq::get('smfax');
         $siteinfo['smaddress'] = IReq::get('smaddress');
         $siteinfo['smpostcode'] = IReq::get('smpostcode');
         if (empty($siteinfo['smkey'])) {
             $this->message('賬號不能為空');
         }
         if (empty($siteinfo['smpassword'])) {
             $this->message('密碼不能為空');
         }
         if (empty($siteinfo['smacount'])) {
             $this->message('KEY不能為空');
         }
         if (empty($siteinfo['smeName'])) {
             $this->message('公司名稱不能為空');
         }
         if (empty($siteinfo['smlinkMan'])) {
             $this->message('聯係人不能為空');
         }
         if (empty($siteinfo['smphoneNum'])) {
             $this->message('聯係電話不能為空');
         }
         if (empty($siteinfo['smmobile'])) {
             $this->message('聯係手機不能為空');
         }
         if (empty($siteinfo['smemail'])) {
             $this->message('聯係人郵箱不能為空');
         }
         if (empty($siteinfo['smfax'])) {
             $this->message('傳真號不能為空');
         }
         if (empty($siteinfo['smaddress'])) {
             $this->message('聯係地址不能為空');
         }
         if (empty($siteinfo['smpostcode'])) {
             $this->message('郵政編碼不能空');
         }
         $docheck['smkey'] = $siteinfo['smkey'];
         $docheck['smpassword'] = $siteinfo['smpassword'];
         $docheck['smacount'] = $siteinfo['smacount'];
         $config->write($docheck);
         $sendmobile = new mobile();
         $checkinfo = $sendmobile->login();
         if ($checkinfo != 'ok') {
             $this->message($checkinfo);
         }
         $checkinfo = $sendmobile->registDetailInfo($siteinfo);
         if ($checkinfo != 'ok') {
             $this->message($checkinfo);
         }
     } else {
         $siteinfo['sms86ac'] = IReq::get('sms86ac');
         $siteinfo['sms86pd'] = IReq::get('sms86pd');
         $siteinfo['smstype'] = IReq::get('smstype');
         if (empty($siteinfo['sms86ac'])) {
             $this->message('賬號不能為空');
         }
         if (empty($siteinfo['sms86pd'])) {
             $this->message('密碼不能為空');
         }
     }
     $config->write($siteinfo);
     $this->success('操作成功! ');
 }
開發者ID:snamper,項目名稱:xiaoshuhaochi,代碼行數:76,代碼來源:adminmethod.php


注:本文中的config::write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。