Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed the need for a proxy route for rendering strategies
- Loading branch information
Showing
16 changed files
with
128 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/proxy.xml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 0 additions & 82 deletions
82
src/Symfony/Component/HttpKernel/RenderingStrategy/GeneratorAwareRenderingStrategy.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/Symfony/Component/HttpKernel/RenderingStrategy/ProxyAwareRenderingStrategy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\HttpKernel\RenderingStrategy; | ||
|
||
use Symfony\Component\HttpKernel\Controller\ControllerReference; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
/** | ||
* Adds the possibility to generate a proxy URI for a given Controller. | ||
* | ||
* @author Fabien Potencier <fabien@symfony.com> | ||
*/ | ||
abstract class ProxyAwareRenderingStrategy implements RenderingStrategyInterface | ||
{ | ||
/** | ||
* Generates a proxy URI for a given controller. | ||
* | ||
* @param ControllerReference $reference A ControllerReference instance | ||
* @param Request $request A Request instance | ||
* | ||
* @return string A proxy URI | ||
*/ | ||
protected function generateProxyUri(ControllerReference $reference, Request $request) | ||
{ | ||
if (!isset($reference->attributes['_format'])) { | ||
$reference->attributes['_format'] = $request->getRequestFormat(); | ||
} | ||
|
||
$reference->attributes['_controller'] = $reference->controller; | ||
|
||
$reference->query['path'] = http_build_query($reference->attributes, '', '&'); | ||
|
||
return $request->getUriForPath('/_proxy?'.http_build_query($reference->query, '', '&')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/AbstractRenderingStrategyTest.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.