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


PHP PHPUnit_TextUI_Command::getPassword方法代码示例

本文整理汇总了PHP中PHPUnit_TextUI_Command::getPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_TextUI_Command::getPassword方法的具体用法?PHP PHPUnit_TextUI_Command::getPassword怎么用?PHP PHPUnit_TextUI_Command::getPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_TextUI_Command的用法示例。


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

示例1: define

<?php

// This file is loaded on all systems running tests. To override settings on
// your local system, please create "civicrm.settings.local.php" and put
// the settings there.
//--- you shouldn't have to modify anything under this line, but might want to put the compiled templates CIVICRM_TEMPLATE_COMPILEDIR in a different folder than our default location ----------
if (!defined('CIVICRM_DSN') && !empty($GLOBALS['mysql_user'])) {
    $dbName = !empty($GLOBALS['mysql_db']) ? $GLOBALS['mysql_db'] : 'civicrm_tests_dev';
    if (empty($GLOBALS['mysql_pass']) && $GLOBALS['mysql_pass_need_password']) {
        $GLOBALS['mysql_pass'] = PHPUnit_TextUI_Command::getPassword('Password');
    }
    define('CIVICRM_DSN', "mysql://{$GLOBALS['mysql_user']}:{$GLOBALS['mysql_pass']}@{$GLOBALS['mysql_host']}/{$dbName}?new_link=true");
}
if (!defined("CIVICRM_DSN")) {
    $dsn = getenv("CIVICRM_TEST_DSN");
    if (!empty($dsn)) {
        define("CIVICRM_DSN", $dsn);
    } else {
        echo "\nFATAL: no DB connection configured (CIVICRM_DSN). \nYou can either create/edit " . __DIR__ . "/civicrm.settings.local.php\n";
        if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
            echo "OR set it in your shell:\n \$export CIVICRM_TEST_DSN=mysql://db_username:db_password@localhost/civicrm_tests_dev \n";
        } else {
            echo "OR set it in your shell:\n SETX CIVICRM_TEST_DSN mysql://db_username:db_password@localhost/civicrm_tests_dev \n\n      (you will need to open a new command shell before it takes effect)";
        }
        echo "\n\n\nIf you haven't done so already, you need to create (once) a database dedicated to the unit tests:\nmysql -uroot -p\ncreate database civicrm_tests_dev;\ngrant ALL on civicrm_tests_dev.* to db_username@localhost identified by 'db_password';\ngrant SUPER on *.* to db_username@localhost identified by 'db_password';\n";
        die("");
    }
}
require_once "DB.php";
$dsninfo = DB::parseDSN(CIVICRM_DSN);
$GLOBALS['mysql_host'] = $dsninfo['hostspec'];
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:31,代码来源:civicrm.settings.dist.php


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