mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Remove static create calls in Symlinker module
This commit is contained in:
@@ -41,7 +41,7 @@ class FileServeServiceProvider implements ServiceProviderInterface
|
||||
});
|
||||
|
||||
$app['phraseanet.static-file'] = $app->share(function (Application $app) {
|
||||
return new StaticMode(SymLinker::create($app));
|
||||
return new StaticMode($app['phraseanet.thumb-symlinker']);
|
||||
});
|
||||
|
||||
$app['phraseanet.file-serve'] = $app->share(function (Application $app) {
|
||||
|
@@ -41,11 +41,15 @@ class PhraseanetServiceProvider implements ServiceProviderInterface
|
||||
});
|
||||
|
||||
$app['phraseanet.thumb-symlinker'] = $app->share(function (SilexApplication $app) {
|
||||
return SymLinker::create($app);
|
||||
return new SymLinker(
|
||||
$app['phraseanet.thumb-symlinker-encoder'],
|
||||
$app['filesystem'],
|
||||
$app['thumbnail.path']
|
||||
);
|
||||
});
|
||||
|
||||
$app['phraseanet.thumb-symlinker-encoder'] = $app->share(function (SilexApplication $app) {
|
||||
return SymLinkerEncoder::create($app);
|
||||
return new SymLinkerEncoder($app['phraseanet.configuration']['main']['key']);
|
||||
});
|
||||
|
||||
$app['acl'] = $app->share(function (SilexApplication $app) {
|
||||
|
@@ -11,10 +11,8 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Http\StaticFile\Symlink;
|
||||
|
||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||
use Silex\Application;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Guzzle\Http\Url;
|
||||
|
||||
/**
|
||||
* Create & retrieve symlinks
|
||||
@@ -25,15 +23,6 @@ class SymLinker
|
||||
protected $fs;
|
||||
protected $symlinkDir;
|
||||
|
||||
public static function create(Application $app)
|
||||
{
|
||||
return new SymLinker(
|
||||
$app['phraseanet.thumb-symlinker-encoder'],
|
||||
$app['filesystem'],
|
||||
$app['thumbnail.path']
|
||||
);
|
||||
}
|
||||
|
||||
public function __construct(SymLinkerEncoder $encoder, Filesystem $fs, $symlinkDir)
|
||||
{
|
||||
$this->encoder = $encoder;
|
||||
|
@@ -11,21 +11,10 @@
|
||||
|
||||
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;
|
||||
|
Reference in New Issue
Block a user