从Kohana 3.0升级到3.1后,为什么Request :: current()为null?

We upgraded our Kohana framework from 3.0 to 3.1 and so in the bootstrap.php file I had to change:

request = Request::instance($_SERVER['PATH_INFO']);

to

$request = Request::current(); 

but now $request is always null.

What do I have to change so that Request::current() returns a request instead of null?

You need call Request::factory() to create initial Request object. Request::current() doesnt create new request, just returns current.

Also, you need to change your index.php and bootstrap.php files, because Request execution was moved into index.php.

PS. Maybe this link will helps.