Skip to content

Commit eb2e395

Browse files
Merge branch '2.7' into 2.8
* 2.7: [Process] Enhance compatiblity with --enable-sigchild fix short array syntax for php 5.3 [Serializer] Fixed on array of objects in . [Process] Always call proc_close [Validator] Updated Luxembourgish translations for 2.8 disable server commands without Process component list all server command names in suggestion Suggested Process dependency disable server:run cmd without Process component Suggested Process dependency [FrameworkBundle] prevent cache:clear creating too long paths [FrameworkBundle] [Translation] Fixed translations not written when no translations directory in update command Conflicts: .travis.yml src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php src/Symfony/Bundle/FrameworkBundle/composer.json
2 parents a8f9dd3 + 01fb162 commit eb2e395

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

Command/CacheClearCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
5858
$io = new SymfonyStyle($input, $output);
5959

6060
$realCacheDir = $this->getContainer()->getParameter('kernel.cache_dir');
61-
$oldCacheDir = $realCacheDir.'_old';
61+
// the old cache dir name must not be longer than the real one to avoid exceeding
62+
// the maximum length of a directory or file path within it (esp. Windows MAX_PATH)
63+
$oldCacheDir = substr($realCacheDir, 0, -1).('~' === substr($realCacheDir, -1) ? '+' : '~');
6264
$filesystem = $this->getContainer()->get('filesystem');
6365

6466
if (!is_writable($realCacheDir)) {
@@ -79,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7981
// the warmup cache dir name must have the same length than the real one
8082
// to avoid the many problems in serialized resources files
8183
$realCacheDir = realpath($realCacheDir);
82-
$warmupDir = substr($realCacheDir, 0, -1).'_';
84+
$warmupDir = substr($realCacheDir, 0, -1).('_' === substr($realCacheDir, -1) ? '-' : '_');
8385

8486
if ($filesystem->exists($warmupDir)) {
8587
if ($outputIsVerbose) {
@@ -120,8 +122,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
120122
*/
121123
protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = true)
122124
{
123-
$this->getContainer()->get('filesystem')->remove($warmupDir);
124-
125125
// create a temporary kernel
126126
$realKernel = $this->getContainer()->get('kernel');
127127
$realKernelClass = get_class($realKernel);

Command/ServerCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public function isEnabled()
2727
return false;
2828
}
2929

30+
if (!class_exists('Symfony\Component\Process\Process')) {
31+
return false;
32+
}
33+
3034
return parent::isEnabled();
3135
}
3236

Command/ServerRunCommand.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@
2626
*/
2727
class ServerRunCommand extends ServerCommand
2828
{
29-
/**
30-
* {@inheritdoc}
31-
*/
32-
public function isEnabled()
33-
{
34-
if (PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) {
35-
return false;
36-
}
37-
38-
return parent::isEnabled();
39-
}
40-
4129
/**
4230
* {@inheritdoc}
4331
*/

Command/TranslationUpdateCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
197197
}
198198
}
199199

200-
if ($bundleTransPath) {
201-
$writer->writeTranslations($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->getContainer()->getParameter('kernel.default_locale')));
200+
if (!$bundleTransPath) {
201+
$bundleTransPath = end($transPaths).'translations';
202202
}
203203

204+
$writer->writeTranslations($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->getContainer()->getParameter('kernel.default_locale')));
205+
204206
if (true === $input->getOption('dump-messages')) {
205207
$resultMessage .= ' and translation files were updated.';
206208
} else {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"symfony/validator": "For using validation",
6060
"symfony/yaml": "For using the debug:config and lint:yaml commands",
6161
"symfony/property-info": "For using the property_info_extractor service",
62-
"symfony/process": "For using the server:run command"
62+
"symfony/process": "For using the server:run, server:start, server:stop, and server:status commands"
6363
},
6464
"autoload": {
6565
"psr-4": { "Symfony\\Bundle\\FrameworkBundle\\": "" },

0 commit comments

Comments
 (0)