Welcome Guest, Not a member yet? Register   Sign In
Issue with routing when running from the CLI
#1

[eluser]Unknown[/eluser]
I'm trying to run a script via the CLI, but am having some issues getting it to route to the proper controller.

Here is my routes.php file:

Code:
$route['default_controller'] = "home";
$route['scaffolding_trigger'] = "scaffolding";

// URI like '/en/about' -> use controller 'about'
$route['^fr/(.+)$'] = "$1";
$route['^en/(.+)$'] = "$1";

// '/en' and '/fr' URIs -> use default controller
$route['^fr$'] = $route['default_controller'];
$route['^en$'] = $route['default_controller'];

The function I'm trying to call is on my non-default controller. To access it via the web, I can use this URL and it works fine: http://localhost/mobile.php/en/mycontroller/myfunction

Two things to note here (not sure if they matter):

1) We are using a non-default main php file of mobile.php instead of index.php

2) We do not have an .htaccess file set up, so we are just using the mobile.php directly in the URL.

Now, when I try to access this same function via the CLI, it is always loading up the default controller:

Code:
php mobile.php en mycontroller myfunction

I have tried this with and without the "en". Any ideas what I'm doing wrong here?


Messages In This Thread
Issue with routing when running from the CLI - by El Forum - 09-29-2011, 10:57 AM
Issue with routing when running from the CLI - by El Forum - 04-08-2013, 12:41 PM
Issue with routing when running from the CLI - by El Forum - 04-08-2013, 01:19 PM
Issue with routing when running from the CLI - by El Forum - 04-08-2013, 02:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB