getAttribute('route'); $file = !empty($route->file) ? ltrim($route->file, '/') : ''; if ($file[0] === '~' || strpos($file, '..') !== false) { throw new \RuntimeException("Won't route to '$file': '~', '..' are not allowed in filename"); } if (!file_exists($file)) { throw new \RuntimeException("Failed to route using '$file': File doesn't exist"); } $result = $this->includeScript($file, $request, $response); return $result === true || $result === 1 ? $response : $result; } }