asdasd
This commit is contained in:
@@ -27,7 +27,7 @@ final class App
|
||||
{
|
||||
$keycloakConfig = ConfigLoader::load($this->projectRoot, 'keycloak');
|
||||
$auth = new KeycloakAuth($keycloakConfig);
|
||||
$moduleRegistry = new ModuleRegistry($this->projectRoot . '/modules');
|
||||
$moduleRegistry = new ModuleRegistry(AppPaths::customAppsRoot($this->projectRoot));
|
||||
$registry = new AppRegistry($this->projectRoot . '/config/apps.php', $moduleRegistry->desktopApps());
|
||||
$widgetRegistry = new WidgetRegistry($this->projectRoot . '/config/widgets.php', $moduleRegistry->widgets());
|
||||
$skins = SkinResolver::all();
|
||||
|
||||
28
src/App/AppPaths.php
Normal file
28
src/App/AppPaths.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App;
|
||||
|
||||
final class AppPaths
|
||||
{
|
||||
public static function customAppsRoot(string $projectRoot): string
|
||||
{
|
||||
return rtrim($projectRoot, '/') . '/custom/apps';
|
||||
}
|
||||
|
||||
public static function customAppPath(string $projectRoot, string $appName): string
|
||||
{
|
||||
return self::customAppsRoot($projectRoot) . '/' . trim($appName, '/');
|
||||
}
|
||||
|
||||
public static function systemAppsRoot(string $projectRoot): string
|
||||
{
|
||||
return rtrim($projectRoot, '/') . '/system/apps';
|
||||
}
|
||||
|
||||
public static function systemAppPath(string $projectRoot, string $appName): string
|
||||
{
|
||||
return self::systemAppsRoot($projectRoot) . '/' . trim($appName, '/');
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace ModulesCore {
|
||||
|
||||
use App\AppPaths;
|
||||
use App\ConfigLoader;
|
||||
use App\KeycloakAuth;
|
||||
use App\PdoFactory;
|
||||
@@ -308,7 +309,7 @@ namespace ModulesCore {
|
||||
|
||||
private function modulePath(string $moduleName): string
|
||||
{
|
||||
return $this->projectRoot . '/modules/' . trim($moduleName, '/');
|
||||
return AppPaths::customAppPath($this->projectRoot, $moduleName);
|
||||
}
|
||||
|
||||
private function ensureBooted(string $moduleName): void
|
||||
@@ -520,7 +521,7 @@ namespace {
|
||||
return [];
|
||||
}
|
||||
|
||||
$path = dirname(__DIR__, 2) . '/modules/' . $module . '/design.json';
|
||||
$path = AppPaths::customAppPath(dirname(__DIR__, 2), $module) . '/design.json';
|
||||
if (!is_file($path)) {
|
||||
return [];
|
||||
}
|
||||
@@ -624,7 +625,7 @@ namespace {
|
||||
if (!function_exists('module_tpl')) {
|
||||
function module_tpl(string $module, string $name, array $data = []): void
|
||||
{
|
||||
$path = dirname(__DIR__, 2) . '/modules/' . $module . '/partials/' . $name . '.php';
|
||||
$path = AppPaths::customAppPath(dirname(__DIR__, 2), $module) . '/partials/' . $name . '.php';
|
||||
if (!is_file($path)) {
|
||||
echo '<!-- module_tpl(): not found -->';
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user