Replaced array() with []

This commit is contained in:
Shoghi Cervantes
2014-08-28 17:04:22 +02:00
parent 2f2afe2336
commit eab86f5f90
122 changed files with 535 additions and 533 deletions

View File

@ -197,7 +197,7 @@ LICENSE;
$externalIP = Utils::getIP();
$internalIP = gethostbyname(trim(`hostname`));
echo "[!] " . $this->lang->get("ip_warning", array("{{EXTERNAL_IP}}", "{{INTERNAL_IP}}"), array($externalIP, $internalIP)) . "\n";
echo "[!] " . $this->lang->get("ip_warning", ["{{EXTERNAL_IP}}", "{{INTERNAL_IP}}"], [$externalIP, $internalIP]) . "\n";
echo "[!] " . $this->lang->ip_confirm;
$this->getInput();
}

View File

@ -23,7 +23,7 @@ namespace pocketmine\wizard;
class InstallerLang{
public static $languages = array(
public static $languages = [
"en" => "English",
"es" => "Español",
"zh" => "中文",
@ -43,7 +43,7 @@ class InstallerLang{
"fi" => "Suomi",
"tr" => "Türkçe",
//"et" => "Eesti",
);
];
private $texts = [];
private $lang;
private $langfile;
@ -84,14 +84,14 @@ class InstallerLang{
public function loadLang($langfile, $lang = "en"){
$this->texts[$lang] = [];
$texts = explode("\n", str_replace(array("\r", "\\/\\/"), array("", "//"), file_get_contents($langfile)));
$texts = explode("\n", str_replace(["\r", "\\/\\/"], ["", "//"], file_get_contents($langfile)));
foreach($texts as $line){
$line = trim($line);
if($line === ""){
continue;
}
$line = explode("=", $line);
$this->texts[$lang][trim(array_shift($line))] = trim(str_replace(array("\\n", "\\N",), "\n", implode("=", $line)));
$this->texts[$lang][trim(array_shift($line))] = trim(str_replace(["\\n", "\\N",], "\n", implode("=", $line)));
}
}