mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 22:35:18 +00:00
resolver work continued
This commit is contained in:
parent
0b73c4cffd
commit
572b1abae3
1 changed files with 28 additions and 3 deletions
|
@ -30,9 +30,34 @@ class Apresolver extends Controller
|
|||
if (!($query && isset($query[0]['channel_id']))) {
|
||||
http_status_exit(404, 'Not found');
|
||||
}
|
||||
// @todo set link header in dest url
|
||||
$mappedPath = z_root() . $this->mapObject(str_replace('did:ap:key:' . $key, '', $url), $query[0]);
|
||||
goaway($mappedPath);
|
||||
$mappedPath = $this->mapObject(str_replace('did:ap:key:' . $key, '', $url), $query[0]);
|
||||
$localPath = ltrim($mappedPath, '/');
|
||||
App::$cmd = $localPath;
|
||||
$controller = ucfirst(substr($localPath, 0, strpos($localPath, '/')));
|
||||
$module = new $controller;
|
||||
App::$argv = explode('/', App::$cmd);
|
||||
|
||||
App::$argc = count(App::$argv);
|
||||
if ((array_key_exists('0', App::$argv)) && strlen(App::$argv[0])) {
|
||||
if (strpos(App::$argv[0],'.')) {
|
||||
$_REQUEST['module_format'] = substr(App::$argv[0],strpos(App::$argv[0], '.') + 1);
|
||||
App::$argv[0] = substr(App::$argv[0], 0, strpos(App::$argv[0], '.'));
|
||||
}
|
||||
|
||||
App::$module = str_replace(".", "_", App::$argv[0]);
|
||||
App::$module = str_replace("-", "_", App::$module);
|
||||
if (str_starts_with(App::$module, '_')) {
|
||||
App::$module = substr(App::$module, 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
App::$argc = 1;
|
||||
App::$argv = ['home'];
|
||||
App::$module = 'home';
|
||||
}
|
||||
|
||||
$module->init();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue