mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Add temporary filesystem service provider
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Alchemy\Phrasea\Core\Provider;
|
||||||
|
|
||||||
|
use Neutron\TemporaryFilesystem\TemporaryFilesystem;
|
||||||
|
use Silex\Application;
|
||||||
|
use Silex\ServiceProviderInterface;
|
||||||
|
|
||||||
|
class TemporaryFilesystemServiceProvider implements ServiceProviderInterface
|
||||||
|
{
|
||||||
|
public function register(Application $app)
|
||||||
|
{
|
||||||
|
$app['temporary-filesystem'] = $app->share(function (Application $app) {
|
||||||
|
return new TemporaryFilesystem($app['filesystem']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function boot(Application $app)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Alchemy\Tests\Phrasea\Core\Provider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Alchemy\Phrasea\Core\Provider\TemporaryFilesystemServiceProvider
|
||||||
|
*/
|
||||||
|
class TemporaryFilesystemServiceProvidertest extends ServiceProviderTestCase
|
||||||
|
{
|
||||||
|
public function provideServiceDescription()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('Alchemy\Phrasea\Core\Provider\TemporaryFilesystemServiceProvider', 'temporary-filesystem', 'Neutron\TemporaryFilesystem\TemporaryFilesystem'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user