本文整理汇总了PHP中setConfig函数的典型用法代码示例。如果您正苦于以下问题:PHP setConfig函数的具体用法?PHP setConfig怎么用?PHP setConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setConfig函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: init
public function init(array $argv = array(), $verbosity = 0)
{
$this->_verbosity = $verbosity;
/* First element is the php script name. Store it for debugging. */
$this->_php_exec = array_shift($argv);
/* Second element is just the executable we called to run ZF commands. Store it for printing errors/usage. */
$this->_native_exec = array_shift($argv);
$opts = $this->getOptions()->addArguments($argv);
$opts->parse();
// Shortcut to verbosity option so that we can display more earlier
if (isset($opts->verbosity)) {
$this->_verbosity = $opts->verbosity;
}
// Shortcut to help option so that no arguments have to be specified
if (isset($opts->help)) {
$this->printHelp();
return null;
}
try {
$actionName = array_shift($argv);
$context = Zend_Build_Manifest::getInstance()->getContext(self::MF_ACTION_TYPE, $actionName);
$config = $this->_parseParams($context, $argv);
$action = new $context->class();
$action . setConfig($config);
$action . configure();
} catch (Zend_Console_Exception $e) {
throw $e->prependUsage($this->getUsage());
}
return $this;
}
开发者ID:jon9872,项目名称:zend-framework,代码行数:30,代码来源:Console.php
示例2: __call
public function __call($func, $argv)
{
if (substr($func, 0, 3) == 'get') {
$uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
$key = Inflector::lower($uncamelizeMethod);
if (isset($argv[0])) {
$environment = $argv[0];
} else {
$environment = APPLICATION_ENV;
}
return getConfig($key, $environment);
} elseif (substr($func, 0, 3) == 'set') {
$uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
$key = Inflector::lower($uncamelizeMethod);
$value = Arrays::first($argv);
if (isset($argv[1])) {
$environment = $argv[1];
} else {
$environment = 'all';
}
setConfig($key, $value, $environment);
return $this;
} elseif (substr($func, 0, 3) == 'has') {
$uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
$key = Inflector::lower($uncamelizeMethod);
if (isset($argv[0])) {
$environment = $argv[0];
} else {
$environment = APPLICATION_ENV;
}
return null !== getConfig($key, $environment);
}
}
开发者ID:schpill,项目名称:thin,代码行数:33,代码来源:Configdata.php
示例3: updatesyncredit
function updatesyncredit($syncredit)
{
require_once R_P . 'admin/cache.php';
setConfig('uc_syncredit', $syncredit);
updatecache_c();
return new ApiResponse(1);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:7,代码来源:class_Cache.php
示例4: goAction
function goAction($act, $category_id, $course_id, $courses, $exercises)
{
if (!$act || $act == null) {
$act = "default";
}
switch ($act) {
case 'default':
showPage();
break;
case 'getCategory':
showCategories();
break;
case 'getCategoryJson':
showCategoryTree();
break;
case 'getCourses':
showCourses($category_id);
break;
case 'getTracks':
showTracks($category_id, $course_id);
break;
case 'getScores':
showScores($category_id, $course_id);
break;
case 'getSummary':
showSummary($category_id, $courses, $exercises);
break;
case 'getExcel':
showExcel($category_id, $courses, $exercises);
break;
case 'getCfgs':
showConfig($category_id, $course_id);
break;
case 'saveCfgs':
$count = $_GET['count'];
$configs = $_GET['config'];
setConfig($category_id, $course_id, $count, $configs);
break;
case 'createCfgs':
$quiz_count = @$_GET['count'];
if (!isset($quiz_count) || $quiz_count == null || $quiz_count <= 0) {
drawConfigPanel($category_id, $course_id);
} else {
drawConfigPanel($category_id, $course_id, $quiz_count);
}
break;
case 'removeCfgs':
removeConfig($category_id, $course_id);
break;
case 'getStudents':
showStudentConfigs();
break;
case 'saveStudents':
$students = $_GET['s'];
saveStudentConfigs($students);
break;
}
}
开发者ID:adexbn,项目名称:sinomedex_report,代码行数:58,代码来源:index.php
示例5: setConfig
function setConfig($key, $value)
{
if (!$key) {
return true;
}
require_once R_P . 'admin/cache.php';
setConfig('db_' . $key, $value);
updatecache_c();
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:9,代码来源:platform.config.class.php
示例6: insertWebmasterKey
/**
* 插入站长中心id
* @param int $siteId 站长中心id
* @return bool
*/
function insertWebmasterKey($siteId)
{
if ($siteId <= 0) {
return new ApiResponse(false);
}
require_once R_P . 'admin/cache.php';
setConfig('db_siteappkey', $siteId);
updatecache_c();
return new ApiResponse(true);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:15,代码来源:class_Site.php
示例7: test_matchPWD
public function test_matchPWD()
{
setConfig("PWD_HASH_TYPE", "logiks");
$salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');
$algo_actual = getPWDHash('test', $salt);
$first = matchPWD($algo_actual, 'test', $salt);
$this->assertEquals(true, $first);
$first = matchPWD($algo_actual, 'testing', $salt);
$this->assertEquals(false, $first);
}
开发者ID:logiks,项目名称:logiks-core,代码行数:10,代码来源:test_helpers_pwdhash.php
示例8: appsUpdateCache
function appsUpdateCache($apps)
{
if ($apps && is_array($apps)) {
require_once R_P . 'admin/cache.php';
setConfig('db_apps_list', $apps);
updatecache_c();
return new ApiResponse(true);
} else {
return new ApiResponse(false);
}
}
开发者ID:noikiy,项目名称:ecmall,代码行数:11,代码来源:class_UserApp.php
示例9: create_dbconfig_table
function create_dbconfig_table()
{
$dir = dirname(dirname(__FILE__));
require_once $dir . '/config.php';
$table = 'config';
$params = array(array('id', 'int(11)', 'NOT NULL', 'AUTO_INCREMENT'), array('name', 'varchar(255)', 'DEFAULT NULL'), array('value', 'varchar(255)', 'DEFAULT NULL'), array('PRIMARY KEY (id)'), array('UNIQUE KEY name (name)'));
$newTable = $DB->createTable($table, $params);
if ($newTable) {
setConfig('toto', 'titi');
return true;
}
}
开发者ID:Raxine,项目名称:lightning,代码行数:12,代码来源:installlib.php
示例10: _saveBindInfo
function _saveBindInfo($options)
{
require_once R_P . 'admin/cache.php';
global ${$this->_config_key};
$bindInfo = ${$this->_config_key} ? ${$this->_config_key} : array();
foreach ($options as $key => $value) {
$bindInfo[$key] = $value;
}
${$this->_config_key} = $bindInfo;
setConfig($this->_config_key, $bindInfo);
updatecache_c();
return true;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:13,代码来源:weibositebindinfoservice.class.php
示例11: matchPWD
function matchPWD($pwdHash, $pwd, $salt = null)
{
if (strlen(getConfig("PWD_HASH_TYPE")) <= 0 || !getConfig("PWD_HASH_TYPE")) {
setConfig("PWD_HASH_TYPE", "logiks");
}
$newHash = getPWDHash($pwd, $salt);
// printArray([$newHash,$pwd,$salt,$pwdHash]);
if (is_array($newHash)) {
$newHash = $newHash['hash'];
}
//println($pwdHash);println(getPWDHash($pwd, $salt));exit($pwd);
// println(($pwdHash===$newHash));exit("XXX $pwdHash $newHash ".getConfig("PWD_HASH_TYPE"));
return $pwdHash === $newHash;
}
开发者ID:logiks,项目名称:logiks-core,代码行数:14,代码来源:pwdhash.php
示例12: checkBan
function checkBan()
{
// We need the database and the current time.
global $DB;
global $TIMEMARK;
// Get the ban time, the maximum attempts etc..
$maxAllowedPerIP = getConfig("banAttempts");
$banTime = getConfig("banTime") * 60;
$timeFrame = 1800;
$targetTimeStamp = $TIMEMARK - $timeFrame;
// Enforce minimal settings.
if ($maxAllowedPerIP < 5) {
setConfig("banAttempts", "5");
$maxAllowedPerIP = 5;
}
if ($banTime < 60) {
setConfig("banTime", "1");
$banTime = 60;
}
// Wash the username and IP.
$username = strtolower(sanitize($_POST[username]));
$ip = $_SERVER[REMOTE_ADDR];
// Load counts from database.
$attemptsIP = $DB->getCol("SELECT COUNT(incident) FROM failed_logins WHERE ip='" . $ip . "' AND failed_logins.time > " . $targetTimeStamp);
$attemptsUsername = $DB->getCol("SELECT COUNT(incident) FROM failed_logins WHERE username='" . $username . "' AND failed_logins.time > " . $targetTimeStamp);
// Deny access if limits reached.
if ($attemptsIP[0] > $maxAllowedPerIP || $attemptsUsername[0] > $maxAllowedPerIP) {
// Get the time of the latest attempt.
$latestAttempt = $DB->getCol("SELECT time FROM failed_logins WHERE ip='" . $ip . "' OR username='" . $username . "' ORDER BY time DESC LIMIT 1");
// Lets check if that is still in the baaaaad area.
if ($latestAttempt[0] + $banTime > $TIMEMARK) {
// Still banned.
$remain = numberToString($latestAttempt[0] + $banTime - $TIMEMARK);
makeNotice("You have reached the maximum number of login attempts. You are temporarily banned for " . number_format($banTime / 60, 0) . " minutes. Time left on ban: " . $remain, "error", "Banned");
}
}
// If we get here, all is good.
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:38,代码来源:checkBan.php
示例13: alertMusic
function alertMusic($state)
{
//虾米音乐网编辑器开启/关闭
require_once R_P . 'admin/cache.php';
setConfig('db_xiami_music_open', $state);
updatecache_c();
return new ApiResponse(true);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:8,代码来源:class_Other.php
示例14: exit
<?php
!function_exists('adminmsg') && exit('Forbidden');
$basename = "{$admin_file}?adminjob=ipban&job=ipstates";
if ($action != 'submit' && $action != 'ipIndex') {
ifcheck($db_ipstates, 'ipstates');
include PrintEot('ipstates');
} elseif ($_POST['action'] == "submit") {
S::gp(array('ipstates'), 'P');
setConfig('db_ipstates', $ipstates);
updatecache_c();
$navConfigService = L::loadClass('navconfig', 'site');
$navConfigService->controlShowByKey('sort_ipstate', $ipstates);
adminmsg('operate_success');
} elseif ($action == "ipIndex") {
$ipTable = L::loadClass('IPTable', 'utility');
$ipTable->createIpIndex();
adminmsg('operate_success');
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:19,代码来源:ipstates.php
示例15: is_array
}
}
$config['groups'] = is_array($groups) ? ',' . implode(',', $groups) . ',' : '';
$updatecache = false;
$config['groups_creditset'] = array();
if (is_array($creditset) && !empty($creditset)) {
foreach ($creditset as $key => $value) {
foreach ($value as $k => $v) {
$creditset[$key][$k] = $v === '' ? in_array($key, array('Post', 'Reply', 'Delete', 'Deleterp')) ? '' : 0 : round($v, $k == 'rvrc' ? 1 : 0);
}
}
$config['groups_creditset'] = $creditset;
}
$config['groups_creditlog'] = is_array($creditlog) && !empty($creditlog) ? $creditlog : array();
foreach ($config as $key => $value) {
setConfig("o_{$key}", $value, null, true);
}
updatecache_conf('o', true);
adminmsg('operate_success', $j_url);
}
} elseif ($action == 'setting') {
!is_array($config = $_POST['config']) && ($config = array());
foreach ($config as $key => $value) {
if ($value) {
$isint = false;
if ($_POST['step'] == 'basic') {
if ($key == 'name' || $key == 'moneytype') {
$config[$key] = S::escapeChar($value);
} elseif ($key == 'rate') {
$config[$key] = (double) $value;
} else {
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:set.php
示例16: addConfigPower
function addConfigPower($powerData, $groupData)
{
setConfig('db_ratepower', serialize($powerData));
setConfig('db_rategroup', serialize($groupData));
updatecache_c();
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:6,代码来源:rate.class.php
示例17: elseif
} elseif ($action == 'statistics') {
$adverClass = L::loadclass('adver', 'advertisement');
/*statistics*/
list($status, $types, $benchs) = $adverClass->statistics();
include_once PrintEot('setadvert');
exit;
} elseif ($action == 'alter') {
$adverClass = L::loadclass('adver', 'advertisement');
/*during*/
S::gp(array("step"));
if ($step == 2) {
S::gp(array('alterstatus', 'alterbefore', 'alterway'));
$alterstatus = in_array($alterstatus, array(1, 0)) ? $alterstatus : 1;
/*security*/
$alterway = in_array($alterway, array(1, 2)) ? $alterway : 1;
$alterbefore = intval($alterbefore);
$alters = array('alterstatus' => $alterstatus, 'alterbefore' => $alterbefore, 'alterway' => $alterway);
setConfig('db_alterads', $alters);
updatecache_c();
adminmsg("operate_success", "{$basename}&action={$action}");
}
$alters = $db_alterads ? $db_alterads : $adverClass->getDefaultAlter();
/*alter*/
$c_alterstatus = $c_alterway = array('', '');
$alters['alterstatus'] == 1 ? $c_alterstatus[1] = 'checked' : ($c_alterstatus[0] = 'checked');
$alters['alterway'] == 1 ? $c_alterway[1] = 'checked' : ($c_alterway[0] = 'checked');
include_once PrintEot('setadvert');
exit;
} else {
adminmsg('operate_success');
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:setadvert.php
示例18: setScanCache
//.........这里部分代码省略.........
$forum = $catedb = $forumdb = $subdb1 = $subdb2 = $threaddb = array();
# 获取版块列表
$query = $db->query("SELECT fid,name,fup,type FROM pw_forums WHERE cms!='1' ORDER BY vieworder");
while ($forums = $db->fetch_array($query)) {
$forums['name'] = Quot_cv(strip_tags($forums['name']));
if ($forums['type'] == 'category') {
$catedb[] = $forums;
} elseif ($forums['type'] == 'forum') {
$forumdb[] = $forums;
} elseif ($forums['type'] == 'sub') {
$subdb1[] = $forums;
} else {
$subdb2[] = $forums;
}
}
foreach ($catedb as $cate) {
$threaddb[$cate['fid']] = array();
foreach ($forumdb as $key2 => $forumss) {
if ($forumss['fup'] == $cate['fid']) {
if (!array_key_exists($forumss['fid'], $temp_threaddb[$cate['fid']])) {
# 读取版块帖子总数和表进度
$forumss['count'] = 0;
$forumss['progress'] = 0;
$forumss['result'] = 0;
$forumss['table_progress']['pw_threads'] = 0;
foreach ($postslist as $pw_posts) {
$forumss['table_progress'][$pw_posts] = 0;
}
$threaddb[$cate['fid']][$forumss['fid']] = $forumss;
} else {
$threaddb[$cate['fid']][$forumss['fid']] = $temp_threaddb[$cate['fid']][$forumss['fid']];
unset($threaddb[$cate['fid']][$forumss['fid']]['table_progress']);
$threaddb[$cate['fid']][$forumss['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$forumss['fid']]['table_progress']['pw_threads'];
foreach ($postslist as $pw_posts) {
$threaddb[$cate['fid']][$forumss['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$forumss['fid']]['table_progress'][$pw_posts];
}
}
unset($forumdb[$key2]);
foreach ($subdb1 as $key3 => $sub1) {
if ($sub1['fup'] == $forumss['fid']) {
if (!array_key_exists($sub1['fid'], $temp_threaddb[$cate['fid']])) {
# 读取版块帖子总数和表进度
$sub1['count'] = 0;
$sub1['progress'] = 0;
$sub1['result'] = 0;
$sub1['table_progress']['pw_threads'] = 0;
foreach ($postslist as $pw_posts) {
$sub1['table_progress'][$pw_posts] = 0;
}
$threaddb[$cate['fid']][$sub1['fid']] = $sub1;
} else {
$threaddb[$cate['fid']][$sub1['fid']] = $temp_threaddb[$cate['fid']][$sub1['fid']];
unset($threaddb[$cate['fid']][$sub1['fid']]['table_progress']);
$threaddb[$cate['fid']][$sub1['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$sub1['fid']]['table_progress']['pw_threads'];
foreach ($postslist as $pw_posts) {
$threaddb[$cate['fid']][$sub1['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$sub1['fid']]['table_progress'][$pw_posts];
}
}
unset($subdb1[$key3]);
foreach ($subdb2 as $key4 => $sub2) {
if ($sub2['fup'] == $sub1['fid']) {
if (!array_key_exists($sub2['fid'], $temp_threaddb[$cate['fid']])) {
# 读取版块帖子总数和表进度
$sub2['count'] = 0;
$sub2['progress'] = 0;
$sub2['result'] = 0;
$sub2['table_progress']['pw_threads'] = 0;
foreach ($postslist as $pw_posts) {
$sub2['table_progress'][$pw_posts] = 0;
}
$threaddb[$cate['fid']][$sub2['fid']] = $sub2;
} else {
$threaddb[$cate['fid']][$sub2['fid']] = $temp_threaddb[$cate['fid']][$sub2['fid']];
unset($threaddb[$cate['fid']][$sub2['fid']]['table_progress']);
$threaddb[$cate['fid']][$sub2['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$sub2['fid']]['table_progress']['pw_threads'];
foreach ($postslist as $pw_posts) {
$threaddb[$cate['fid']][$sub2['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$sub2['fid']]['table_progress'][$pw_posts];
}
}
unset($subdb2[$key4]);
}
}
}
}
}
}
}
$catedb = serialize($catedb);
$threaddb = serialize($threaddb);
# 写入文件
$filecontent = "<?php\r\n";
$filecontent .= "\$catedb=" . pw_var_export($catedb) . ";\r\n";
$filecontent .= "\$threaddb=" . pw_var_export($threaddb) . ";\r\n";
$filecontent .= "?>";
$cahce_file = D_P . 'data/bbscache/wordsfb_progress.php';
pwCache::setData($cahce_file, $filecontent);
setConfig('db_wordsfb_cachetime', $timestamp);
updatecache_c();
return array('catedb' => $catedb, 'threaddb' => $threaddb);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:101,代码来源:setbwd.php
示例19: exit
<?php
!function_exists('readover') && exit('Forbidden');
global $db_picpath, $db_attachname;
$imgdt = $timestamp + $db_hour;
$attachdt = $imgdt + $db_hour * 100;
if (@rename($db_picpath, $imgdt) && @rename($db_attachname, $attachdt)) {
require_once R_P . 'admin/cache.php';
setConfig('db_picpath', $imgdt);
setConfig('db_attachname', $attachdt);
updatecache_c();
}
pwCache::setData(D_P . "data/bbscache/set_cache.php", "<?php die;?>|{$timestamp}");
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:13,代码来源:postconcle.php
示例20: PrintEot
$ifpwcache_64 = $db_ifpwcache & 64 ? 'checked' : '';
$ifpwcache_128 = $db_ifpwcache & 128 ? 'checked' : '';
$ifpwcache_256 = $db_ifpwcache & 256 ? 'checked' : '';
$ifpwcache_512 = $db_ifpwcache & 512 ? 'checked' : '';
$ifpwcache_1024 = $db_ifpwcache & 1024 ? 'checked' : '';
!$db_cachenum && ($db_cachenum = 20);
include PrintEot('pwcache');
exit;
}
} elseif ($action == 'blacklist') {
if ($_POST['step']) {
InitGP(array('tidblacklist', 'uidblacklist'), 'P');
$tidblacklist = checkNumStrList($tidblacklist);
$uidblacklist = checkNumStrList($uidblacklist);
setConfig('db_tidblacklist', $tidblacklist);
setConfig('db_uidblacklist', $uidblacklist);
if ($tidblacklist) {
$db->update("DELETE FROM pw_elements WHERE type IN('hitsort','hitsortday','hitsortweek','replysort','replysortday','replysortweek', 'newsubject','newreply') AND id IN(" . S::sqlImplode(explode(',', $tidblacklist)) . ')');
}
if ($uidblacklist) {
$db->update("DELETE FROM pw_elements WHERE type='usersort' AND id IN(" . S::sqlImplode(explode(',', $uidblacklist)) . ')');
}
updatecache_c();
adminmsg('operate_success', $basename . '&action=blacklist');
} else {
include PrintEot('pwcache');
exit;
}
} elseif ($action == 'update') {
$type = S::getGP('type', 'G');
if (!$type) {
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:aboutcache.php
注:本文中的setConfig函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论