Created
September 21, 2012 13:46
-
-
Save emodric/3761541 to your computer and use it in GitHub Desktop.
Test of creating Gist from PhpStorm
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
<?php | |
/** | |
* File containing the TemporaryRedirect ValueObjectVisitor class | |
* | |
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved. | |
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 | |
* @version //autogentag// | |
*/ | |
namespace eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor; | |
use eZ\Publish\Core\REST\Common\UrlHandler, | |
eZ\Publish\Core\REST\Common\Output\ValueObjectVisitor, | |
eZ\Publish\Core\REST\Common\Output\Generator, | |
eZ\Publish\Core\REST\Common\Output\Visitor; | |
/** | |
* TemporaryRedirect value object visitor | |
*/ | |
class TemporaryRedirect extends ValueObjectVisitor | |
{ | |
/** | |
* Visit struct returned by controllers | |
* | |
* @param \eZ\Publish\Core\REST\Common\Output\Visitor $visitor | |
* @param \eZ\Publish\Core\REST\Common\Output\Generator $generator | |
* @param mixed $data | |
*/ | |
public function visit( Visitor $visitor, Generator $generator, $data ) | |
{ | |
$visitor->setStatus( 307 ); | |
$visitor->setHeader( 'Location', $data->redirectUri ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment