I am accessing a Putty server to try and run a method from a controller.
I have a controller inside a batch
folder named GetPrefectures
.
The controller's code:
<?php
require_once(APPPATH."controller/batch/GetIndustry.php");
class GetPrefecture extends BaseController
{
function __construct()
{
$this->load->model("PrefectureModel", "prefModel");
}
public function init()
{
log_message('test_debug');
$this->checkSteps();
}
public function checkSteps()
{
$completed_steps = $this->prefModel->checkStepstbl();
$this->getList($completed_steps);
}
}
?>
I try to add a log message so I know that the controller is working.
Here's how I do it. after I access the server and locate the path for my file, I enter the code to run the controller.
php /var/www/listingapp/public/index.php batch/GetPrefecture init
then, I use the logs with this code to check if it is running.
tail -n1000 -f application/logs/log-2017-08-25.php
But after this, the cmd shows me this as logs:
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
DEBUG - 2017-08-25 10:55:46 --> UTF-8 Support Enabled
DEBUG - 2017-08-25 10:55:46 --> Global POST, GET and COOKIE data sanitized
I cannot see any log message "test_debug", I think it cannot detect the init
, so this means nothing is running.
How can I do this? Am I missing something?