mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Add LazyLocator
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\DoDownloadController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -26,13 +27,10 @@ class DoDownload implements ControllerProviderInterface, ServiceProviderInterfac
|
||||
{
|
||||
$app['controller.prod.do-download'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new DoDownloadController($app))
|
||||
->setDelivererLocator(function () use ($app) {
|
||||
return $app['phraseanet.file-serve'];
|
||||
})
|
||||
->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve'))
|
||||
->setDispatcher($app['dispatcher'])
|
||||
->setFileSystemLocator(function () use ($app) {
|
||||
return $app['filesystem'];
|
||||
});
|
||||
->setFileSystemLocator(new LazyLocator($app, 'filesystem'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\EditController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -28,9 +29,7 @@ class Edit implements ControllerProviderInterface, ServiceProviderInterface
|
||||
return (new EditController($app))
|
||||
->setDataboxLoggerLocator($app['phraseanet.logger'])
|
||||
->setDispatcher($app['dispatcher'])
|
||||
->setSubDefinitionSubstituerLocator(function () use ($app) {
|
||||
return $app['subdef.substituer'];
|
||||
})
|
||||
->setSubDefinitionSubstituerLocator(new LazyLocator($app, 'subdef.substituer'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\ExportController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -27,12 +28,8 @@ class Export implements ControllerProviderInterface, ServiceProviderInterface
|
||||
$app['controller.prod.export'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new ExportController($app))
|
||||
->setDispatcher($app['dispatcher'])
|
||||
->setFileSystemLocator(function () use ($app) {
|
||||
return $app['filesystem'];
|
||||
})
|
||||
->setDelivererLocator(function () use ($app) {
|
||||
return $app['notification.deliverer'];
|
||||
})
|
||||
->setFileSystemLocator(new LazyLocator($app, 'filesystem'))
|
||||
->setDelivererLocator(new LazyLocator($app, 'notification.deliverer'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\LazaretController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -27,18 +28,10 @@ class Lazaret implements ControllerProviderInterface, ServiceProviderInterface
|
||||
$app['controller.prod.lazaret'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new LazaretController($app))
|
||||
->setDataboxLoggerLocator($app['phraseanet.logger'])
|
||||
->setDelivererLocator(function () use ($app) {
|
||||
return $app['phraseanet.file-serve'];
|
||||
})
|
||||
->setEntityManagerLocator(function () use ($app) {
|
||||
return $app['orm.em'];
|
||||
})
|
||||
->setFileSystemLocator(function () use ($app) {
|
||||
return $app['filesystem'];
|
||||
})
|
||||
->setSubDefinitionSubstituerLocator(function () use ($app) {
|
||||
return $app['subdef.substituer'];
|
||||
})
|
||||
->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve'))
|
||||
->setEntityManagerLocator(new LazyLocator($app, 'orm.em'))
|
||||
->setFileSystemLocator(new LazyLocator($app, 'filesystem'))
|
||||
->setSubDefinitionSubstituerLocator(new LazyLocator($app, 'subdef.substituer'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\OrderController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -27,12 +28,8 @@ class Order implements ControllerProviderInterface, ServiceProviderInterface
|
||||
$app['controller.prod.order'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new OrderController($app))
|
||||
->setDispatcher($app['dispatcher'])
|
||||
->setEntityManagerLocator(function () use ($app) {
|
||||
return $app['orm.em'];
|
||||
})
|
||||
->setUserQueryFactory(function () use ($app) {
|
||||
return $app['phraseanet.user-query'];
|
||||
})
|
||||
->setEntityManagerLocator(new LazyLocator($app, 'orm.em'))
|
||||
->setUserQueryFactory(new LazyLocator($app, 'phraseanet.user-query'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\PushController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -28,12 +29,8 @@ class Push implements ControllerProviderInterface, ServiceProviderInterface
|
||||
return (new PushController($app))
|
||||
->setDataboxLoggerLocator($app['phraseanet.logger'])
|
||||
->setDispatcher($app['dispatcher'])
|
||||
->setEntityManagerLocator(function () use ($app) {
|
||||
return $app['orm.em'];
|
||||
})
|
||||
->setUserQueryFactory(function () use ($app) {
|
||||
return $app['phraseanet.user-query'];
|
||||
})
|
||||
->setEntityManagerLocator(new LazyLocator($app, 'orm.em'))
|
||||
->setUserQueryFactory(new LazyLocator($app, 'phraseanet.user-query'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\QueryController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -26,12 +27,8 @@ class Query implements ControllerProviderInterface, ServiceProviderInterface
|
||||
{
|
||||
$app['controller.prod.query'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new QueryController($app))
|
||||
->setSearchEngineLocator(function () use ($app) {
|
||||
return $app['phraseanet.SE'];
|
||||
})
|
||||
->setSearchEngineLoggerLocator(function () use ($app) {
|
||||
return $app['phraseanet.SE.logger'];
|
||||
})
|
||||
->setSearchEngineLocator(new LazyLocator($app, 'phraseanet.SE'))
|
||||
->setSearchEngineLoggerLocator(new LazyLocator($app, 'phraseanet.SE.logger'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\RecordController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -26,12 +27,8 @@ class Record implements ControllerProviderInterface, ServiceProviderInterface
|
||||
{
|
||||
$app['controller.prod.records'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new RecordController($app))
|
||||
->setEntityManagerLocator(function () use ($app) {
|
||||
return $app['orm.em'];
|
||||
})
|
||||
->setSearchEngineLocator(function () use ($app) {
|
||||
return $app['phraseanet.SE'];
|
||||
})
|
||||
->setEntityManagerLocator(new LazyLocator($app, 'orm.em'))
|
||||
->setSearchEngineLocator(new LazyLocator($app, 'phraseanet.SE'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\StoryController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -27,9 +28,7 @@ class Story implements ControllerProviderInterface, ServiceProviderInterface
|
||||
$app['controller.prod.story'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new StoryController($app))
|
||||
->setDispatcher($app['dispatcher'])
|
||||
->setEntityManagerLocator(function () use ($app) {
|
||||
return $app['orm.em'];
|
||||
})
|
||||
->setEntityManagerLocator(new LazyLocator($app, 'orm.em'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\ToolsController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -27,12 +28,8 @@ class Tools implements ControllerProviderInterface, ServiceProviderInterface
|
||||
$app['controller.prod.tools'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new ToolsController($app))
|
||||
->setDataboxLoggerLocator($app['phraseanet.logger'])
|
||||
->setFileSystemLocator(function () use ($app) {
|
||||
return $app['filesystem'];
|
||||
})
|
||||
->setSubDefinitionSubstituerLocator(function () use ($app) {
|
||||
return $app['subdef.substituer'];
|
||||
})
|
||||
->setFileSystemLocator(new LazyLocator($app, 'filesystem'))
|
||||
->setSubDefinitionSubstituerLocator(new LazyLocator($app, 'subdef.substituer'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\TooltipController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -26,9 +27,7 @@ class Tooltip implements ControllerProviderInterface, ServiceProviderInterface
|
||||
{
|
||||
$app['controller.prod.tooltip'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new TooltipController($app))
|
||||
->setSearchEngineLocator(function () use ($app) {
|
||||
return $app['phraseanet.SE'];
|
||||
})
|
||||
->setSearchEngineLocator(new LazyLocator($app, 'phraseanet.SE'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\ControllerProvider\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\LazyLocator;
|
||||
use Alchemy\Phrasea\Controller\Prod\UploadController;
|
||||
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
||||
use Silex\Application;
|
||||
@@ -26,23 +27,13 @@ class Upload implements ControllerProviderInterface, ServiceProviderInterface
|
||||
{
|
||||
$app['controller.prod.upload'] = $app->share(function (PhraseaApplication $app) {
|
||||
return (new UploadController($app))
|
||||
->setBorderManagerLocator(function () use ($app) {
|
||||
return $app['border-manager'];
|
||||
})
|
||||
->setBorderManagerLocator(new LazyLocator($app, 'border-manager'))
|
||||
->setDispatcher($app['dispatcher'])
|
||||
->setDataboxLoggerLocator($app['phraseanet.logger'])
|
||||
->setEntityManagerLocator(function () use ($app) {
|
||||
return $app['orm.em'];
|
||||
})
|
||||
->setFileSystemLocator(function () use ($app) {
|
||||
return $app['filesystem'];
|
||||
})
|
||||
->setTemporaryFileSystemLocator(function () use ($app) {
|
||||
return $app['temporary-filesystem'];
|
||||
})
|
||||
->setSubDefinitionSubstituerLocator(function () use ($app) {
|
||||
return $app['subdef.substituer'];
|
||||
})
|
||||
->setEntityManagerLocator(new LazyLocator($app, 'orm.em'))
|
||||
->setFileSystemLocator(new LazyLocator($app, 'filesystem'))
|
||||
->setTemporaryFileSystemLocator(new LazyLocator($app, 'temporary-filesystem'))
|
||||
->setSubDefinitionSubstituerLocator(new LazyLocator($app, 'subdef.substituer'))
|
||||
;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user