Files
Phraseanet/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php
2014-09-10 11:23:29 +02:00

39 lines
747 B
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Http\StaticFile\Symlink;
use Silex\Application;
use Symfony\Component\Filesystem\Filesystem;
use Guzzle\Http\Url;
class SymLinkerEncoder
{
protected $key;
public static function create(Application $app)
{
return new self(
$app['phraseanet.configuration']['main']['key']
);
}
public function __construct($key)
{
$this->key = $key;
}
public function encode($pathFile)
{
return hash_hmac('sha512', $pathFile , $this->key);
}
}