diff --git a/Core/HelperFunctions.php b/Core/HelperFunctions.php index f65887c..700e650 100644 --- a/Core/HelperFunctions.php +++ b/Core/HelperFunctions.php @@ -44,14 +44,16 @@ public static function functional(?Money $money): ?string public static function getAssetsDir(): string { $root = self::getRoot(); - if (file_exists($root . "/" . AnalyticsConfig::$assets . "/promatur/sc-analytics")) { - return $root . "/" . AnalyticsConfig::$assets . "/promatur/sc-analytics"; - } - - if (file_exists($root . "/Assets")) { - return $root . "/Assets"; + $paths = [ + $root . "/" . AnalyticsConfig::$assets . "/promatur/sc-analytics", + $root . "/public/" . AnalyticsConfig::$assets . "/promatur/sc-analytics", + $root . "/Assets" + ]; + foreach ($paths as $path) { + if (file_exists($path)) { + return $path; + } } - throw new RuntimeException("Could not get asset directory"); }