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


PHP PwConfigSet::set方法代码示例

本文整理汇总了PHP中PwConfigSet::set方法的典型用法代码示例。如果您正苦于以下问题:PHP PwConfigSet::set方法的具体用法?PHP PwConfigSet::set怎么用?PHP PwConfigSet::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PwConfigSet的用法示例。


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

示例1: doModifyAction

 /**
  * 设置伪静态
  */
 public function doModifyAction()
 {
     list($format, $isopen) = $this->getInput(array('format', 'isopen'));
     $bo = new PwConfigSet('rewrite');
     foreach ($format as $k => $v) {
         if (empty($v) && isset($isopen[$k])) {
             $this->showError('REWRITE:format.empty');
         }
         $bo->set("format.{$k}", $v);
     }
     $addons = Wekit::load('domain.srv.PwDomainService')->getRewriteAddOns();
     $rewriteData = array();
     $unique = array();
     foreach ($addons as $k1 => $v1) {
         $open = isset($isopen[$k1]) ? 1 : 0;
         $bo->set("isopen.{$k1}", $open);
         if ($open) {
             $format_i = preg_replace('/\\{\\w+\\}/', '', $format[$k1]);
             if (in_array($format_i, $unique)) {
                 $this->showError(array('REWRITE:format.conflict', array($format[$k1])));
             }
             $unique[] = $format_i;
             if ($k1 == 'thread') {
                 $rewriteData['cate'] = array('format' => $format[$k1], 'pattern' => $this->_compileFormat($format[$k1]), 'route' => 'bbs/cate/run');
             }
             $rewriteData[$k1] = array('format' => $format[$k1], 'pattern' => $this->_compileFormat($format[$k1]), 'route' => $v1[2]);
         }
     }
     $bo->flush();
     Wekit::C()->setConfig('site', 'rewrite', $rewriteData);
     Wekit::load('domain.srv.PwDomainService')->refreshTplCache();
     Wekit::load('SRV:nav.srv.PwNavService')->updateConfig();
     $this->showMessage('success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:37,代码来源:RewriteController.php

示例2: dorunAction

 /**
  * 设置论坛设置
  */
 public function dorunAction()
 {
     list($bbsname, $title_length_max, $content_length_min, $content_length_max, $check) = $this->getInput(array('bbsname', 'title_length_max', 'content_length_min', 'content_length_max', 'check'));
     $config = new PwConfigSet('bbs');
     $config->set('bbsname', $bbsname)->set('title.length.max', abs(intval($title_length_max)))->set('content.length.min', abs(intval($content_length_min)))->set('content.length.max', abs(intval($content_length_max)))->set('post.check.open', intval($check));
     /*
     list($start_hour, $start_min, $end_hour, $end_min) = $this->getInput(array('start_hour', 'start_min', 'end_hour', 'end_min'), 'post');
     $start_hour = intval($start_hour);
     $start_min = intval($start_min);
     $end_hour = intval($end_hour);
     $end_min = intval($end_min);
     $config->set('post.timing.start_hour', max(0, min(24, $start_hour)))
     	->set('post.timing.start_min', max(0, min(60, $start_min)))
     	->set('post.timing.end_hour', max(0, min(24, $end_hour)))
     	->set('post.timing.end_min', max(0, min(60, $end_min)))
     	->set('post.timing.groups', $this->getInput('timing_groups', 'post'));
     */
     list($check_start_hour, $check_start_min, $check_end_hour, $check_end_min) = $this->getInput(array('check_start_hour', 'check_start_min', 'check_end_hour', 'check_end_min'), 'post');
     $check_start_hour = intval($check_start_hour);
     $check_start_min = intval($check_start_min);
     $check_end_hour = intval($check_end_hour);
     $check_end_min = intval($check_end_min);
     $config->set('post.check.start_hour', max(0, min(24, $check_start_hour)))->set('post.check.start_min', max(0, min(24, $check_start_min)))->set('post.check.end_hour', max(0, min(24, $check_end_hour)))->set('post.check.end_min', max(0, min(24, $check_end_min)))->set('post.check.groups', $this->getInput('check_groups', 'post'));
     $config->flush();
     $this->showMessage('config.setting.success');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:29,代码来源:ConfigbbsController.php

示例3: addAction

 public function addAction()
 {
     $status = $this->getInput('startup_status');
     //
     $config = new PwConfigSet('native');
     if (count($_FILES)) {
         Wind::import('SRV:upload.action.PwStartUpUpload');
         Wind::import('LIB:upload.PwUpload');
         $bhv = new PwStartUpUpload();
         $bhv->filename = 'startup';
         //
         $upload = new PwUpload($bhv);
         if ($upload->check() === true) {
             $result = $upload->execute();
         }
         if ($result !== true) {
             $this->showError($result->getError());
         }
         if (!($data = $bhv->getAttachInfo())) {
             $this->showError('upload.fail');
         }
         //
         $filepath = $upload->getStore()->getAbsolutePath($data['filename'], $data['path']);
         $filecontent = file_get_contents($filepath);
         //
         $config->set('startup.imgmd5', md5($filecontent));
         $config->set('startup.img', $data['path'] . $data['filename']);
     }
     $config->set('startup.status', $status)->flush();
     $this->showMessage('ADMIN:success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:31,代码来源:StartUpController.php

示例4: _setConfigBo

 /**
  * 设置全局TPL配置
  *
  * @param array $style        	
  * @return boolean
  */
 private function _setConfigBo($style)
 {
     $configBo = new PwConfigSet('site');
     $config = Wekit::load('APPCENTER:service.srv.PwInstallApplication')->getConfig('style-type');
     foreach ($config as $k => $v) {
         $configBo->set("theme.{$k}.pack", $v[1]);
     }
     $configBo->set("theme.{$style['style_type']}.default", $style['alias']);
     $configBo->flush();
     return true;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:17,代码来源:PwStyleService.php

示例5: dosetAction

 /**
  *
  * @access public
  * @return
  * @example
  *
  */
 public function dosetAction()
 {
     /*
     $vd = function() {
         foreach(func_get_args() as $arg) {
             error_log(var_export($arg, true));
         }
     };
     */
     $config = new PwConfigSet('notifier');
     /*
      * 如果form的class是J_ajaxForm,可以只按照count($_FILES)来判断;
      * 如果不是,需要判断具体的tmp_name是否为空来判断是否选择了文件。
      *
      */
     if (count($_FILES) && !empty($_FILES['avatar']['tmp_name'])) {
         Wind::import('SRV:upload.action.PwStartUpUpload');
         Wind::import('LIB:upload.PwUpload');
         $bhv = new PwStartUpUpload();
         $bhv->filename = 'avatar';
         $upload = new PwUpload($bhv);
         if ($upload->check() === true) {
             $result = $upload->execute();
         }
         if ($result !== true) {
             $this->showError($result->getError());
         }
         if (!($data = $bhv->getAttachInfo())) {
             $this->showError('upload.fail');
         }
         // 添加进设置项
         $config->set('avatar', $data['path'] . $data['filename']);
     }
     $nickname = $this->getInput('nickname');
     if (empty($nickname)) {
         $nickname = PwLaiWangSerivce::$defaultNotifier['nickname'];
     }
     $usertype = intval($this->getInput('usertype'));
     if ($usertype != PwLaiWangSerivce::USERTYPE_NAME && $usertype != PwLaiWangSerivce::USERTYPE_ID) {
         $usertype = PwLaiWangSerivce::USERTYPE_NAME;
     }
     $user = $this->getInput('user');
     if ($usertype == PwLaiWangSerivce::USERTYPE_NAME) {
         $userinfo = Wekit::load('user.PwUser')->getUserByName($user, PwUser::FETCH_MAIN);
     } else {
         $userinfo = Wekit::load('user.PwUser')->getUserByUid($user, PwUser::FETCH_MAIN);
     }
     if (empty($userinfo)) {
         $this->showError('NATIVE:user.notfound');
     }
     $config->set('nickname', $nickname)->set('usertype', $usertype)->set('username', $userinfo['username'])->set('userid', $userinfo['uid'])->flush();
     $this->showMessage('ADMIN:success', 'native/notifier/run/', true);
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:60,代码来源:NotifierController.php

示例6: dosetAction

 /**
  * 后台设置-手机设置
  */
 public function dosetAction()
 {
     $config = new PwConfigSet('register');
     $config->set('active.phone', $this->getInput('activePhone', 'post'))->set('mobile.message.content', $this->getInput('mobileMessageContent', 'post'))->flush();
     $loginConfig = Wekit::C()->getValues('login');
     $ways = $this->getInput('ways', 'post');
     $loginConfigWays = array_flip($loginConfig['ways']);
     unset($loginConfigWays[4]);
     $loginConfigWays = array_flip($loginConfigWays);
     $ways && ($loginConfigWays[] = 4);
     $config = new PwConfigSet('login');
     $config->set('ways', $loginConfigWays);
     $config->set('mobieFindPasswd', $this->getInput('mobieFindPasswd', 'post'))->flush();
     $this->showMessage('ADMIN:success');
 }
开发者ID:YoursBoss,项目名称:nextwind,代码行数:18,代码来源:MobileController.php

示例7: dorunAction

 public function dorunAction()
 {
     list($ifopen, $readifopen, $spaceifopen) = $this->getInput(array('ifopen', 'readifopen', 'spaceifopen'), 'post');
     $config = new PwConfigSet('site');
     $config->set('app.dongta.ifopen', intval($ifopen))->set('app.dongta.read.ifopen', intval($readifopen))->set('app.dongta.space.ifopen', intval($spaceifopen))->flush();
     $this->showMessage('operate.success');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:7,代码来源:ManageController.php

示例8: doRunAction

 /**
  * 保存搜索设置
  *
  */
 public function doRunAction()
 {
     $conf = $this->getInput('conf', 'post');
     $config = new PwConfigSet('site');
     $config->set('search.isopen', $conf['isopen'])->flush();
     $this->showMessage('success');
 }
开发者ID:sanzhumu,项目名称:nextwind,代码行数:11,代码来源:ManageController.php

示例9: dorunAction

 /**
  * 后台设置-编辑器设置
  */
 public function dorunAction()
 {
     list($style, $contentDuplicate, $cvtimes, $imgOpen, $imgWidth, $imgHeight, $sizeMax, $flashOpen, $mediaOpen, $iframeOpen) = $this->getInput(array('style', 'content_duplicate', 'cvtimes', 'img_open', 'img_width', 'img_height', 'size_max', 'flash_open', 'media_open', 'iframe_open'), 'post');
     $config = new PwConfigSet('bbs');
     $config->set('editor.style', $style ? 1 : 0)->set('content.duplicate', $contentDuplicate ? 1 : 0)->set('ubb.cvtimes', abs(intval($cvtimes)))->set('ubb.img.open', $imgOpen ? 1 : 0)->set('ubb.img.width', abs(intval($imgWidth)))->set('ubb.img.height', abs(intval($imgHeight)))->set('ubb.size.max', abs(intval($sizeMax)))->set('ubb.flash.open', $flashOpen ? 1 : 0)->set('ubb.media.open', $mediaOpen ? 1 : 0)->set('ubb.iframe.open', $iframeOpen ? 1 : 0)->flush();
     $this->showMessage('ADMIN:success');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:10,代码来源:EditorController.php

示例10: updateConfig

 public function updateConfig()
 {
     $config = new PwConfigSet('nav');
     $navBo = Wekit::load('SRV:nav.bo.PwNavBo');
     $navTypes = $this->getNavType();
     $ds = $this->_getNavDs();
     foreach ($navTypes as $type => $name) {
         $_list = array();
         $list = $ds->getNavByType($type);
         foreach ($list as $key => $value) {
             if (!$value['name']) {
                 continue;
             }
             $_list[$key]['name'] = $navBo->bindHtml($value);
             $_list[$key]['sign'] = $value['sign'];
             foreach ((array) $value['child'] as $ckey => $cvalue) {
                 if (!$cvalue['name']) {
                     continue;
                 }
                 $_list[$key]['child'][$ckey]['name'] = $navBo->bindHtml($cvalue);
                 $_list[$key]['child'][$ckey]['sign'] = $cvalue['sign'];
             }
         }
         $config->set($type, $_list)->flush();
     }
     return true;
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:27,代码来源:PwNavService.php

示例11: dosetAction

 /**
  * 全局配置增加表单处理器
  *
  * @return void
  */
 public function dosetAction()
 {
     $config = new PwConfigSet('verify');
     $verify = $this->getInput('showverify', 'post');
     $config->set('showverify', $verify ? $verify : array())->flush();
     $this->showMessage('ADMIN:success');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:12,代码来源:VerifyController.php

示例12: dorunAction

 public function dorunAction()
 {
     list($ifopen, $reason, $alipay, $alipaypartnerID, $alipaykey, $alipayinterface, $tenpay, $tenpaykey, $paypal, $paypalkey, $_99bill, $_99billkey) = $this->getInput(array('ifopen', 'reason', 'alipay', 'alipaypartnerID', 'alipaykey', 'alipayinterface', 'tenpay', 'tenpaykey', 'paypal', 'paypalkey', '99bill', '99billkey'));
     $config = new PwConfigSet('pay');
     $config->set('ifopen', $ifopen)->set('reason', $reason)->set('alipay', $alipay)->set('alipaypartnerID', $alipaypartnerID)->set('alipaykey', $alipaykey)->set('alipayinterface', $alipayinterface)->set('tenpay', $tenpay)->set('tenpaykey', $tenpaykey)->set('paypal', $paypal)->set('paypalkey', $paypalkey)->set('99bill', $_99bill)->set('99billkey', $_99billkey)->flush();
     $this->showMessage('success');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:7,代码来源:PayController.php

示例13: dorunAction

 public function dorunAction()
 {
     $windid = $this->getInput('windid', 'post');
     /*$array = array(
     			'serverUrl', 'clientId','clientKey','clientDb','clientCharser'
     		);
     		$client = $this->getInput($array, 'post');
     		$client = array_combine($array, $client);
     		
     		if ($windid == 'client' && (!$client['serverUrl'] || !$client['clientId'])) $this->showError('ADMIN:fail');
     		
     		$array = array(
     			'dbhost', 'dbuser','dbpwd','dbname','dbprefix','engine'
     		);
     		$mysql = $this->getInput($array, 'post');
     		$mysql = array_combine($array, $mysql);
     		list($mysql['dbhost'], $mysql['dbport']) = explode(':', $mysql['dbhost']);
     		$mysql['dbport'] = !empty($mysql['dbport']) ? intval($mysql['dbport']) : 3306;
     		if (!empty($mysql['engine'])) {
     			$mysql['engine'] = strtoupper($mysql['engine']);
     			!in_array($mysql['engine'], array('MyISAM', 'InnoDB')) && $mysql['engine'] = 'MyISAM';
     		} else {
     			$mysql['engine'] = 'MyISAM';
     		}*/
     $config = new PwConfigSet('site');
     $config->set('windid', $windid)->flush();
     //$this->_getWindid()->setConfig('windid', 'windid', $windid);
     /*$charset = Wind::getApp()->getResponse()->getCharset();
     		$charset = str_replace('-', '', strtolower($charset));
     		if (!in_array($charset, array('gbk', 'utf8', 'big5'))) $charset = 'utf8';
     		$clientCharser = $client['clientCharser'] ? $client['clientCharser'] : $charset;
     		$configfile = Wind::getRealPath('CONF:windidConfig.php', true);
     		if ($windid != 'client') {
     			$baseUrl = Wind::getApp()->getRequest()->getBaseUrl(true);
     			$client['clientDb'] = 'mysql';
     			$client['serverUrl'] = $baseUrl;
     			$client['clientId'] = 0;
     			$client['clientKey'] = '';
     		}
     		$config = array(
     			'windid'  => $windid,
     			'serverUrl' => $client['serverUrl'],
     			'clientId'  => $client['clientId'],
     			'clientKey'  => $client['clientKey'],
     			'clientDb'  => $client['clientDb'],
     			'clientCharser'  => $clientCharser,
     		);
     		WindFile::savePhpData($configfile,$config);*/
     /*$datafile = Wind::getRealPath('WINDID:conf.database.php', true);
     		$database = array(
     			'dsn' => 'mysql:host=' . $mysql['dbhost'] . ';dbname=' . $mysql['dbname'] . ';port=' . $mysql['dbport'],
     			'user' => $mysql['dbuser'],
     			'pwd' => $mysqll['dbpw'],
     			'charset' => $charset,
     			'tableprefix' => $mysql['dbprefix'],
     			//'engine' => $mysql['engine'],
     		);
     		WindFile::savePhpData($datafile,$database);*/
     $this->showMessage('ADMIN:success');
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:60,代码来源:WindidController.php

示例14: addAction

 public function addAction()
 {
     list($status, $code) = $this->getInput(array('ad_status', 'ad_code'));
     $config = new PwConfigSet('native');
     $config->set('ad.status', $status)->set('ad.code', $code)->flush();
     $this->showMessage('ADMIN:success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:7,代码来源:AdController.php

示例15: doftpAction

 /**
  * 后台设置-ftp设置
  */
 public function doftpAction()
 {
     $this->getRequest()->isPost() || $this->showError('operate.fail');
     $config = new PwConfigSet('attachment');
     $config->set('ftp.url', $this->getInput('ftpUrl', 'post'))->set('ftp.server', $this->getInput('ftpServer', 'post'))->set('ftp.port', $this->getInput('ftpPort', 'post'))->set('ftp.dir', $this->getInput('ftpDir', 'post'))->set('ftp.user', $this->getInput('ftpUser', 'post'))->set('ftp.pwd', $this->getInput('ftpPwd', 'post'))->set('ftp.timeout', abs(intval($this->getInput('ftpTimeout', 'post'))))->flush();
     $this->showMessage('ADMIN:success');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:10,代码来源:StorageController.php


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