Skip to content
Snippets Groups Projects

feat: remove compilation command

Open Bartek Jaskulski requested to merge v0.10 into main
1 file
+ 8
3
Compare changes
  • Side-by-side
  • Inline
+ 8
3
@@ -92,10 +92,10 @@ final class Kernel {
return preg_replace( '/[^\w_]/', '_', implode("_", [ $plugin->get_slug(), $plugin->get_version(), 'container' ]) );
}
private function initialize_container( Plugin $plugin, bool $useCache = true ): Container {
private function initialize_container( Plugin $plugin, bool $use_cache = true ): Container {
$original_builder = new DiBuilder();
if ( $this->is_prod() && $useCache ) {
if ( $this->is_prod() && $use_cache ) {
$original_builder->enableCompilation(
$this->get_cache_path(),
$this->get_container_name( $plugin )
@@ -114,7 +114,12 @@ final class Kernel {
try {
return $builder->build();
} catch ( \Exception $e ) {
} catch ( \InvalidArgumentException $e ) {
if ( $use_cache === false ) {
// It means, that saving to disk was not an issue.
throw $e;
}
return $this->initialize_container( $plugin, false );
}
}
Loading