Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter CLI returns blank when utilizing a model
#1

Hi,



I am a newbie on this forum but almost always I do find my answers on this forum regarding CI except the following...

I am working on a project which is developed on CI 3.1.11 and I have to create some cli procedures that will later work on scheduled tasks (cron). However, when I run a function as simple as the following from CLI I do not get any return to my screen when I make a call to the model.



The code I am running is that simple...



PHP Code:
<?php defined('BASEPATH') OR exit('No direct script access allowed');
     class Cli extends CI_Controller
     
{
          public function check_expired()
          {
            if(!$this->input->is_cli_request()) { echo "Not Allowed!"; return; }

            $t $this->db->get('requests');
            echo "C";

            $t->result();
            echo "D";
         }
     

my DB configuration is...


PHP Code:
$active_group 'default';
$query_builder TRUE;

$db['default'] = array(
'dsn' => '',
'hostname' => 'hmm.aha.com:3306',
'username' => 'shhh',
'password' => 'a23fsdf@s',
'database' => 'mydb',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);

$db['db2'] = $db['default'];
$db['db2']['database'] = "mydb2";

if (
module_exists('plans')) {
$db['db3'] = $db['default'];
$db['db3']['database'] = "mydb3";



my autoloaded libraries are...





PHP Code:
|
You can also supply an alternative library name to be assigned
in the controller:
|
$autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array('database','session','lib_filter','simple_html_dom'); 


The "C" is echoed on the terminal but the "D" is not and of course when I tried to manipulate some records on the model the function just didn't touch them nor I got any kind of message on the codeigniter logs.

I must add that my environment is based on a debian docker and that I am running this command from interactive bash with root privileges (docker exec -it container_name bash).

If anyone has some kind of idea or lead I would be grateful to know it.





Thanks in advance!
Reply


Messages In This Thread
CodeIgniter CLI returns blank when utilizing a model - by maslas - 01-15-2020, 11:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB