當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_persistOption函數代碼示例

本文整理匯總了PHP中PMA_persistOption函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_persistOption函數的具體用法?PHP PMA_persistOption怎麽用?PHP PMA_persistOption使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_persistOption函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

        }
        /* Add message to response */
        if ($response->isAjax()) {
            if ($_REQUEST['exception_type'] == 'js') {
                $response->addJSON('message', $msg);
            } else {
                $response->addJSON('_errSubmitMsg', $msg);
            }
        } elseif ($_REQUEST['exception_type'] == 'php') {
            $jsCode = 'PMA_ajaxShowMessage("<div class=\\"error\\">' . $msg . '</div>", false);';
            $response->getFooter()->getScripts()->addCode($jsCode);
        }
        if ($_REQUEST['exception_type'] == 'php') {
            // clear previous errors & save new ones.
            $GLOBALS['error_handler']->savePreviousErrors();
        }
        /* Persist always send settings */
        if (isset($_REQUEST['always_send']) && $_REQUEST['always_send'] === "true") {
            PMA_persistOption("SendErrorReports", "always", "ask");
        }
    }
} elseif (!empty($_REQUEST['get_settings'])) {
    $response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']);
} else {
    if ($_REQUEST['exception_type'] == 'js') {
        $response->addHTML(PMA_getErrorReportForm());
    } else {
        // clear previous errors & save new ones.
        $GLOBALS['error_handler']->savePreviousErrors();
    }
}
開發者ID:nijel,項目名稱:phpmyadmin,代碼行數:31,代碼來源:error_report.php

示例2: setUserValue

 /**
  * Sets config value which is stored in user preferences (if available)
  * or in a cookie.
  *
  * If user preferences are not yet initialized, option is applied to
  * global config and added to a update queue, which is processed
  * by {@link loadUserPreferences()}
  *
  * @param string $cookie_name   can be null
  * @param string $cfg_path      configuration path
  * @param mixed  $new_cfg_value new value
  * @param mixed  $default_value default value
  *
  * @return void
  */
 function setUserValue($cookie_name, $cfg_path, $new_cfg_value, $default_value = null)
 {
     // use permanent user preferences if possible
     $prefs_type = $this->get('user_preferences');
     if ($prefs_type) {
         include_once './libraries/user_preferences.lib.php';
         if ($default_value === null) {
             $default_value = PMA_arrayRead($cfg_path, $this->default);
         }
         PMA_persistOption($cfg_path, $new_cfg_value, $default_value);
     }
     if ($prefs_type != 'db' && $cookie_name) {
         // fall back to cookies
         if ($default_value === null) {
             $default_value = PMA_arrayRead($cfg_path, $this->settings);
         }
         $this->setCookie($cookie_name, $new_cfg_value, $default_value);
     }
     PMA_arrayWrite($cfg_path, $GLOBALS['cfg'], $new_cfg_value);
     PMA_arrayWrite($cfg_path, $this->settings, $new_cfg_value);
 }
開發者ID:nvq247,項目名稱:joomla15test,代碼行數:36,代碼來源:Config.class.php

示例3: testPersistOption

 /**
  * Test for PMA_persistOption
  *
  * @return void
  */
 public function testPersistOption()
 {
     $_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'] = PMA_VERSION;
     $_SESSION['relation'][$GLOBALS['server']]['userconfigwork'] = null;
     $_SESSION['userconfig'] = array();
     $_SESSION['userconfig']['ts'] = "123";
     $_SESSION['userconfig']['db'] = array('Server/hide_db' => true, 'Server/only_db' => true);
     $GLOBALS['server'] = 2;
     $_SESSION['relation'][2]['userconfigwork'] = null;
     $this->assertNull(PMA_persistOption('Server/hide_db', 'val', 'val'));
     $this->assertNull(PMA_persistOption('Server/hide_db', 'val2', 'val'));
     $this->assertNull(PMA_persistOption('Server/hide_db2', 'val', 'val'));
 }
開發者ID:phpmyadmin,項目名稱:phpmyadmin,代碼行數:18,代碼來源:PMA_user_preferences_test.php


注:本文中的PMA_persistOption函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。