本文整理汇总了PHP中PwConfigSet类的典型用法代码示例。如果您正苦于以下问题:PHP PwConfigSet类的具体用法?PHP PwConfigSet怎么用?PHP PwConfigSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PwConfigSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: 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');
}
示例3: 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;
}
示例4: 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');
}
示例5: 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');
}
示例6: 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');
}
示例7: 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');
}
示例8: 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');
}
示例9: doRunAction
public function doRunAction()
{
list($type, $money, $isopen, $groups) = $this->getInput(array('moneytype', 'money', 'isopen', 'groups'), 'post');
$bo = new PwConfigSet('site');
$bo->set('app.signature.moneytype', $type)->set('app.signature.money', intval($money))->set('app.signature.isopen', $isopen)->set('app.signature.groups', $groups ? ',' . implode(',', $groups) . ',' : '')->flush();
$this->showMessage('success');
}
示例10: 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');
}
示例11: 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');
}
示例12: doRunAction
/**
* 保存搜索设置
*
*/
public function doRunAction()
{
$conf = $this->getInput('conf', 'post');
$config = new PwConfigSet('site');
$config->set('search.isopen', $conf['isopen'])->flush();
$this->showMessage('success');
}
示例13: 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');
}
示例14: doRunAction
/**
* 保存设置
*
*/
public function doRunAction()
{
$conf = $this->getInput('conf', 'post');
$config = new PwConfigSet('app_mark');
$config->set('mark.isopen', $conf['isopen'])->set('mark.mark_reasons', $conf['mark_reasons'])->flush();
$this->showMessage('success');
}
示例15: setReplyRewardCreditType
/**
* 设置回帖奖励可用积分类型
*/
public function setReplyRewardCreditType($type)
{
if (!is_array($type)) {
return false;
}
$config = new PwConfigSet('credit');
$config->set($this->creditTypeKey, $type)->flush();
}