Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #365 - Fixed exp not starting if can't fetch title/game mappings #366

Merged
merged 1 commit into from May 12, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -1,3 +1,11 @@
# 2.0.0.0
## Fixes
* Fix #365 - Fixed exp not starting if can't fetch title/game mappings for expansion api's.

# 2.0.0.0-beta2 (2018-05-10)
## Fixes
* Fixed #360 : Live ranking widgets crashing.

# 2.0.0.0-beta1 (2018-05-10)
## Fixes
* Fixed #119 : Fixed all symfony commands requiring connection to the dedicated server.
@@ -57,12 +57,12 @@ public function process(ContainerBuilder $container)
protected function fetchDataFromRemote(Filesystem $fileSytem, ContainerBuilder $container)
{
$curl = new Curl();
$curl->setUrl("https://mp-expansion.com/api/maniaplanet/games");
$curl->setUrl("https://mp-expansion.com/api/maniaplanet/toZto");
$curl->run();
if ($curl->getCurlInfo()['http_code'] == 200) {
$fileSytem->put(self::MAPPINGS_FILE, $curl->getResponse());
} else {
$container->get("logger")->warning("Can't fetch title mappings from expansion website.");
echo "Can't fetch title mappings from expansion website!\n";
}
}
}
@@ -67,6 +67,8 @@ public function __construct(
*/
public function init(OutputInterface $console)
{
$this->checkPhpExtensions($console);
$this->console->init($console, $this->dispatcher);
$this->dispatcher->dispatch(self::EVENT_BEFORE_INIT, []);
@@ -77,6 +79,47 @@ public function init(OutputInterface $console)
return $this;
}
protected function checkPhpExtensions(OutputInterface $console)
{
$extensions = array(
'openssl' => 'extension=php_openssl.dll',
'curl' => 'extension=curl.dll',
);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$extensions['com_dotnet'] = 'extension=php_com_dotnet.dll';
}
$status = true;
$showIni = false;
foreach ($extensions as $extension => $description) {
if (!extension_loaded($extension)) {
$console->writeln(
"<error>eXpansion needs PHP extension $extension to run. Enable it to run eXpansion => " . $description . "</error>"
);
$status = false;
$showIni = true;
}
}
$recommend = array(
'xmlrpc' => "It will have better performances !",
);
foreach ($recommend as $extension => $reason) {
if (!extension_loaded($extension)) {
$console->writeln(
"<error>eXpansion works better with PHP extension</error> <info>$extension</info>: " . $reason . ""
);
$showIni = true;
}
}
if ($showIni) {
$console->writeln('<info>[PHP] PHP is using fallowing ini file :</info> "'. php_ini_loaded_file() .'"');
sleep(5);
}
return $status;
}
/**
* Run eXpansion
*
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.