Answer the question
In order to leave comments, you need to log in
How to access a method in a controller from the CLI?
We have an old legacy project on codeigniter 3.
We have a new task, where cron should be used for the first time in the life of the project.
The cron itself is fine, but it’s impossible to reach the desired method of the desired controller.
Googling among the garbage brought this: https://codeigniter3.ru/guide/general/cli
But in their example, the configuration option with index.php is used, and in this project, index.php is not used. Accordingly, the method specified in the documentation does not work.
The conclusion is:
Fatal error: Class 'имя-класса' not found in /var/www/'путь-к-контроллеру'.php on line 4
class cron extends имя-класса {
Answer the question
In order to leave comments, you need to log in
Autoload doesn't happen from CLI...
To remove index.php from the call.
What prevents before
class cron extends class-name {
include '/path/to/file/with/class.php'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question