CodeIgniter Forums
Issue with Session.php on CLI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Issue with Session.php on CLI (/showthread.php?tid=88852)



Issue with Session.php on CLI - byrallier - 11-20-2023

Hello everyone,I got stuck on a issue with CI 3 version.
I have external PHP file which help me utilize CI Controller externally. 
I have a loader :
My_loader a simple custom loader to load controller. I got it from here: https://forum.codeigniter.com/showthread.php?tid=73898&pid=366518#pid366518

On my ExternalPHP file:
PHP Code:
require("index.php")
$CI =& get_instance();
$CI->load->library('session/session');//unintended-added while trying to fix issue
$CI->load->model('Mymodel');
$CI->load->controller('Myparser'); 
session is loaded by autoloader:
$autoload['libraries'] = array(
'database',
'session',
...

But the issue is when I called controller, it simply try to load "session.php" which is not allowed to be added over CLI as its nothing for it. then my controller is not loaded properly by saying:

unable to locate the specified class: Session.php

session is normally loaded by autoload in config.php and works perfectly on web server. But when it comes to loading a controller in an external php file. Its a huge pain. I wanted to patch framework itself to avoid trying to load session over CLI but you know, at some ponit I will have to migrate CI4 and other versions and i dont want to mass the code

also the other weird part is, when I remove loading controller part, it doesnt throw the error.
any advice?


RE: Issue with Session.php on CLI - e-ujian - 11-21-2023

Is there any error log?maybe You could paste it here so we can take a look


RE: Issue with Session.php on CLI - byrallier - 11-21-2023

program stop running when I tried to load controller with following error:

"unable to locate the specified class: Session.php"
I debug whole code,its identified perfectly, file exists but its not load as it called over CLI