Welcome Guest, Not a member yet? Register   Sign In
Problem with CLI script routing or execution
#1

(This post was last modified: 04-22-2025, 10:09 AM by massimiliano1.mancini.)

Hi All,
I'm trying to add some cron scheduled jobs to my site. I've started with a simple controller:

PHP Code:
<?php

namespace App\Controllers\CLI;

use 
CodeIgniter\Controller;

class 
Cronjob extends Controller
{
    public function cliMessage($to 'World')
    {
        return "Hello {$to}!" PHP_EOL;
    }


When I call it in my public directory

Code:
php index.php CLI/cronjob message

no output is showed. The index.php and routing are executed for sure, infact if I make some mistakes on porpouse, they are showed. For example, this is the output of the following command

Code:
PS C:\develop\horizon\public> php index.php CLI/cronjob mAssage
ERROR: 404

Controller or its method is not found: \App\Controllers\CLI\Cronjob::cliMAssage

Any help is appreciated.
Reply


Messages In This Thread
Problem with CLI script routing or execution - by massimiliano1.mancini - 04-22-2025, 05:34 AM
RE: Problem with CLI script output - by warcooft - 04-22-2025, 07:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB