本文整理汇总了PHP中config_set函数的典型用法代码示例。如果您正苦于以下问题:PHP config_set函数的具体用法?PHP config_set怎么用?PHP config_set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了config_set函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateMenu
public function updateMenu(Request $request, Response $response)
{
$rs = array('flag' => 'FAIL', 'msg' => '');
$menuConfig = $request->post('menuConfig', '');
$menuConfig = json_decode($menuConfig, TRUE);
if (empty($menuConfig)) {
$rs['msg'] = '请检查数据';
$response->sendJSON($rs);
exit;
}
config_set('wxmenu', $menuConfig, 'J');
if ((new Weixin('fxm'))->createMenu($menuConfig)) {
$rs['flag'] = 'SUC';
$rs['msg'] = 'fxm菜单更新成功';
if ((new Weixin('zfy'))->createMenu($menuConfig)) {
$rs['msg'] = 'zfy菜单更新成功';
} else {
$rs['flag'] = 'FAIL';
$rs['msg'] = 'zfy菜单更新失败';
}
} else {
$rs['msg'] = 'fxm菜单更新失败';
}
$response->sendJSON($rs);
}
示例2: install
function install(){
$custom_group_actions = config_get('custom_group_actions');
$custom_group_actions[] = $this->getAction();
config_set('custom_group_actions', $custom_group_actions);
return true;
}
示例3: testSetReplaceArray
public function testSetReplaceArray()
{
$config = array('one' => array('two' => array('three' => 'value')));
$expected = array('one' => array('two' => array('three' => array('four' => 'hello world'))));
$returnVal = config_set($config, 'one.two.three', array('four' => 'hello world'));
$this->assertEquals($expected, $returnVal);
$this->assertEquals($expected, $config);
}
示例4: set_capability_enum
function set_capability_enum($p_threshold, $p_all_projects_only = false)
{
global $t_access, $t_project;
if ($t_access >= config_get_access($p_threshold) && (ALL_PROJECTS == $t_project || !$p_all_projects_only)) {
$f_flag = gpc_get('flag_' . $p_threshold);
$f_access = gpc_get_int('access_' . $p_threshold);
# @@debug @@ echo "<br />for $p_threshold "; var_dump($f_flag, $f_access); echo '<br />';
if ($f_flag != config_get($p_threshold)) {
config_set($p_threshold, $f_flag, NO_USER, $t_project, $f_access);
}
}
}
示例5: materialize_ajax_settings_save
function materialize_ajax_settings_save($form, $form_state)
{
$config = config('materialize.settings');
$theme = $form_state['build_info']['args'][0];
$theme_settings = config_get('theme_' . $theme . '_settings', array());
$trigger = $form_state['triggering_element']['#name'];
$theme_settings[$trigger] = $form_state['input'][$trigger];
if (empty($theme_settings[$trigger])) {
$theme_settings[$trigger] = 0;
}
config_set('theme_' . $theme . '_settings', $theme_settings);
backdrop_set_message("configuration saved.");
}
示例6: config_get
$t_project_id = (int) $_POST['project_id'];
if ($_POST['project_id'] > 0) {
$t_default = null;
$t_user_id = NO_USER;
$t_view_issues_page_columns = config_get('view_issues_page_columns', $t_default, $t_user_id, $t_src_project_id);
// Add Product Backlog Custom Field If Custom Field Is Not In Array
$key = array_search('custom_productbacklog', $t_view_issues_page_columns);
if ($key == NULL) {
$t_view_issues_page_columns[] = 'custom_productbacklog';
}
// Add Sprint Custom Field If Custom Field Is Not In Array
$key = array_search('custom_sprint', $t_view_issues_page_columns);
if ($key == NULL) {
$t_view_issues_page_columns[] = 'custom_sprint';
}
config_set('view_issues_page_columns', $t_view_issues_page_columns, $t_user_id, $t_project_id);
$agilemantis_project->addAdditionalProjectFields($t_project_id);
$agilemantis_pb->editProjects($agilemantis_pb->id, $t_project_id);
}
}
if ($t_project_id > 0) {
if ($agilemantis_project->backlog_project_is_unique($t_project_id) == false) {
$system = plugin_lang_get('edit_product_backlog_error_100600');
} else {
$system = "";
}
// give access_level 'reporter (25)' to team-user
$result = $agilemantis_pb->getTeamUserId($agilemantis_pb->id);
if ($result > -1) {
$user_id_team_user = $result;
$agilemantis_pb->giveDeveloperRightsToTeamUser($user_id_team_user, $t_project_id);
示例7: config_get
* Notes:
* data set from the test may need to be removed from the database manually
*/
require_once 'test.php';
$t_config = 'main_menu_custom_options';
$t_test = config_get($t_config);
print_r($t_config);
print_r($t_test);
$t_test[0][1] = 20;
config_set($t_config, $t_test);
$t_test = config_get($t_config);
print_r($t_test);
$t_config = 'default_home_page';
$t_test = config_get($t_config);
print_r($t_config);
print_r($t_test);
$t_test .= '?test';
config_set($t_config, $t_test);
$t_test = config_get($t_config);
print_r($t_test);
$g_test_config = array();
$t_config = 'test_config';
$t_test = config_get($t_config);
print_r($t_config);
print_r($t_test);
echo " " . (isset($t_test[0]) ? "set" : "not set") . " " . count($t_test) . " ";
$t_test[0] = 20;
config_set($t_config, $t_test);
$t_test = config_get($t_config);
print_r($t_test);
echo " " . (isset($t_test[0]) ? "set" : "not set") . " " . count($t_test) . " ";
示例8: hook_image_style_delete
/**
* Respond to image style deletion.
*
* This hook enables modules to update settings when a image style is being
* deleted. If a style is deleted, a replacement name may be specified in
* $style['name'] and the style being deleted will be specified in
* $style['old_name'].
*
* @param $style
* The image style array that being deleted.
*/
function hook_image_style_delete($style)
{
// Administrators can choose an optional replacement style when deleting.
// Update the modules style variable accordingly.
if (isset($style['old_name']) && $style['old_name'] == config_get('mymodule.settings', 'image_style')) {
config_set('mymodule.settings', 'image_style', $style['name']);
}
}
示例9: foreach
<?php
# start libraries
foreach (array('array_functions', 'config', 'formatting', 'layout', 'form', 'model', 'backend') as $library) {
require_once dirname(__FILE__) . '/lib/' . $library . '.php';
}
# end libraries
config_set('greenroom_dir', dirname(__FILE__));
class Greenroom
{
static function admin($backend)
{
if (!isset($_REQUEST['_v'])) {
if (isset($_REQUEST['_m'])) {
$_REQUEST['_v'] = 'list';
} else {
$_REQUEST['_v'] = 'model';
}
}
if (!in_array($_REQUEST['_v'], array('model', 'list', 'edit'))) {
return;
}
if ($_REQUEST['_v'] != 'model' && !in_array($_REQUEST['_m'], Model::defined())) {
return;
}
require dirname(__FILE__) . '/admin/' . $_REQUEST['_v'] . '.php';
}
}
示例10: exit
echo "failed\n";
exit(1);
}
echo "OK\n";
$g_db_connected = true;
# fake out database access routines used by config_get
$t_last_update = config_get('database_version', -1, ALL_USERS, ALL_PROJECTS);
$lastid = count($upgrade) - 1;
$i = $t_last_update + 1;
while ($i <= $lastid && !$g_failed) {
echo 'Create Schema ( ' . $upgrade[$i][0] . ' on ' . $upgrade[$i][1][0] . ' )';
$dict = NewDataDictionary($g_db);
if ($upgrade[$i][0] == 'InsertData') {
$sqlarray = call_user_func_array($upgrade[$i][0], $upgrade[$i][1]);
} else {
$sqlarray = call_user_func_array(array($dict, $upgrade[$i][0]), $upgrade[$i][1]);
}
$ret = $dict->ExecuteSQLArray($sqlarray);
if ($ret == 2) {
print_test_result(GOOD);
config_set('database_version', $i);
} else {
print_test_result(BAD, true, $sqlarray[0] . '<br />' . $g_db->ErrorMsg());
}
$i++;
}
if (false == $g_failed) {
exit(0);
}
exit(1);
# vim: noexpandtab tabstop=4 softtabstop=0:
示例11: split
$t_split = split('=>', $value, 2);
if (count($t_split) == 2) {
// associative array
$t_new_key = constant_replace(trim($t_split[0]));
$t_new_value = constant_replace(trim($t_split[1]));
$t_value[$t_new_key] = $t_new_value;
} else {
// regular array
$t_value[$key] = constant_replace(trim($value));
}
}
} else {
// scalar value
$t_value = constant_replace(trim($t_full_string));
}
}
}
config_set($f_config_option, $t_value, $f_user_id, $f_project_id);
print_successful_redirect('adm_config_report.php');
/**
* Check if the passed string is a constant and return its value
*/
function constant_replace($p_name)
{
$t_result = $p_name;
if (is_string($p_name) && defined($p_name)) {
// we have a constant
$t_result = constant($p_name);
}
return $t_result;
}
示例12: hook_block_save
/**
* Save the configuration options from hook_block_configure().
*
* This hook allows you to save the block-specific configuration settings
* defined within your hook_block_configure(). Most settings will automatically
* be saved if using the Layout module to position blocks, but if your settings
* should be site-wide or saved in the database instead of the Layout
* configuration, you may use this hook to save your settings. If you wish
* Layout module to *not* save your settings, unset the value from the $edit
* array.
*
* @param $delta
* Which block is being configured. This is a unique identifier for the block
* within the module, defined in hook_block_info().
* @param $edit
* The submitted form data from the configuration form. This is passed by
* reference, so values can be changed or removed before they are saved into
* the layout configuration.
*
* @see hook_block_configure()
* @see hook_block_info()
*/
function hook_block_save($delta, &$edit = array())
{
if ($delta == 'my_block_delta') {
config_set('mymodule.settings', 'my_global_value', $edit['my_global_value']);
// Remove the value so it is not saved by Layout module.
unset($edit['my_global_value']);
}
}
示例13: isset
$t_notify_flags[$t_action][$t_flag] = isset($t_flags[$t_action][$t_flag]) ? ON : OFF;
}
}
if ($t_default_flags['threshold_min'] != $t_thresholds_min[$t_action]) {
$t_notify_flags[$t_action]['threshold_min'] = $t_thresholds_min[$t_action];
}
if ($t_default_flags['threshold_max'] != $t_thresholds_max[$t_action]) {
$t_notify_flags[$t_action]['threshold_max'] = $t_thresholds_max[$t_action];
}
}
if (isset($t_notify_flags)) {
$t_existing_flags = config_get('notify_flags');
$t_existing_access = config_get_access('notify_flags');
if ($t_existing_flags != $t_notify_flags || $t_existing_access != $f_actions_access) {
# only set the flags if they are different
config_set('notify_flags', $t_notify_flags, NO_USER, $t_project, $f_actions_access);
}
}
form_security_purge('manage_config_email_set');
?>
<br />
<div align="center">
<?php
echo lang_get('operation_successful') . '<br />';
print_bracket_link($t_redirect_url, lang_get('proceed'));
?>
</div>
<?php
html_page_bottom();
示例14: execute
function execute()
{
config_set('database_version', $this->release_name);
$this->set_applied();
return true;
}
示例15: getUserStoriesByProductBacklogName
function getUserStoriesByProductBacklogName($product_backlog)
{
$t_mantis_bug_table = db_get_table('mantis_bug_table');
$t_mantis_custom_field_string_table = db_get_table('mantis_custom_field_string_table');
$t_mantis_project_table = db_get_table('mantis_project_table');
$t_mantis_category_table = db_get_table('mantis_category_table');
$this->getAdditionalProjectFields();
$t_sql = "SELECT\n\t\t\t\ta.id AS id, a.project_id AS project_id, a.summary AS summary, a.status AS status,\n\t\t\t\ta.target_version AS target_version, b.id AS b_category_id, b.name AS category_name,\n\t\t\t\tc.id AS c_project_id, c.name AS project_name, d.value AS productBacklog\n\t\t\tFROM {$t_mantis_bug_table} a\n\t\t\tLEFT JOIN {$t_mantis_category_table} b ON a.category_id = b.id\n\t\t\tLEFT JOIN {$t_mantis_project_table} c ON a.project_id = c.id\n\t\t\tLEFT JOIN {$t_mantis_custom_field_string_table} d ON a.id = d.bug_id\n\t\t\tWHERE d.field_id=" . db_param(0) . " AND d.value=" . db_param(1);
$t_params = array($this->pb, $product_backlog);
$show_resolved_userstories = $this->getConfigValue('show_resolved_userstories');
$show_closed_userstories = $this->getConfigValue('show_closed_userstories');
if ($show_resolved_userstories == 1 && $show_closed_userstories == 0) {
$t_sql .= " AND a.status <= 80";
}
if ($show_closed_userstories == 1 && $show_resolved_userstories == 0) {
$t_sql .= " AND a.status != 80";
}
if ($show_closed_userstories == 1 && $show_resolved_userstories == 1) {
$t_sql .= " AND a.status <= 90";
}
if ($show_closed_userstories == 0 && $show_resolved_userstories == 0) {
$t_sql .= " AND a.status < 80";
}
$show_only_project_userstories = $this->getConfigValue('show_only_project_userstories');
if ($show_only_project_userstories == 1 && helper_get_current_project() > 0) {
$t_sql .= " AND a.project_id=" . db_param(sizeof($t_params));
$t_params[] = helper_get_current_project();
}
$t_sql .= $orderby;
$bug_list = $this->executeQuery($t_sql, $t_params);
if (!$bug_list || sizeof($bug_list) == 0) {
return array();
}
foreach ($bug_list as $row) {
$row['businessValue'] = $this->getCustomFieldValueById($row['id'], $this->bv);
$row['storyPoints'] = $this->getCustomFieldValueById($row['id'], $this->sp);
if (config_get('show_only_us_without_storypoints', 0, auth_get_current_user_id()) == 1 && $row['storyPoints'] != "") {
continue;
}
$row['sprint'] = $this->getCustomFieldValueById($row['id'], $this->spr);
if (config_get('show_only_userstories_without_sprint', 0, auth_get_current_user_id()) == 1 && !empty($row['sprint'])) {
continue;
}
if (plugin_config_get('gadiv_ranking_order') == '1') {
$row['rankingOrder'] = $this->getCustomFieldValueById($row['id'], $this->ro);
}
if (plugin_config_get('gadiv_tracker_planned_costs') == '1') {
$row['plannedWork'] = $this->getCustomFieldValueById($row['id'], $this->pw);
}
$user_stories[] = $row;
}
$sort_by = config_get('current_user_product_backlog_filter', null, auth_get_current_user_id());
if (!empty($_GET['sort_by']) && isset($_GET['sort_by'])) {
config_set('current_user_product_backlog_filter', $_GET['sort_by'], auth_get_current_user_id());
$sort_by = $_GET['sort_by'];
}
$direction = config_get('current_user_product_backlog_filter_direction', null, auth_get_current_user_id());
if (!empty($_GET['direction']) && isset($_GET['direction'])) {
config_set('current_user_product_backlog_filter_direction', $_GET['direction'], auth_get_current_user_id());
$direction = $_GET['direction'];
}
return $this->sortUserStories($sort_by, $direction, $user_stories);
}