Skip to content

Commit

Permalink
[console] Set cache key. (#3606)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas authored Nov 23, 2017
1 parent a8cbb28 commit 4e74e98
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Bootstrap/Drupal.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ public function boot()
]
);

$container->set(
'console.cache_key',
$drupalKernel->getContainerKey()
);

return $container;
} catch (\Exception $e) {
$container = $this->bootDrupalConsoleCore();
Expand Down
6 changes: 6 additions & 0 deletions src/Bootstrap/DrupalCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,11 @@ public function process(ContainerBuilder $container)
'console.invalid_commands',
null
);

// Set console.cache_key service
$container->set(
'console.cache_key',
null
);
}
}
4 changes: 4 additions & 0 deletions src/Bootstrap/DrupalKernelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public function discoverServiceProviders()
$this->discoverDrupalConsoleServiceProviders();
}

public function getContainerKey() {
return hash("sha256", $this->getContainerCacheKey());
}

public function discoverDrupalConsoleServiceProviders()
{
$drupalFinder = new DrupalFinder();
Expand Down

0 comments on commit 4e74e98

Please sign in to comment.