protected function initializeResponder($request) { $config = new ResourceManager(__DIR__); $config->setPath('cache', 'tmp/cache'); $config->setPath('files', 'images'); $config->compat(); $app = new Application(array('resources' => $config)); $app->register(new \Bolt\Provider\CacheServiceProvider()); $responder = new ThumbnailResponder($app, $request); $responder->initialize(); return $responder; }
protected function initializeResponder($request) { $container = new Pimple(array('rootpath' => __DIR__, 'pathmanager' => new PlatformFileSystemPathFactory())); $config = new ResourceManager($container); $config->setPath('cache', 'tmp/cache'); $config->setPath('files', 'images'); $config->compat(); $app = new Application(array('resources' => $config)); $app->register(new CacheServiceProvider()); $responder = new ThumbnailResponder($app, $request); $responder->initialize(); return $responder; }
/** * @param string $locale * @param string $fileContent * @param ResourceManager $resources */ protected function initializeFakeTranslationFiles($locale, $fileContent, ResourceManager $resources) { $fakeAppRoot = $resources->getPath('cache'); $fakeTranslationDir = "{$fakeAppRoot}/app/resources/translations/{$locale}"; (new Filesystem())->mkdir($fakeTranslationDir); file_put_contents("{$fakeTranslationDir}/messages.{$locale}.yml", $fileContent); $resources->setPath('root', $fakeAppRoot); }
/** * @param Config\ResourceManager $config */ protected function setAppPaths($config) { $config->setPath('app', PHPUNIT_WEBROOT . '/app'); $config->setPath('config', PHPUNIT_WEBROOT . '/app/config'); $config->setPath('cache', PHPUNIT_WEBROOT . '/app/cache'); $config->setPath('web', PHPUNIT_WEBROOT . '/'); $config->setPath('files', PHPUNIT_WEBROOT . '/files'); $config->setPath('themebase', PHPUNIT_WEBROOT . '/theme/'); $config->setPath('extensionsconfig', PHPUNIT_WEBROOT . '/config/extensions'); $config->setPath('extensions', PHPUNIT_WEBROOT . '/extensions'); }