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