Skip to content

Instantly share code, notes, and snippets.

@emodric
Created September 21, 2012 13:46
Show Gist options
  • Save emodric/3761541 to your computer and use it in GitHub Desktop.
Save emodric/3761541 to your computer and use it in GitHub Desktop.
Test of creating Gist from PhpStorm
<?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