Welcome Guest, Not a member yet? Register   Sign In
CLI & Sub-folders
#1

Hey Guys,

I've been following the user guide at: https://ellislab.com/codeigniter/user-gu...l/cli.html

with a file in xxx/application/controllers/Tools.php
I can get the following to work: php index.php tools message

I want to have a sub-directory within controllers like:
xxx/application/controllers/cron/Tools.php

I cannot get this to run properly! Keep getting: The controller/method pair you requested was not found.

I've tried running the following:
php index.php tools message
php index.php cron/tools message
php index.php "cron/tools" message
php index.php "cron" tools message
php index.php cron tools message
php index.php /var/www/xxx/application/controllers/cron/tools message

I'm thinking it's a routing issue, but due to the fact I'm using the CLI with attempts as absolute paths it shouldn't be. Not sure.

I'm pulling my hair out!! Any help would be appreciated!
Reply
#2

The official userguide is at codeigniter.com, don't use EllisLab's.
Reply
#3

maybetry to create a custom route

PHP Code:
$route['cron_tools/message'] = 'cron/tools/message'
Reply
#4

So it turns out "tools" as a directory within application/controllers is a reserved word.

Eg: application/controllers/tools/Dosomething.php

application/controllers/cron/Dosomething.php, or any other variant works just fine.

Bloody hell.
Reply
#5

It's not a reserved word, but controllers have priority over directories, so if you have a controllers/Tools.php ...
Reply




Theme © iAndrew 2016 - Forum software by © MyBB