resolver work continued

This commit is contained in:
Mike Macgirvin 2024-03-14 21:29:27 -07:00
parent 0b73c4cffd
commit 572b1abae3

View file

@ -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();
}
}