I have done this simple catch:
try
{
echo Request::factory()
->execute()
->send_headers()
->body();
}catch(Exception $e)
{
echo 'You tried to reach: ?';
}
in the bottom of my bootstrap.php and removed
echo Request::factory()
->execute()
->send_headers()
->body();
From the root index.php. This works fine, and the output “You tried to reach ?” appears when there’s a request of something unhandled.
I wish to mention the URI in this output message.
My further plans are to check in the DB for URI that matches the unhandled request, so for now I need to grab the URI you have tried to access.
How can i do this?
You may use
Request::detect_uri()Documentation: http://kohanaframework.org/3.0/guide/api/Request#detect_uri