How to execute a method of a class in Codeigniter via CronJob?
Ex: main.php accessed at link
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Principal extends CI_Controller {
public function __construct()
{
parent::__construct();
//Load Dependencies
}
public function listaCron()
{
file_put_contents("teste.txt", "Crontab executado em: ".date(‘d/m/Y H:i’));
}
}