本文整理汇总了PHP中LabConfig::getUserCountry方法的典型用法代码示例。如果您正苦于以下问题:PHP LabConfig::getUserCountry方法的具体用法?PHP LabConfig::getUserCountry怎么用?PHP LabConfig::getUserCountry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabConfig
的用法示例。
在下文中一共展示了LabConfig::getUserCountry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getObject
public static function getObject($record)
{
global $DEFAULT_LANG;
# Converts a user record in DB into a User object
if ($record == null) {
return null;
}
$user = new User();
$user->userId = $record['user_id'];
$user->username = $record['username'];
$user->password = $record['password'];
$user->actualName = $record['actualname'];
$user->level = $record['level'];
$user->email = $record['email'];
$user->phone = $record['phone'];
$user->createdBy = $record['created_by'];
$user->labConfigId = $record['lab_config_id'];
if (isset($record['lang_id'])) {
$user->langId = $record['lang_id'];
} else {
$user->langId = $DEFAULT_LANG;
}
/*if( $user->labConfigId == 128 || $user->labConfigId == 129 || $user->labConfig == 131 ) */
$user->country = LabConfig::getUserCountry($user->labConfigId);
return $user;
}
示例2: updateDatabase
function updateDatabase()
{
global $labConfigId, $DB_HOST, $DB_USER, $DB_PASS;
$country = strtolower(LabConfig::getUserCountry($labConfigId));
$saved_db = DbUtil::switchToCountry($country);
$currentDir = getcwd();
$mainBlisDir = substr($currentDir, $length, strpos($currentDir, "htdocs"));
//$blisLabBackupFilePath = "\"".$mainBlisDir.$backup_folder."\blis_".$lab_config_id."\blis_".$lab_config_id."_backup.sql\"";
$sqlFilePath = "\"" . $mainBlisDir . "htdocs\\export\\temp.sql\"";
$mysqlExePath = "\"" . $mainBlisDir . "server\\mysql\\bin\\mysql.exe\"";
$dbname = "blis_" . $country;
$command = $mysqlExePath . " -h {$DB_HOST} -P 7188 -u {$DB_USER} -p{$DB_PASS} {$dbname} < {$sqlFilePath}";
$command = "C: &" . $command;
//the C: is a useless command to prevent the original command from failing because of having more than 2 double quotes
echo $command;
system($command, $return_var);
if ($return_var == 0) {
echo "true";
} else {
echo "false";
}
DbUtil::switchRestore($saved_db);
}