Example #1
0
 protected function getConnector($name, ConfigInterface $config)
 {
     if (!$config->has('directory')) {
         $settings = $config->toArray();
         $settings['directory'] = __DIR__ . '/Fixture';
         $config = new ArrayConfig($settings);
     }
     return new LocalConnector($name, $config);
 }
Example #2
0
 protected function buildCacheKeyFor($subject, OutputFormatInterface $output_format, ConfigInterface $renderer_config)
 {
     // @todo this has to become way more sophisticated, maybe we could introduce an interface
     // so that objects could provide their own portion to the cache-key: ICacheKeySource.getCacheKey
     return sprintf('%s-%s-%s', $this->getSubjectName($subject), $output_format->getName(), $this->getHash($renderer_config->toArray()));
 }
Example #3
0
 protected function getImplementorTemplate(ConfigInterface $renderer_config = null)
 {
     $implementor_template = $renderer_config->get('renderer_locator_lookup_template', self::DEFAULT_LOOKUP_TEMPLATE);
     $implementor_namespace = $renderer_config->get('renderer_locator_namespace', self::DEFAULT_LOOKUP_NAMESPACE);
     $implementor_modifier = $renderer_config->get('renderer_locator_modifier', self::DEFAULT_LOOKUP_MODIFIER);
     $implementor_suffix = $renderer_config->get('renderer_locator_suffix', self::DEFAULT_LOOKUP_SUFFIX);
     $implementor_template = str_replace('{NAMESPACE}', $implementor_namespace, $implementor_template);
     $implementor_template = str_replace('{OUTPUT_FORMAT_NAME}', StringToolkit::asStudlyCaps($this->output_format_name), $implementor_template);
     $implementor_template = str_replace('{MODIFIER}', StringToolkit::asStudlyCaps($implementor_modifier), $implementor_template);
     $implementor_template = str_replace('{SUFFIX}', StringToolkit::asStudlyCaps($implementor_suffix), $implementor_template);
     return $implementor_template;
 }