开发者

Codeigniter ignoring query strings. Only loading index page

I have setup remote debugging in netbeans. It works except codeigniter only loads the default controller (home page). I have enabled query开发者_高级运维 strings with

$config['enable_query_strings'] = TRUE;

The debugger opens up a page with the following url

http://blinkfilms.ben.dev/myid/tests?XDEBUG_SESSION_START=netbeans-xdebug

So codeigniter should fire up the controller in controllers/myid/tests.php


Found the problem:

$config['uri_protocol'] = "PATH_INFO";

For the record the following works:

$config['uri_protocol'] = "AUTO";

$config['permitted_uri_chars'] = '';

$config['enable_query_strings'] = TRUE;


Probably won't work in CI 2.0, but I managed to get it working in CI 1.7.2 with a hack.

Create a file in your application/libraries folder called "MY_Input.php" and add the following code:

function _sanitize_globals()
{
    if (isset($_GET['XDEBUG_SESSION_START']))
        $xdebug = $_GET['XDEBUG_SESSION_START'];

    parent::_sanitize_globals();

    if (isset($xdebug))
        $_GET['XDEBUG_SESSION_START'] = $xdebug;
}

Quick 'n dirty.. but works for me :) A pre-system hook might work as well with code like this, but I haven't tried that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜