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


PHP PMA_checkConfigRw函数代码示例

本文整理汇总了PHP中PMA_checkConfigRw函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_checkConfigRw函数的具体用法?PHP PMA_checkConfigRw怎么用?PHP PMA_checkConfigRw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: PMA_versionCheck

//
if (isset($_GET['version_check'])) {
    PMA_versionCheck();
}
//
// Perform various security, compatibility and consistency checks
//
$configChecker = new ServerConfigChecks($GLOBALS['ConfigFile']);
$configChecker->performConfigChecks();
//
// Check whether we can read/write configuration
//
$config_readable = false;
$config_writable = false;
$config_exists = false;
PMA_checkConfigRw($config_readable, $config_writable, $config_exists);
if (!$config_writable || !$config_readable) {
    PMA_messagesSet('error', 'config_rw', __('Cannot load or save configuration'), PMA_sanitize(__('Please create web server writable folder [em]config[/em] in ' . 'phpMyAdmin top level directory as described in ' . '[doc@setup_script]documentation[/doc]. Otherwise you will be ' . 'only able to download or display it.')));
}
//
// Check https connection
//
$is_https = !empty($_SERVER['HTTPS']) && mb_strtolower($_SERVER['HTTPS']) == 'on';
if (!$is_https) {
    $text = __('You are not using a secure connection; all data (including potentially ' . 'sensitive information, like passwords) is transferred unencrypted!');
    if (!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['HTTP_HOST'])) {
        $link = htmlspecialchars('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
        $text .= ' ';
        $text .= PMA_sanitize(sprintf(__('If your server is also configured to accept HTTPS requests ' . 'follow [a@%s]this link[/a] to use a secure connection.'), $link));
    }
    PMA_messagesSet('notice', 'no_https', __('Insecure connection'), $text);
开发者ID:nobodypb,项目名称:phpmyadmin,代码行数:31,代码来源:index.inc.php

示例2: testPMACheckConfigRw

 /**
  * Test for PMA_checkConfigRw
  *
  * @return void
  */
 public function testPMACheckConfigRw()
 {
     if (!PMA_HAS_RUNKIT) {
         $this->markTestSkipped('Cannot redefine constant');
     }
     $redefine = null;
     $GLOBALS['cfg']['AvailableCharsets'] = array();
     $GLOBALS['server'] = 0;
     $GLOBALS['ConfigFile'] = new ConfigFile();
     if (!defined('SETUP_CONFIG_FILE')) {
         define('SETUP_CONFIG_FILE', 'test/test_data/configfile');
     } else {
         $redefine = 'SETUP_CONFIG_FILE';
         runkit_constant_redefine('SETUP_CONFIG_FILE', 'test/test_data/configfile');
     }
     $is_readable = false;
     $is_writable = false;
     $file_exists = false;
     PMA_checkConfigRw($is_readable, $is_writable, $file_exists);
     $this->assertTrue($is_readable);
     $this->assertTrue($is_writable);
     $this->assertFalse($file_exists);
     runkit_constant_redefine('SETUP_CONFIG_FILE', 'test/test_data/test.file');
     PMA_checkConfigRw($is_readable, $is_writable, $file_exists);
     $this->assertTrue($is_readable);
     $this->assertTrue($is_writable);
     $this->assertTrue($file_exists);
     if ($redefine !== null) {
         runkit_constant_redefine('SETUP_CONFIG_FILE', $redefine);
     } else {
         runkit_constant_remove('SETUP_CONFIG_FILE');
     }
 }
开发者ID:iShareLife,项目名称:phpmyadmin,代码行数:38,代码来源:PMA_SetupIndex_test.php


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