Skip to content
Snippets Groups Projects

Change parser of *.theme.yml to create dynamic libraries from components #3392483

4 unresolved threads

Closes #3392483

Edited by Andrey Postnikov

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
96 97 }
97 98 $mask = '/^.*\.' . $type . '\.yml$/';
98 99 $theme = $this->themeHandler->getTheme($this->themeName);
99 return $this->fileSystem->scanDirectory($theme->getPath(), $mask, ['key' => 'name']);
100 $file_cache = FileCacheFactory::get('component_connector:' . $type);
  • Andrey Postnikov
    Andrey Postnikov @andypost started a thread on commit 8255f104
  • 114 $new_hook_theme = [];
    115 if (isset($definition['hook theme'])) {
    116 $path_parts = pathinfo($file->uri);
    117 $template = str_replace('.theme', '', $path_parts['filename']);
    118 $new_hook_theme['template'] = $template;
    119 $new_hook_theme['path'] = $path_parts['dirname'];
    120 $this->attachLibraries($definition, $new_hook_theme);
    121 if (isset($definition['base hook']) && isset($theme_registry[$definition['base hook']])) {
    122 $theme_registry[$definition['hook theme']] = NestedArray::mergeDeep($theme_registry[$definition['base hook']], $new_hook_theme);
    123 $theme_registry[$definition['hook theme']]['base hook'] = $definition['base hook'];
    124 }
    125 elseif (isset($theme_registry[$definition['hook theme']])) {
    126 // Replace hook theme.
    127 $theme_registry[$definition['hook theme']] = NestedArray::mergeDeep($theme_registry[$definition['hook theme']], $new_hook_theme);
    126 foreach ($this->getDefinitions() as $id => $definition) {
    127 $definition = reset($definition);
  • Andrey Postnikov
    Andrey Postnikov @andypost started a thread on commit 8255f104
  • 96 97 }
    97 98 $mask = '/^.*\.' . $type . '\.yml$/';
    98 99 $theme = $this->themeHandler->getTheme($this->themeName);
    99 return $this->fileSystem->scanDirectory($theme->getPath(), $mask, ['key' => 'name']);
    100 $file_cache = FileCacheFactory::get('component_connector:' . $type);
    101 $files = $this->fileSystem->scanDirectory($theme->getPath(), $mask, ['key' => 'uri']);
    102 $all = [];
    103 // Try to load from the file cache first.
    104 foreach ($file_cache->getMultiple(array_keys($files)) as $file => $data) {
    105 $all[$file] = $data;
    106 unset($files[$file]);
    107 }
    108 if ($files) {
    109 foreach ($files as $id => $file) {
    110 $data = Yaml::decode(file_get_contents($file->uri)) ?: [];
  • Andrey Postnikov
    Andrey Postnikov @andypost started a thread on commit 8255f104
  • 180 204 * @param array $new_hook_theme
    181 205 * An new hook theme array.
    182 206 */
  • Andrey Postnikov changed title from Issue# 3392479 Preparing version 2 to *{+Change parser of .theme.yml to create dynamic libraries from components #3392483+}

    changed title from Issue# 3392479 Preparing version 2 to *{+Change parser of .theme.yml to create dynamic libraries from components #3392483+}

  • Andrey Postnikov changed the description

    changed the description

  • It needs rebase to address my feedback

  • Please register or sign in to reply
    Loading