Skip to content

Commit 829c011

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 7ed176f + f253d62 commit 829c011

17 files changed

+384
-787
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ addons:
1010
cache:
1111
directories:
1212
- .phpunit
13+
- php-5.3.9
1314

1415
matrix:
1516
include:
@@ -32,6 +33,7 @@ env:
3233

3334
before_install:
3435
- if [[ "$deps" = "no" ]] && [[ "$TRAVIS_PHP_VERSION" =~ 5.[45] ]] && [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then export deps=skip; fi;
36+
- if [[ $deps = no && $TRAVIS_PHP_VERSION = 5.3 && ! -d php-5.3.9/sapi ]]; then wget http://museum.php.net/php5/php-5.3.9.tar.bz2; tar -xjf php-5.3.9.tar.bz2; (cd php-5.3.9; ./configure --enable-sigchild --enable-pcntl; make -j2); fi;
3537
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi;
3638
- echo "memory_limit = -1" >> $INI_FILE
3739
- echo "session.gc_probability = 0" >> $INI_FILE
@@ -57,6 +59,7 @@ install:
5759
script:
5860
- if [ "$deps" = "no" ]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
5961
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
62+
- if [[ $deps = no && $TRAVIS_PHP_VERSION = 5.3 ]]; then echo -e "1\\n0" | parallel --gnu 'echo -e "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-5.3.9/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi;
6063
- if [ "$deps" = "high" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data,legacy'; fi;
6164
- if [ "$deps" = "low" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
6265
- if [ "$deps" = "skip" ]; then echo 'This matrix line is skipped for pull requests.'; fi;

src/Symfony/Bundle/FrameworkBundle/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);

src/Symfony/Bundle/FrameworkBundle/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

src/Symfony/Bundle/FrameworkBundle/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
*/

src/Symfony/Bundle/FrameworkBundle/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 {

src/Symfony/Bundle/FrameworkBundle/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)