当前位置: 首页>>代码示例>>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;未经允许,请勿转载。