CodeIgniter Forums

Full Version: Threading integration in codeigniter ver 3.1 and php ver >=5.6 not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Everyone could anyone help me for the below.

I am trying create on library class which has do some curl call using my model method.
see below code snippet-
PHP Code:
class CI_Multi_thread extends Thread {
   protected $CI;
   public function __construct($data=array()) {
       $this->CI =&get_instance();
   }
   public function run($data=array()) {
       $this->faux_apikey=$data['faux_apikey'];
       $this->faux_apisecret=$data['faux_apisecret'];
       $this->device_ip=$data['device_ip'];
       $this->device_id=$data['device_id'];
       $this->fk_group_id=$data['fk_group_id'];
       
       $this
->CI->load->model('Fauxapi_model','fm',TRUE);
       $this->CI->fm->processing_logs($this->device_id,$this->fk_group_id);
       $this->CI->fm->config_set($this->faux_apikey,$this->faux_apisecret,$this->device_ip,$this->device_id,$this->fk_group_id);
   }

but &get_instance(); is not working. show "Fatal error: Cannot assign by reference to overloaded object in C:\xampp\htdocs\darshan\system\libraries\Multi_thread.php on line 8
"
also my server is also close my current process when last running thread is stop.

after all it stop my complete server working for 5 second.

I am also attaching my libraries and model file here.