mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 14:38:39 +00:00
array loading changed
This commit is contained in:
parent
3f5d562af9
commit
0b77a3811b
|
|
@ -53,12 +53,12 @@ class InstallerAbstract
|
||||||
private static function installRoutes(string $appRoutePath, string $moduleRoutePath)
|
private static function installRoutes(string $appRoutePath, string $moduleRoutePath)
|
||||||
{
|
{
|
||||||
if(file_exists($appRoutePath) && file_exists($moduleRoutePath)) {
|
if(file_exists($appRoutePath) && file_exists($moduleRoutePath)) {
|
||||||
include $appRoutePath;
|
$appRoutes = include $appRoutePath;
|
||||||
include $moduleRoutePath;
|
$moduleRoutes = include $moduleRoutePath;
|
||||||
$appRoutes = array_merge_recursive($appRoutes, $moduleRoutes);
|
$appRoutes = array_merge_recursive($appRoutes, $moduleRoutes);
|
||||||
|
|
||||||
if(is_writable($appRoutePath)) {
|
if(is_writable($appRoutePath)) {
|
||||||
file_put_contents(ArrayParser::createFile('moduleRoutes', $appRoutes), $appRoutePath);
|
file_put_contents('<?php return ' . ArrayParser::serializeArray($appRoutes), $appRoutePath);
|
||||||
} else {
|
} else {
|
||||||
throw new PermissionException($appRoutePath);
|
throw new PermissionException($appRoutePath);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,7 @@ class Router
|
||||||
|
|
||||||
public function importFromFile(string $path)
|
public function importFromFile(string $path)
|
||||||
{
|
{
|
||||||
include $path;
|
$this->routes = include $path;
|
||||||
$this->routes = $appRoutes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user