/** * {@inheritDoc} */ public function register(Application $app) { $app['phraseanet.xsendfile-factory'] = $app->share(function ($app) { return XSendFileFactory::create($app); }); $app['phraseanet.file-serve'] = $app->share(function (Application $app) { return ServeFileResponseFactory::create($app); }); }
/** * {@inheritDoc} */ public function register(Application $app) { $app['phraseanet.xsendfile-factory'] = $app->share(function ($app) { return XSendFileFactory::create($app); }); $app['phraseanet.h264-factory'] = $app->share(function ($app) { return H264Factory::create($app); }); $app['phraseanet.h264'] = $app->share(function ($app) { return $app['phraseanet.h264-factory']->createMode(false); }); $app['phraseanet.static-file'] = $app->share(function (Application $app) { return new StaticMode(SymLinker::create($app)); }); $app['phraseanet.file-serve'] = $app->share(function (Application $app) { return ServeFileResponseFactory::create($app); }); }
public function testFactoryCreation() { $factory = XSendFileFactory::create(self::$DI['app']); $this->assertInstanceOf('Alchemy\\Phrasea\\Http\\XSendFile\\XSendFileFactory', $factory); }