本文整理汇总了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'];