mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
39 lines
747 B
PHP
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);
|
|
}
|
|
}
|