Skip to content

Commit 894117f

Browse files
committed
Merge branch '2.1' into 2.2
* 2.1: [FrameworkBundle] Fix code status in dockblock Fixed test to use Reflection [Finder] fixed a potential issue on Solaris where INF value is wrong (refs #7269) Update RouteCompiler.php [FrameworkBundle] avoids cache:clear to break if new/old folders already exist [HttpKernel] Fixed possible profiler token collision (closes #7272, closes #7171) [ClassLoader] tweaked test [ClassLoader] made DebugClassLoader idempotent [DomCrawler] Fix relative path handling in links Conflicts: src/Symfony/Component/DomCrawler/Link.php src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php src/Symfony/Component/Routing/RouteCompiler.php
2 parents 299e856 + 12a6505 commit 894117f

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

Command/CacheClearCommand.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,32 @@ protected function execute(InputInterface $input, OutputInterface $output)
6262
throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $realCacheDir));
6363
}
6464

65+
$filesystem = $this->getContainer()->get('filesystem');
6566
$kernel = $this->getContainer()->get('kernel');
6667
$output->writeln(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
6768

6869
$this->getContainer()->get('cache_clearer')->clear($realCacheDir);
6970

71+
if ($filesystem->exists($oldCacheDir)) {
72+
$filesystem->remove($oldCacheDir);
73+
}
74+
7075
if ($input->getOption('no-warmup')) {
71-
rename($realCacheDir, $oldCacheDir);
76+
$filesystem->rename($realCacheDir, $oldCacheDir);
7277
} else {
7378
$warmupDir = $realCacheDir.'_new';
7479

80+
if ($filesystem->exists($warmupDir)) {
81+
$filesystem->remove($warmupDir);
82+
}
83+
7584
$this->warmup($warmupDir, !$input->getOption('no-optional-warmers'));
7685

77-
rename($realCacheDir, $oldCacheDir);
78-
rename($warmupDir, $realCacheDir);
86+
$filesystem->rename($realCacheDir, $oldCacheDir);
87+
$filesystem->rename($warmupDir, $realCacheDir);
7988
}
8089

81-
$this->getContainer()->get('filesystem')->remove($oldCacheDir);
90+
$filesystem->remove($oldCacheDir);
8291
}
8392

8493
protected function warmup($warmupDir, $enableOptionalWarmers = true)

Controller/RedirectController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class RedirectController extends ContainerAware
2626
/**
2727
* Redirects to another route with the given name.
2828
*
29-
* The response status code is 301 if the permanent parameter is false (default),
30-
* and 302 if the redirection is permanent.
29+
* The response status code is 302 if the permanent parameter is false (default),
30+
* and 301 if the redirection is permanent.
3131
*
3232
* In case the route name is empty, the status code will be 404 when permanent is false
3333
* and 410 otherwise.
@@ -52,8 +52,8 @@ public function redirectAction($route, $permanent = false)
5252
/**
5353
* Redirects to a URL.
5454
*
55-
* The response status code is 301 if the permanent parameter is false (default),
56-
* and 302 if the redirection is permanent.
55+
* The response status code is 302 if the permanent parameter is false (default),
56+
* and 301 if the redirection is permanent.
5757
*
5858
* In case the path is empty, the status code will be 404 when permanent is false
5959
* and 410 otherwise.

0 commit comments

Comments
 (0)