Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
speckmaier committed Aug 14, 2024
2 parents c4988fd + d478007 commit ddf00a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ final public static function registerPlugin(string $file, bool $debug = false):
*/
final public static function buildContainer(): void
{
if (!self::pluginVendorExists())
{
die('Please run "composer install" to ensure all dependencies are installed.' . PHP_EOL);
}

// Set debug to true to always renew the container
$obj = new static('__BUILD__', getcwd(), '__BUILD__', true);
$obj->kernel->forceContainerCacheUpdate();
Expand All @@ -52,4 +57,10 @@ private function registerPluginApi(): void
return $this;
}, 10, 0);
}

private static function pluginVendorExists()
{
$relVendorLocation = getcwd() . '/vendor';
return file_exists($relVendorLocation) && is_dir($relVendorLocation);
}
}

0 comments on commit ddf00a0

Please sign in to comment.