/** * @return JavaScriptResourceManager */ public function getJsLoader() { $utility = $this->getUtility($this->params, ['cache_db_dir' => $this->appPaths->absolute('kernel_cache') . '/../document_jsloader/loader', 'web_cache_dir' => $this->appPaths->absolute('web_cache'), 'web_cache_url' => $this->appPaths->url('web_cache')]); $doc = new HtmlDocument(); $utility->createResOnAdd($doc, "javascript", "default"); $doc->resources("javascript")->chooseOnAdd("default"); $locator = new FileLocator($this->appPaths->absolute("kernel_root") . '/document'); $loader = $utility->createResourcesLoader($doc, 'javascript', $locator, '/'); $loader->load('jsloader.yml', 'jsloader'); return $doc->resources("javascript"); }
/** * @param object $obj * @param string $fieldName * * @return ImageResourcesLoader */ protected function getLoader($obj, $fieldName) { $accessor = PropertyAccess::createPropertyAccessor(); $hash = spl_object_hash($obj); if (is_null($accessor->getValue($this->loaders, "[{$hash}][{$fieldName}]"))) { $locator = new FileLocator($this->appPaths->absolute('kernel_root') . ImagesMappingService::CONFIG_DIR); $loader = new ImageResourcesLoader($locator, ['images_root_dir' => $this->appPaths->absolute('web'), 'images_output_dir' => $this->appPaths->absolute('web'), 'baseurl' => $this->appPaths->getBasePath(), 'cache_dir' => $this->appPaths->absolute('kernel_cache') . ImagesMappingService::CACHE_IMAGES_DIR, 'cache_refresh' => $this->environment === 'dev']); $accessor->setValue($this->loaders, "[{$hash}][{$fieldName}]", $loader); } return $this->loaders[$hash][$fieldName]; }
/** * Returns wkhtmltopdf options. * * @param string $uri * @param string $wkHtmlToPdfBin * * @return array */ public function getWkHtmlToPdfOptions($uri, $wkHtmlToPdfBin) { return ['dummy_pdf_url' => $this->appPaths->url('web') . '/pdf/empty.pdf', 'display_url' => $uri . '?do=display', 'download_url' => $uri . '?do=download', 'remote_url' => $uri . '?do=display', 'pluginDetect_PDFReader_url' => $this->appPaths->url('web') . '/pdf/PluginDetect_PDFReader.js', 'waiting_view_path' => $this->appPaths->absolute('web') . '/pdf/waiting-view.html', 'queue_db_path' => $this->appPaths->getRootDir() . '/pdf/queue.db', 'wkhtmltopdf_global' => ['binary' => $wkHtmlToPdfBin]]; }
/** * @return string */ protected function getRequirejsRcFile() { return $this->appPaths->getRootDir() . '/../.requirejsrc'; }
/** * @return string */ private function getConfigDirectory() { return $this->appPaths->absolute('kernel_root') . self::CONFIG_DIR; }