1
0
Fork 0

Merge branch '1.1'

pull/5347/head
Jordi Boggiano 2016-05-16 18:50:37 +01:00
commit a4e8d858ba
2 changed files with 11 additions and 2 deletions

View File

@ -229,11 +229,14 @@ class Application extends BaseApplication
$io->writeError('<info>Memory usage: '.round(memory_get_usage() / 1024 / 1024, 2).'MB (peak: '.round(memory_get_peak_usage() / 1024 / 1024, 2).'MB), time: '.round(microtime(true) - $startTime, 2).'s'); $io->writeError('<info>Memory usage: '.round(memory_get_usage() / 1024 / 1024, 2).'MB (peak: '.round(memory_get_peak_usage() / 1024 / 1024, 2).'MB), time: '.round(microtime(true) - $startTime, 2).'s');
} }
restore_error_handler();
return $result; return $result;
} catch (ScriptExecutionException $e) { } catch (ScriptExecutionException $e) {
return $e->getCode(); return $e->getCode();
} catch (\Exception $e) { } catch (\Exception $e) {
$this->hintCommonErrors($e); $this->hintCommonErrors($e);
restore_error_handler();
throw $e; throw $e;
} }
} }

View File

@ -94,19 +94,25 @@ class PlatformRepository extends ArrayRepository
if (in_array($name, array('standard', 'Core'))) { if (in_array($name, array('standard', 'Core'))) {
continue; continue;
} }
$extraDescription = null;
$reflExt = new \ReflectionExtension($name); $reflExt = new \ReflectionExtension($name);
try { try {
$prettyVersion = $reflExt->getVersion(); $prettyVersion = $reflExt->getVersion();
$version = $versionParser->normalize($prettyVersion); $version = $versionParser->normalize($prettyVersion);
} catch (\UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
$extraDescription = ' (actual version: '.$prettyVersion.')';
if (preg_match('{^(\d+\.\d+\.\d+(?:\.\d+)?)}', $prettyVersion, $match)) {
$prettyVersion = $match[1];
} else {
$prettyVersion = '0'; $prettyVersion = '0';
}
$version = $versionParser->normalize($prettyVersion); $version = $versionParser->normalize($prettyVersion);
} }
$packageName = $this->buildPackageName($name); $packageName = $this->buildPackageName($name);
$ext = new CompletePackage($packageName, $version, $prettyVersion); $ext = new CompletePackage($packageName, $version, $prettyVersion);
$ext->setDescription('The '.$name.' PHP extension'); $ext->setDescription('The '.$name.' PHP extension' . $extraDescription);
$this->addPackage($ext); $this->addPackage($ext);
} }