Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit 6cffdd9

Browse files
committed
Added more information about project installed
1 parent e0b7ebf commit 6cffdd9

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/Symfony/Installer/NewCommand.php

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,17 @@ private function displayInstallationResult()
294294
{
295295
if (empty($this->requirementsErrors)) {
296296
$this->output->writeln(sprintf(
297-
" <info>%s</info> Symfony was <info>successfully installed</info>. Now you can:\n",
298-
defined('PHP_WINDOWS_VERSION_BUILD') ? 'OK' : ''
297+
" <info>%s</info> Symfony %s was <info>successfully installed</info>. Now you can:\n",
298+
defined('PHP_WINDOWS_VERSION_BUILD') ? 'OK' : '',
299+
$this->getInstalledSymfonyVersion()
299300
));
300301
} else {
301302
$this->output->writeln(sprintf(
302-
" <comment>%s</comment> Symfony was <info>successfully installed</info> but your system doesn't meet its\n".
303+
" <comment>%s</comment> Symfony %s was <info>successfully installed</info> but your system doesn't meet its\n".
303304
" technical requirements! Fix the following issues before executing\n".
304305
" your Symfony application:\n",
305-
defined('PHP_WINDOWS_VERSION_BUILD') ? 'FAILED' : ''
306+
defined('PHP_WINDOWS_VERSION_BUILD') ? 'FAILED' : '',
307+
$this->getInstalledSymfonyVersion()
306308
));
307309

308310
foreach ($this->requirementsErrors as $helpText) {
@@ -318,13 +320,13 @@ private function displayInstallationResult()
318320
}
319321

320322
$this->output->writeln(sprintf(
321-
" * Change your current directory to %s.\n".
323+
" * Change your current directory to <comment>%s</comment>\n\n".
322324
" * Configure your application in <comment>app/config/parameters.yml</comment> file.\n\n".
323325
" * Run your application:\n".
324326
" 1. Execute the <comment>php app/console server:run</comment> command.\n".
325327
" 2. Browse to the <comment>http://localhost:8000</comment> URL.\n\n".
326328
" * Read the documentation at <comment>http://symfony.com/doc</comment>\n",
327-
$this->projectName
329+
$this->projectDir
328330
));
329331

330332
return $this;
@@ -378,4 +380,21 @@ private function getErrorMessage(\Requirement $requirement, $lineSize = 70)
378380

379381
return $errorMessage;
380382
}
383+
384+
/**
385+
* It returns the full Symfony version number of the project by getting
386+
* it in the composer.lock file.
387+
*/
388+
private function getInstalledSymfonyVersion()
389+
{
390+
$composer = json_decode(file_get_contents($this->projectDir.'/composer.lock'), true);
391+
392+
foreach ($composer['packages'] as $package) {
393+
if ('symfony/symfony' !== $package['name']) {
394+
continue;
395+
}
396+
397+
return $package['version'];
398+
}
399+
}
381400
}

0 commit comments

Comments
 (0)