Welcome Guest, Not a member yet? Register   Sign In
Command line usage and passing arguments with slashes

I am trying to use code igniter on the command line. I am using it as follows:

php index.php controller_name function_name /path/to/file/file.txt

However codeigniter does not pass the entire argument, it splits it using the slash into an array and passes that instead.

Is there any way to get codeigniter to not do this? I really don't want to have to urlencode my file path when using CLI. Also I don't want to implode the array it passes to construct the file path.

I have the same problem with v2.1.0 - has anyone resolved this issue yet?

Hello Guys,

there are basically two approaches:

1. Use $GLOBALS["argv"]
2. Extract the path from $this->uri->uri_string()

Not elegant, but it works.

Hope it helps a little Smile

best regards

Theme © iAndrew 2016 - Forum software by © MyBB