Stack Frames
#0
{main}
/app/app/Viewpelet/Controllers/HomeController.php : 262
app
#1
Viewpelet\Controllers\HomeController->SwitchLanguage
[internal code]
vendor
#2
call_user_func_array
plugins/vinexel/vision-serve/core/Modules/Router/Router.php : 594
app
#3
Vinexel\Modules\Router\Router::callAction
plugins/vinexel/vision-serve/core/Modules/Router/Router.php : 470
app
#4
Vinexel\Modules\Router\Router::{closure:Vinexel\Modules\Router\Router::handleMatch():470}
plugins/vinexel/vision-serve/core/Modules/Router/Router.php : 489
app
#5
Vinexel\Modules\Router\Router::handleMatch
plugins/vinexel/vision-serve/core/Modules/Router/Router.php : 409
app
#6
Vinexel\Modules\Router\Router::dispatch
plugins/vinexel/vision-serve/core/Modules/Router/RouterInitializer.php : 76
app
#7
Vinexel\Modules\Router\RouterInitializer::{closure:Vinexel\Modules\Router\RouterInitializer::run():74}
plugins/vinexel/vision-serve/core/Modules/Http/Middleware/ApiMiddleware.php : 17
app
#8
Vinexel\Modules\Http\Middleware\ApiMiddleware->handle
plugins/vinexel/vision-serve/core/Modules/Http/Kernel.php : 67
app
#9
Vinexel\Modules\Http\Kernel->{closure:{closure:Vinexel\Modules\Http\Kernel::handle():67}:67}
plugins/vinexel/vision-serve/core/Modules/Http/Middleware/TracingMiddleware.php : 33
app
#10
Vinexel\Modules\Http\Middleware\TracingMiddleware->handle
plugins/vinexel/vision-serve/core/Modules/Http/Kernel.php : 67
app
#11
Vinexel\Modules\Http\Kernel->{closure:{closure:Vinexel\Modules\Http\Kernel::handle():67}:67}
plugins/vinexel/vision-serve/core/Modules/Http/Kernel.php : 69
app
#12
Vinexel\Modules\Http\Kernel->handle
plugins/vinexel/vision-serve/core/Modules/Router/RouterInitializer.php : 74
app
#13
Vinexel\Modules\Router\RouterInitializer::run
plugins/vinexel/vision-serve/core/Modules/RegisterModule.php : 116
app
#14
Vinexel\Modules\RegisterModule->dispatch
/app/system/framework/Application.php : 140
vendor
#15
Vision\Application->run
/app/public/index.php : 89
app
/app/app/Viewpelet/Controllers/HomeController.php
Line 262
256
if (!in_array($lang, $allowed)) $lang = 'id';
257
258
session_start();
259
$_SESSION['lang'] = $lang;
260
261
// Redirect back to previous page or home
262
$referer = $_SERVER['HTTP_REFERER'] ?? route('home');
263
header("Location: $referer");
264
exit;
265
} catch (\Throwable $e) {
266
$this->handleException($e);
267
}
268
}
[internal code]
Line 0
[Internal code — source not available]
plugins/vinexel/vision-serve/core/Modules/Router/Router.php
Line 594
588
$controllerInstance = Container::resolve($controllerClass);
589
590
if (!method_exists($controllerInstance, $method)) {
591
return self::sendServerError("Method '{$method}' in controller '{$controllerClass}' not found");
592
}
593
594
return call_user_func_array([$controllerInstance, $method], $params);
595
}
596
597
/**
598
* Execute middleware for the current route.
599
*
600
* @param string $key Middleware key
plugins/vinexel/vision-serve/core/Modules/Router/Router.php
Line 470
464
$matches,
465
fn($key) => !is_int($key),
466
ARRAY_FILTER_USE_KEY
467
)
468
);
469
470
$destination = fn () => self::callAction($route['action'], $params, $route['namespace'] ?? self::$namespace);
471
$middleware = array_values((array) ($route['middleware'] ?? []));
472
// API routes always enter the JSON/stateless boundary. Session remains
473
// an explicit route middleware (`api-session`).
474
if (RequestMode::isApiPath((string) ($route['uri'] ?? ''))
475
&& !in_array('api', $middleware, true)) {
476
array_unshift($middleware, 'api');
plugins/vinexel/vision-serve/core/Modules/Router/Router.php
Line 489
483
self::$currentMiddleware[] = (string) $middlewareKey;
484
return self::invokeMiddleware((string) $middlewareKey, $next);
485
};
486
}
487
488
try {
489
return $destination();
490
} catch (\Throwable $exception) {
491
if (RequestMode::isApi($_SERVER)) {
492
self::jsonError('internal_server_error', 'internal_server_error', 500);
493
return null;
494
}
495
throw $exception;
plugins/vinexel/vision-serve/core/Modules/Router/Router.php
Line 409
403
}
404
}
405
}
406
407
unset($route);
408
if ($bestRoute !== null) {
409
return self::handleMatch($bestRoute, $bestMatches);
410
}
411
if (RequestMode::isApi($_SERVER)) {
412
$allowed = self::allowedMethods($requestUri);
413
if ($allowed !== []) {
414
self::handle405($allowed);
415
return null;
plugins/vinexel/vision-serve/core/Modules/Router/RouterInitializer.php
Line 76
70
Request::setInstance($request);
71
$kernel = new Kernel();
72
73
// Jalankan Kernel untuk Middleware Global (Session, CSRF, dll)
74
$kernel->handle($request, function ($request) {
75
// Setelah middleware global lolos, jalankan router
76
Router::dispatch();
77
});
78
}
79
}
plugins/vinexel/vision-serve/core/Modules/Http/Middleware/ApiMiddleware.php
Line 17
11
/** Stateless API boundary: deterministic headers and shared rate limiting. */
12
final class ApiMiddleware
13
{
14
public function handle(Request $request, Closure $next): mixed
15
{
16
if (!$request->isApi()) {
17
return $next($request);
18
}
19
if ($request->getAttribute('_api_boundary') === true) {
20
return $next($request);
21
}
22
$request->setAttribute('_api_boundary', true);
23
header('Content-Type: application/json; charset=utf-8');
plugins/vinexel/vision-serve/core/Modules/Http/Kernel.php
Line 67
61
}
62
63
$pipeline = array_merge($this->middleware, $resolved);
64
65
return array_reduce(
66
array_reverse($pipeline),
67
fn($next, $m) => fn($req) => (new $m())->handle($req, $next),
68
$destination
69
)($request);
70
}
71
72
/**
73
* Resolve middleware class by key.
plugins/vinexel/vision-serve/core/Modules/Http/Middleware/TracingMiddleware.php
Line 33
27
28
// Inject into response header
29
header("X-Request-ID: {$requestId}");
30
31
// You could also inject this into a global logger context here if using Monolog
32
33
return $next($request);
34
}
35
}
plugins/vinexel/vision-serve/core/Modules/Http/Kernel.php
Line 67
61
}
62
63
$pipeline = array_merge($this->middleware, $resolved);
64
65
return array_reduce(
66
array_reverse($pipeline),
67
fn($next, $m) => fn($req) => (new $m())->handle($req, $next),
68
$destination
69
)($request);
70
}
71
72
/**
73
* Resolve middleware class by key.
plugins/vinexel/vision-serve/core/Modules/Http/Kernel.php
Line 69
63
$pipeline = array_merge($this->middleware, $resolved);
64
65
return array_reduce(
66
array_reverse($pipeline),
67
fn($next, $m) => fn($req) => (new $m())->handle($req, $next),
68
$destination
69
)($request);
70
}
71
72
/**
73
* Resolve middleware class by key.
74
*/
75
public function resolve(string $key): string
plugins/vinexel/vision-serve/core/Modules/Router/RouterInitializer.php
Line 74
68
{
69
$request = new Request();
70
Request::setInstance($request);
71
$kernel = new Kernel();
72
73
// Jalankan Kernel untuk Middleware Global (Session, CSRF, dll)
74
$kernel->handle($request, function ($request) {
75
// Setelah middleware global lolos, jalankan router
76
Router::dispatch();
77
});
78
}
79
}
plugins/vinexel/vision-serve/core/Modules/RegisterModule.php
Line 116
110
* This method executes the routing process and triggers
111
* the onCreate and onFinish lifecycle hooks.
112
*/
113
public function dispatch(): void
114
{
115
// Run the main router
116
RouterInitializer::run();
117
118
// Lifecycle start hook
119
$this->onCreate();
120
121
// Lifecycle finish hook
122
$this->onFinish([
/app/system/framework/Application.php
Line 140
134
if (!$stateless) {
135
Signature::injectHttpHeaders();
136
Signature::injectCookie();
137
}
138
139
// Dispatch the application request
140
$this->dispatch();
141
}
142
143
protected function onFinish(array $info): void
144
{
145
parent::onFinish($info);
146
}
/app/public/index.php
Line 89
83
}
84
};
85
register_shutdown_function($cleanup);
86
87
try {
88
$application = Transmitter::http();
89
$application->run();
90
} finally {
91
$cleanup();
92
}
93
94
// Flush output. The bootstrap's diagnostic probe is useful in server logs,
95
// but it must never become a text node after the document's closing tag: that
Request
| URL | http://viewpelet.com/switch-language/en |
|---|---|
| Method | GET |
Query Parameters
No query parameters
Headers
| User-Agent | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
|---|---|
| Accept | */* |
| Accept-Encoding | gzip, br, zstd, deflate |
| Via | 2.0 Caddy |
| X-Forwarded-For | 216.73.217.36 |
| X-Forwarded-Host | viewpelet.com |
| Cookie | vinexel_viewpelet_session=b5ec8e5347865c4d79761c4e164db564; lang=en |
| X-Forwarded-Proto | https |
| X-Real-Ip | 216.73.217.36 |
Runtime
| Execution Time | 0.0087s |
|---|---|
| Memory Usage | 2.00 MB |
| PHP Version | 8.5.11 |
| Framework | Vinexel v2.0.0 |
Session Data
| _csrf_token | 3f4bea32f8add08d52bbfff552c87a93a92a9ea841473277337823b49f6e2d39 |
|---|---|
| _csrf_token_time | 1795027099 |
| csrf_token | dd73e33393af0fa0be2e4c24c436a24f446e6e234c7c7448601f59167eccdc57 |
| csrf_token_time | 1795027099 |
| visitor_count | 1 |
| first_visit | 1795027099 |
| frontend_rate_8d2d3f39bf23dc1115d5b169855b8817 | Array ( [count] => 1 [start] => 1795027099 ) |
| lang | en |