Welcome Guest, Not a member yet? Register   Sign In
Command Line Controller without URI AUTO? CI2.0
#1

[eluser]Darkroom Dave[/eluser]
Not sure if this is a bug or a feature.

But due to certain redirects for paypal I can't run uri_protocol="AUTO" so I am running PATH_INFO.

But that means I can't run controllers straight from the commandline (from cron)

/* SNIP URI.php */

function _fetch_uri_string()
{
if (strtoupper($this->config->item('uri_protocol')) == 'AUTO')
{
// Arguments exist, it must be a command line request
if ( ! empty($_SERVER['argv']))
{
$this->uri_string = $this->_parse_cli_args();
return;
}

/* SNIP URI.php */

If you are not in AUTO it doesn't test for args.

My temporary solution is to check for args in my config file and swap back to auto for cron jobs.

But this behavior required me to look thru the code to figure out what was going on.

Dave Dula
Documentopia.com
#2

[eluser]Eric Barnes[/eluser]
You may want to download the tip from https://bitbucket.org/ellislab/codeigniter-reactor/

I remember seeing a commit to change the way this works in the past week or so.




Theme © iAndrew 2016 - Forum software by © MyBB