diff --git a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php index 3333b45090..db97887c76 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php @@ -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) { diff --git a/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php index 988c1a850d..e0f477f17a 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php @@ -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) { diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php index 60603fc16b..186def385e 100644 --- a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php +++ b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php @@ -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; diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php index 8139ec89eb..170032d40d 100644 --- a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php +++ b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php @@ -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;