mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
add tests
This commit is contained in:
parent
27f7f9a1dd
commit
e09ac0686e
|
|
@ -444,11 +444,16 @@ final class HttpRequest extends RequestAbstract
|
|||
{
|
||||
$this->hash = [\sha1('')];
|
||||
$pathArray = $this->uri->getPathElements();
|
||||
$pathLength = \count($pathArray);
|
||||
|
||||
for ($i = $start; $i < $pathLength; ++$i) {
|
||||
if ($pathArray[$i] === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($pathArray as $key => $path) {
|
||||
$paths = [];
|
||||
for ($i = $start; $i <= $key; ++$i) {
|
||||
$paths[] = $pathArray[$i];
|
||||
for ($j = $start; $j <= $i; ++$j) {
|
||||
$paths[] = $pathArray[$j];
|
||||
}
|
||||
|
||||
$this->hash[] = \sha1(\implode('', $paths));
|
||||
|
|
|
|||
|
|
@ -140,12 +140,18 @@ final class ModuleManager
|
|||
public function getLanguageFiles(RequestAbstract $request, string $app = null) : array
|
||||
{
|
||||
$files = $this->getUriLoad($request);
|
||||
if (!isset($files['5'])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$lang = [];
|
||||
if (isset($files['5'])) {
|
||||
foreach ($files['5'] as $module) {
|
||||
$lang[] = '/Modules/' . $module['module_load_from'] . '/Theme/' . ($app ?? $this->app->appName) . '/Lang/' . $module['module_load_file'];
|
||||
}
|
||||
foreach ($files['5'] as $module) {
|
||||
$lang[] = '/Modules/'
|
||||
. $module['module_load_from']
|
||||
. '/Theme/'
|
||||
. ($app ?? $this->app->appName)
|
||||
. '/Lang/'
|
||||
. $module['module_load_file'];
|
||||
}
|
||||
|
||||
return $lang;
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ final class HttpUri implements UriInterface
|
|||
$this->path = $path;
|
||||
}
|
||||
|
||||
$this->pathElements = \explode('/', \ltrim($this->path, '/'));
|
||||
$this->pathElements = \explode('/', \trim($this->path, '/'));
|
||||
$this->queryString = $url['query'] ?? '';
|
||||
|
||||
if (!empty($this->queryString)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user